http-post-simple.el - (lambda(field)...)引用'而不是#'

law*_*ist 3 emacs

有人可以给我一个手动调试http-post-simple.el,以便与最新版本的Emacs Trunk一起使用:http: //www.emacswiki.org/emacs/http-post-simple.el 这是使用Org-Mode Toodledo Sync所需的文件.打开Emacs时,错误消息是:

(lambda (field) ...) quoted with ' rather than with #'
Run Code Online (Sandbox Code Playgroud)

http-post-simple.el错误来自哪里的摘录如下:

(defun http-post-encode-fields (fields &optional charset)
  "Encode FIELDS using `http-post-encode-string', where
FIELDS is an alist of \(
    \(field-name-as-symbol . \"field value as string\"\) |
    \(field-name \"value1\" \"value2\" ...\)
    \)*

CHARSET defaults to 'utf-8"
  (let ((charset (or charset 'utf-8)))
    (mapconcat #'identity
           (mapcar '(lambda (field)
             (concat (symbol-name (car field))
              "="
              (http-post-encode-string (cdr field) charset)))
               (mapcan '(lambda (field)
                 (if (atom (cdr field)) (list field)
                     ;; unpack the list
                     (mapcar '(lambda (value)
                           `(,(car field) . ,value))
                         (cdr field))))
                   fields))
           "&")))


(defun http-post-encode-multipart-data (fields files charset)
  "Return FIELDS and FILES encoded for use as the data for a multipart HTTP POST request"
  (http-post-join-lines
   (mapcar '(lambda (field)
         (http-post-bound-field
          (format "Content-Disposition: form-data; name=%S" (symbol-name (car field)))
          ""
          (cdr field)))
       fields)
   (mapcan '(lambda (file)
         (destructuring-bind (fieldname filename mime-type data) file
           (http-post-bound-field
        (format "Content-Disposition: form-data; name=%S; filename=%S" fieldname filename)
        (format "Content-type: %s" (http-post-content-type mime-type charset))
        ""
        data)))
       files)
   (format "--%s--" (http-post-multipart-boundary))))
Run Code Online (Sandbox Code Playgroud)

phi*_*ils 8

您通常不希望引用lambda表达式'.

(lambda)是自我引用和相当于#'(lambda),但'(lambda)不是一回事.

请参阅何时应使用Emacs#'函数语法?