Code Monkey home page Code Monkey logo

Comments (6)

jingtaozf avatar jingtaozf commented on June 11, 2024

Can you turn on debug flag of literate-elisp to locate the issue.

(setf literate-elisp-debug-p t)

Please delete back trace buffer if it exists too.

from literate-elisp.

akater avatar akater commented on June 11, 2024

literate-elisp-byte-compile-file apparently doesn't work at all, and so far I'm surprised if it ever did.

Namely, whitespace-skipping routine seems to be completely broken.

Prepare test.org for byte-compilation as follows:

# -*- encoding: utf-8; mode: org; org-src-preserve-indentation: t; -*-

#+BEGIN_SRC elisp
(defun test-- () (random))
#+END_SRC

With test.org and literate-elisp.el in current directory, in emacs -Q -L ., run the following:

(add-to-list 'load-path "/usr/share/emacs/site-lisp/org/")
;; or wherever org is
(require 'org)
(load "literate-elisp.el")
(literate-elisp-byte-compile-file "test.org")

The error is, get-file-char (empty arglist) gets called with non-empty arglist in literate-elisp-peek.

Emacs version is 27.2 but I don't see any mentions of get-file-char changes in commit messages of Emacs git repository.

from literate-elisp.

jingtaozf avatar jingtaozf commented on June 11, 2024

I have tested it in Emacs 27.2 in Mac OS and can't reproduce it.

from literate-elisp.

jingtaozf avatar jingtaozf commented on June 11, 2024

@akater Please re-open this issue if you still have issue

from literate-elisp.

akater avatar akater commented on June 11, 2024

Yes I still have the issue. What's the signature of get-file-char, in your Emacs 27.2 on Mac OS?

from literate-elisp.

akater avatar akater commented on June 11, 2024

Here's the backtrace:

Debugger entered--Lisp error: (wrong-number-of-arguments #<subr get-file-char> 1)
  get-file-char(98)
  funcall(get-file-char 98)
  (progn (funcall in c))
  (if c (progn (funcall in c)))
  (let ((c (funcall in))) (if c (progn (funcall in c))) c)
  (cond ((bufferp in) (save-current-buffer (set-buffer in) (if (not (eobp)) (progn (char-after))))) ((markerp in) (save-current-buffer (set-buffer (marker-buffer in)) (if (< (marker-position in) (point-max)) (progn (char-after in))))) ((functionp in) (let ((c (funcall in))) (if c (progn (funcall in c))) c)))
  literate-elisp-peek(get-file-char)
  (cl-find (literate-elisp-peek in) '(10 32 9))
  (while (cl-find (literate-elisp-peek in) '(10 32 9)) (literate-elisp-next in))
  literate-elisp-ignore-white-space(get-file-char)
  literate-elisp-read-datum(get-file-char)
  (setq form (literate-elisp-read-datum in))
  (while t (setq form (literate-elisp-read-datum in)) (if form (progn (throw '--cl-block-nil-- form))) (if literate-elisp-org-code-blocks-p (progn (throw '--cl-block-nil-- nil))) (if (null (literate-elisp-peek in)) (progn (throw '--cl-block-nil-- nil))))
  (let* ((form nil)) (while t (setq form (literate-elisp-read-datum in)) (if form (progn (throw '--cl-block-nil-- form))) (if literate-elisp-org-code-blocks-p (progn (throw '--cl-block-nil-- nil))) (if (null (literate-elisp-peek in)) (progn (throw '--cl-block-nil-- nil)))) nil)
  (catch '--cl-block-nil-- (let* ((form nil)) (while t (setq form (literate-elisp-read-datum in)) (if form (progn (throw '--cl-block-nil-- form))) (if literate-elisp-org-code-blocks-p (progn (throw '--cl-block-nil-- nil))) (if (null (literate-elisp-peek in)) (progn (throw '--cl-block-nil-- nil)))) nil))
  read(get-file-char)
  (byte-compile-file file load)
  (unwind-protect (byte-compile-file file load) (fset 'read original-read))
  (let ((literate-elisp-org-code-blocks-p nil) (load-file-name buffer-file-name) (original-read (symbol-function 'read))) (fset 'read (symbol-function 'literate-elisp-read-internal)) (unwind-protect (byte-compile-file file load) (fset 'read original-read)))
  literate-elisp-byte-compile-file("test.org")
  (progn (literate-elisp-byte-compile-file "test.org"))
  eval((progn (literate-elisp-byte-compile-file "test.org")) t)

from literate-elisp.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.