Peter Szilagyi avatar Peter Szilagyi committed 3d05374

Removed another lexical-let* for now, although in peripheral code.

Comments (0)

Files changed (1)


 (defun -Omake.get-bug-desc (callback)
   "Code to obtain text from the user about a bug report.  This
 behaves much like getting commit messages from hg or git."
-  (lexical-let*
-      ((callback callback)
-       (header
+  ;; lexical-let* appears to be buggy in Emacs 24 with identity
+  ;; bindings.
+  (let*
+      ((header
          "Please describe the problem.  Type C-x # when finished.\n"
        (start (length header))
-        (lambda ()
-          (interactive)
-          (funcall callback (buffer-substring start (point-max)))
-          (kill-buffer (-Omake.bug-report-buffer))))
+        `(lambda ()
+           (interactive)
+           (funcall ,callback (buffer-substring ,start (point-max)))
+           (kill-buffer (-Omake.bug-report-buffer))))
        (buf (-Omake.bug-report-buffer)))
     (pop-to-buffer buf)
   (make-directory Omake.File.bug-report-dir t)
-    (lexical-let*
+    ;; lexical-let* is buggy in Emacs 24, or at least different:
+    ;;
+    ;;     funcall: Invalid function: [bad-lexical-ref]
+    (let*
         ((id (Omake.Id.current))
          (existing (mapcar 'string-to-number (directory-files Omake.File.bug-report-dir)))
          (n (1+ (apply 'max existing)))
          (tramp (format "%s:%s" (system-name) dir))
          (recipients (list Omake.maintainer-email-addr))
          (subject "[omake-mode bug report]")
-         (callback (lambda (desc)
-                     (let* ((loc (format "Files: %s" tramp))
-                            (desc (format "User report:\n%s" (String.escape-quotes desc)))
-                            (body (format "%s\n\n%s" loc desc))
-                            (file (format "%s/%s" dir "user-report")))
-                       (with-temp-buffer
-                         (insert desc)
-                         (write-region nil nil file))
-                       (Omake.Mail.send
-                        :recipients recipients
-                        :subject subject
-                        :body body))))
-         (copy
-          (lambda (f name)
-            (Omake.ignore-errors
-              (copy-file f (expand-file-name name dir)))))
-         (copy-buf
-          (lambda (b name)
-            (Omake.ignore-errors
-              (with-current-buffer b (write-file name))))))
+         (callback `(lambda (desc)
+                      (let* ((loc (format "Files: %s" ,tramp))
+                             (desc (format "User report:\n%s"
+                                           (String.escape-quotes desc)))
+                             (body (format "%s\n\n%s" loc desc))
+                             (file (format "%s/%s" ,dir "user-report")))
+                        (with-temp-buffer
+                          (insert desc)
+                          (write-region nil nil file))
+                        (Omake.Mail.send
+                         :recipients ',recipients
+                         :subject ,subject
+                         :body body))))
+         (copy `(lambda (f name)
+                  (Omake.ignore-errors
+                    (copy-file f (expand-file-name name ,dir)))))
+         (copy-buf (lambda (b name)
+                     (Omake.ignore-errors
+                       (with-current-buffer b (write-file name))))))
       (message "Collecting bug files")
       (funcall copy (Omake.File.server-log) "server-log")
       (funcall copy Omake.File.server-state "server-state.el")
       (funcall copy (Omake.File.elisp id) "elisp")
       (funcall copy (Omake.File.project-log id) "project-log")
-       (funcall copy-buf (Omake.Model.get-buffer 'status) "status-buffer"))
+        (funcall copy-buf (Omake.Model.get-buffer 'status) "status-buffer"))
       (message "Emailing maintainer")
       (-Omake.get-bug-desc callback))))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.