* 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.
-;;; binhex.el --- decode BinHex-encoded text
+;;; binhex.el --- decode BinHex-encoded text -*- lexical-binding:t -*-
;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
-
(eval-and-compile
(defalias 'binhex-char-int
(if (fboundp 'char-int)
(defvar binhex-last-char)
(defvar binhex-repeat)
-(defun binhex-push-char (char &optional count ignored buffer)
+(defun binhex-push-char (char &optional ignored buffer)
(cond
(binhex-repeat
(if (eq char 0)
counter (1+ counter)
inputpos (1+ inputpos))
(cond ((= counter 4)
- (binhex-push-char (lsh bits -16) 1 nil work-buffer)
- (binhex-push-char (logand (lsh bits -8) 255) 1 nil
+ (binhex-push-char (lsh bits -16) nil work-buffer)
+ (binhex-push-char (logand (lsh bits -8) 255) nil
work-buffer)
- (binhex-push-char (logand bits 255) 1 nil
+ (binhex-push-char (logand bits 255) nil
work-buffer)
(setq bits 0 counter 0))
(t (setq bits (lsh bits 6)))))
(setq tmp (and tmp (not (eq inputpos end)))))
(cond
((= counter 3)
- (binhex-push-char (logand (lsh bits -16) 255) 1 nil
+ (binhex-push-char (logand (lsh bits -16) 255) nil
work-buffer)
- (binhex-push-char (logand (lsh bits -8) 255) 1 nil
+ (binhex-push-char (logand (lsh bits -8) 255) nil
work-buffer))
((= counter 2)
- (binhex-push-char (logand (lsh bits -10) 255) 1 nil
+ (binhex-push-char (logand (lsh bits -10) 255) nil
work-buffer))))
(if header-only nil
(binhex-verify-crc work-buffer
(defun binhex-decode-region-external (start end)
"Binhex decode region between START and END using external decoder."
(interactive "r")
- (let ((cbuf (current-buffer)) firstline work-buffer status
+ (let ((cbuf (current-buffer)) firstline work-buffer
(file-name (expand-file-name
(concat (binhex-decode-region-internal start end t)
".data")
-;;; flow-fill.el --- interpret RFC2646 "flowed" text
+;;; flow-fill.el --- interpret RFC2646 "flowed" text -*- lexical-binding:t -*-
;; Copyright (C) 2000-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
(defcustom fill-flowed-display-column 'fill-column
"Column beyond which format=flowed lines are wrapped, when displayed.
;; Copyright (C) 1997, 2000-2017 Free Software Foundation, Inc.
-;; Author: Steven L Baur <steve@xemacs.org> (1997-)
+;; Author: Steven L Baur <steve@xemacs.org> (1997-2011)
;; Boruch Baum <boruch_baum@gmx.com> (2017-)
;; Keywords: mail, news
;; Version: 0.19
-;;; hashcash.el --- Add hashcash payments to email
+;;; hashcash.el --- Add hashcash payments to email -*- lexical-binding:t -*-
;; Copyright (C) 2003-2005, 2007-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl)) ; for case
+(eval-when-compile (require 'cl-lib))
(defgroup hashcash nil
"Hashcash configuration."
(defun hashcash-token-substring ()
(save-excursion
(let ((token ""))
- (loop
+ (cl-loop
(setq token
(concat token (buffer-substring (point) (hashcash-point-at-eol))))
(goto-char (hashcash-point-at-eol))
(forward-char 1)
- (unless (looking-at "[ \t]") (return token))
+ (unless (looking-at "[ \t]") (cl-return token))
(while (looking-at "[ \t]") (forward-char 1))))))
(defun hashcash-payment-required (addr)
(let* ((split (split-string token ":"))
(key (if (< (hashcash-version token) 1.2)
(nth 1 split)
- (case (string-to-number (nth 0 split))
+ (pcase (string-to-number (nth 0 split))
(0 (nth 2 split))
(1 (nth 3 split))))))
(cond ((null resource)
-;;; ietf-drums.el --- Functions for parsing RFC822bis headers
+;;; ietf-drums.el --- Functions for parsing RFC822bis headers -*- lexical-binding:t -*-
;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(defvar ietf-drums-no-ws-ctl-token "\001-\010\013\014\016-\037\177"
"US-ASCII control characters excluding CR, LF and white space.")
(defun ietf-drums-token-to-list (token)
"Translate TOKEN into a list of characters."
(let ((i 0)
- b e c out range)
+ b c out range)
(while (< i (length token))
(setq c (aref token i))
- (incf i)
+ (cl-incf i)
(cond
((eq c ?-)
(if b
(range
(while (<= b c)
(push (make-char 'ascii b) out)
- (incf b))
+ (cl-incf b))
(setq range nil))
((= i (length token))
(push (make-char 'ascii c) out))
(setq c (char-after))
(cond
((eq c ?\")
- (condition-case err
+ (condition-case nil
(forward-sexp 1)
(error (goto-char (point-max)))))
((eq c ?\()
-;;; rfc2231.el --- Functions for decoding rfc2231 headers
+;;; rfc2231.el --- Functions for decoding rfc2231 headers -*- lexical-binding:t -*-
;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
(require 'ietf-drums)
(require 'rfc2047)
(autoload 'mm-encode-body "mm-bodies")
(if (and (multibyte-string-p data)
smtpmail-code-conv-from)
- (setq data (string-as-multibyte
+ (setq data (string-as-multibyte ;FIXME: ???
(encode-coding-string data smtpmail-code-conv-from))))
(if smtpmail-debug-info
-;;; uudecode.el -- elisp native uudecode
+;;; uudecode.el -- elisp native uudecode -*- lexical-binding:t -*-
;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
-
-(eval-and-compile
- (defalias 'uudecode-char-int
- (if (fboundp 'char-int)
- 'char-int
- 'identity)))
+(defalias 'uudecode-char-int
+ (if (fboundp 'char-int)
+ 'char-int
+ 'identity))
(defgroup uudecode nil
"Decoding of uuencoded data."
If FILE-NAME is non-nil, save the result to FILE-NAME. The program
used is specified by `uudecode-decoder-program'."
(interactive "r\nP")
- (let ((cbuf (current-buffer)) tempfile firstline status)
+ (let ((cbuf (current-buffer)) tempfile firstline)
(save-excursion
(goto-char start)
(when (re-search-forward uudecode-begin-line nil t)
(insert "begin 600 " (file-name-nondirectory tempfile) "\n")
(insert-buffer-substring cbuf firstline end)
(cd (file-name-directory tempfile))
- (apply 'call-process-region
+ (apply #'call-process-region
(point-min)
(point-max)
uudecode-decoder-program
(message "Can not uudecode")))
(ignore-errors (or file-name (delete-file tempfile))))))
-(eval-and-compile
- (defalias 'uudecode-string-to-multibyte
- (cond
- ((featurep 'xemacs)
- 'identity)
- ((fboundp 'string-to-multibyte)
- 'string-to-multibyte)
- (t
- (lambda (string)
- "Return a multibyte string with the same individual chars as string."
- (mapconcat
- (lambda (ch) (string-as-multibyte (char-to-string ch)))
- string ""))))))
-
;;;###autoload
(defun uudecode-decode-region-internal (start end &optional file-name)
"Uudecode region between START and END without using an external program.
(if file-name
(with-temp-file file-name
(unless (featurep 'xemacs) (set-buffer-multibyte nil))
- (insert (apply 'concat (nreverse result))))
+ (insert (apply #'concat (nreverse result))))
(or (markerp end) (setq end (set-marker (make-marker) end)))
(goto-char start)
(if enable-multibyte-characters
(dolist (x (nreverse result))
- (insert (uudecode-string-to-multibyte x)))
- (insert (apply 'concat (nreverse result))))
+ (insert (decode-coding-string x 'binary)))
+ (insert (apply #'concat (nreverse result))))
(delete-region (point) end))))))
;;;###autoload
-;;; yenc.el --- elisp native yenc decoder
+;;; yenc.el --- elisp native yenc decoder -*- lexical-binding:t -*-
;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(defconst yenc-begin-line
"^=ybegin.*$")
(cond ((or (eq char ?\r)
(eq char ?\n)))
((eq char ?=)
- (setq char (char-after (incf first)))
+ (setq char (char-after (cl-incf first)))
(with-current-buffer work-buffer
(insert-char (mod (- char 106) 256) 1)))
(t
(with-current-buffer work-buffer
;;(insert-char (mod (- char 42) 256) 1)
(insert-char (aref yenc-decoding-vector char) 1))))
- (incf first))
+ (cl-incf first))
(setq bytes (buffer-size work-buffer))
(unless (and (= (cdr (assq 'size header-alist)) bytes)
(= (cdr (assq 'size footer-alist)) bytes))