quail-cin's People
quail-cin's Issues
cin-parse-file 出現 (wrong-type-argument arrayp nil) 錯誤
emacs 由 27 升級 28.1 後,在載入 cin 檔時出現錯誤手順及錯誤如下。不好意思,麻煩您了,感謝。
#+begin_src emacs-lisp
(load-file "~/lisp/quail-cin/quail-cin.el")
(quail-cin-load-file "~/lisp/quail-cin/test.cin" t)
#+end_src
-------------------------- * Backtrace buffer start * --------------------------------
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
replace-regexp-in-string("\"" "#-#\\\"" nil t t)
(replace-regexp-in-string "\\\\" (regexp-quote (regexp-quote "\\\\")) (replace-regexp-in-string "\"" "#-#\\\"" val t t))
(replace-regexp-in-string ";" (regexp-quote (regexp-quote "\\;")) (replace-regexp-in-string "\\\\" (regexp-quote (regexp-quote "\\\\")) (replace-regexp-in-string "\"" "#-#\\\"" val t t)))
cin-safe-quote(nil)
(format templ (cin-safe-quote-key key) (cin-safe-quote val))
(replace-match (format templ (cin-safe-quote-key key) (cin-safe-quote val)))
(cond ((string= val "begin") (replace-match "(quail-define-rules")) ((string= val "end") (replace-match ")\n")) (t (replace-match (format templ (cin-safe-quote-key key) (cin-safe-quote val)))))
(cond ((eq section '%keyname) (cond ((string= val "begin") (replace-match (cin-attrs-to-header attrs))) ((string= val "end") (replace-match (cin-attrs-to-footer attrs))) (t (replace-match (format " (%d . \"%s\")" (get-byte 0 key) val))))) ((eq section '%chardef) (cond ((string= val "begin") (replace-match "(quail-define-rules")) ((string= val "end") (replace-match ")\n")) (t (replace-match (format templ (cin-safe-quote-key key) (cin-safe-quote val)))))) (t (progn (let* ((x (cons (intern key) val))) (if (member x attrs) attrs (setq attrs (cons x attrs)))) (replace-match ""))))
(let ((key (match-string 1)) (val (match-string 2))) (if (string-match-p "^%[^%]" key) (progn (cond ((string= val "begin") (progn (setq section (intern key)) (message "converting %s ..." key)))))) (cond ((eq section '%keyname) (cond ((string= val "begin") (replace-match (cin-attrs-to-header attrs))) ((string= val "end") (replace-match (cin-attrs-to-footer attrs))) (t (replace-match (format " (%d . \"%s\")" (get-byte 0 key) val))))) ((eq section '%chardef) (cond ((string= val "begin") (replace-match "(quail-define-rules")) ((string= val "end") (replace-match ")\n")) (t (replace-match (format templ (cin-safe-quote-key key) (cin-safe-quote val)))))) (t (progn (let* ((x (cons ... val))) (if (member x attrs) attrs (setq attrs (cons x attrs)))) (replace-match "")))) (if (string-match-p "^%[^%]" key) (progn (cond ((string= val "end") (progn (setq section nil) (message "parsing %s ..." cin-file-name)))))))
(while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let ((key (match-string 1)) (val (match-string 2))) (if (string-match-p "^%[^%]" key) (progn (cond ((string= val "begin") (progn (setq section ...) (message "converting %s ..." key)))))) (cond ((eq section '%keyname) (cond ((string= val "begin") (replace-match (cin-attrs-to-header attrs))) ((string= val "end") (replace-match (cin-attrs-to-footer attrs))) (t (replace-match (format " (%d . \"%s\")" ... val))))) ((eq section '%chardef) (cond ((string= val "begin") (replace-match "(quail-define-rules")) ((string= val "end") (replace-match ")\n")) (t (replace-match (format templ ... ...))))) (t (progn (let* ((x ...)) (if (member x attrs) attrs (setq attrs ...))) (replace-match "")))) (if (string-match-p "^%[^%]" key) (progn (cond ((string= val "end") (progn (setq section nil) (message "parsing %s ..." cin-file-name))))))))
(let ((templ (if phrase " (\"%s\" [\"%s\"])" " (\"%s\" \"%s\")")) (attrs (list (cons (intern "%%pkgname") pkg-name) (cons (intern "%%prompt") prompt))) section) (message "parsing %s ..." cin-file-name) (while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let ((key (match-string 1)) (val (match-string 2))) (if (string-match-p "^%[^%]" key) (progn (cond ((string= val "begin") (progn ... ...))))) (cond ((eq section '%keyname) (cond ((string= val "begin") (replace-match ...)) ((string= val "end") (replace-match ...)) (t (replace-match ...)))) ((eq section '%chardef) (cond ((string= val "begin") (replace-match "(quail-define-rules")) ((string= val "end") (replace-match ")\n")) (t (replace-match ...)))) (t (progn (let* (...) (if ... attrs ...)) (replace-match "")))) (if (string-match-p "^%[^%]" key) (progn (cond ((string= val "end") (progn ... ...))))))) (goto-char (point-min)) (replace-string "#-#\\" "") (goto-char (point-max)) (insert (format "(provide '%s)\n\n" (cin-attrs-get-pkgname attrs))) (message "parsing %s finished, quail package name is `%s'" cin-file-name (cin-attrs-get-pkgname attrs)) (if action (progn (funcall action))))
(progn (insert-file-contents cin-file-name) (goto-char (point-min)) (save-excursion (if (and (re-search-forward "%chardef[ \11]*begin" nil "noerror") (not (re-search-forward "%chardef[ \11]*end" nil "noerror"))) (progn (goto-char (point-max)) (insert "%chardef end\n")))) (save-excursion (delete-trailing-whitespace)) (if (string= "" pkg-name) (progn (setq pkg-name nil))) (if (string= "" prompt) (progn (setq prompt nil))) (let ((templ (if phrase " (\"%s\" [\"%s\"])" " (\"%s\" \"%s\")")) (attrs (list (cons (intern "%%pkgname") pkg-name) (cons (intern "%%prompt") prompt))) section) (message "parsing %s ..." cin-file-name) (while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let ((key (match-string 1)) (val (match-string 2))) (if (string-match-p "^%[^%]" key) (progn (cond (... ...)))) (cond ((eq section '%keyname) (cond (... ...) (... ...) (t ...))) ((eq section '%chardef) (cond (... ...) (... ...) (t ...))) (t (progn (let* ... ...) (replace-match "")))) (if (string-match-p "^%[^%]" key) (progn (cond (... ...)))))) (goto-char (point-min)) (replace-string "#-#\\" "") (goto-char (point-max)) (insert (format "(provide '%s)\n\n" (cin-attrs-get-pkgname attrs))) (message "parsing %s finished, quail package name is `%s'" cin-file-name (cin-attrs-get-pkgname attrs)) (if action (progn (funcall action)))))
(unwind-protect (progn (insert-file-contents cin-file-name) (goto-char (point-min)) (save-excursion (if (and (re-search-forward "%chardef[ \11]*begin" nil "noerror") (not (re-search-forward "%chardef[ \11]*end" nil "noerror"))) (progn (goto-char (point-max)) (insert "%chardef end\n")))) (save-excursion (delete-trailing-whitespace)) (if (string= "" pkg-name) (progn (setq pkg-name nil))) (if (string= "" prompt) (progn (setq prompt nil))) (let ((templ (if phrase " (\"%s\" [\"%s\"])" " (\"%s\" \"%s\")")) (attrs (list (cons (intern "%%pkgname") pkg-name) (cons (intern "%%prompt") prompt))) section) (message "parsing %s ..." cin-file-name) (while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let ((key (match-string 1)) (val (match-string 2))) (if (string-match-p "^%[^%]" key) (progn (cond ...))) (cond ((eq section ...) (cond ... ... ...)) ((eq section ...) (cond ... ... ...)) (t (progn ... ...))) (if (string-match-p "^%[^%]" key) (progn (cond ...))))) (goto-char (point-min)) (replace-string "#-#\\" "") (goto-char (point-max)) (insert (format "(provide '%s)\n\n" (cin-attrs-get-pkgname attrs))) (message "parsing %s finished, quail package name is `%s'" cin-file-name (cin-attrs-get-pkgname attrs)) (if action (progn (funcall action))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents cin-file-name) (goto-char (point-min)) (save-excursion (if (and (re-search-forward "%chardef[ \11]*begin" nil "noerror") (not (re-search-forward "%chardef[ \11]*end" nil "noerror"))) (progn (goto-char (point-max)) (insert "%chardef end\n")))) (save-excursion (delete-trailing-whitespace)) (if (string= "" pkg-name) (progn (setq pkg-name nil))) (if (string= "" prompt) (progn (setq prompt nil))) (let ((templ (if phrase " (\"%s\" [\"%s\"])" " (\"%s\" \"%s\")")) (attrs (list (cons ... pkg-name) (cons ... prompt))) section) (message "parsing %s ..." cin-file-name) (while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let ((key ...) (val ...)) (if (string-match-p "^%[^%]" key) (progn ...)) (cond (... ...) (... ...) (t ...)) (if (string-match-p "^%[^%]" key) (progn ...)))) (goto-char (point-min)) (replace-string "#-#\\" "") (goto-char (point-max)) (insert (format "(provide '%s)\n\n" (cin-attrs-get-pkgname attrs))) (message "parsing %s finished, quail package name is `%s'" cin-file-name (cin-attrs-get-pkgname attrs)) (if action (progn (funcall action))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents cin-file-name) (goto-char (point-min)) (save-excursion (if (and (re-search-forward "%chardef[ \11]*begin" nil "noerror") (not ...)) (progn (goto-char ...) (insert "%chardef end\n")))) (save-excursion (delete-trailing-whitespace)) (if (string= "" pkg-name) (progn (setq pkg-name nil))) (if (string= "" prompt) (progn (setq prompt nil))) (let ((templ (if phrase " (\"%s\" [\"%s\"])" " (\"%s\" \"%s\")")) (attrs (list ... ...)) section) (message "parsing %s ..." cin-file-name) (while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let (... ...) (if ... ...) (cond ... ... ...) (if ... ...))) (goto-char (point-min)) (replace-string "#-#\\" "") (goto-char (point-max)) (insert (format "(provide '%s)\n\n" (cin-attrs-get-pkgname attrs))) (message "parsing %s finished, quail package name is `%s'" cin-file-name (cin-attrs-get-pkgname attrs)) (if action (progn (funcall action))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(progn (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents cin-file-name) (goto-char (point-min)) (save-excursion (if (and ... ...) (progn ... ...))) (save-excursion (delete-trailing-whitespace)) (if (string= "" pkg-name) (progn (setq pkg-name nil))) (if (string= "" prompt) (progn (setq prompt nil))) (let ((templ ...) (attrs ...) section) (message "parsing %s ..." cin-file-name) (while (re-search-forward "[ \11]*\\([^ \n\11]+\\)[ \11]*\\([^\11\n]+\\)?" nil "noerror") (let ... ... ... ...)) (goto-char (point-min)) (replace-string "#-#\\" "") (goto-char (point-max)) (insert (format "(provide '%s)\n\n" ...)) (message "parsing %s finished, quail package name is `%s'" cin-file-name (cin-attrs-get-pkgname attrs)) (if action (progn ...)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
(if (cin-filename-p cin-file-name) (progn (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents cin-file-name) (goto-char (point-min)) (save-excursion (if ... ...)) (save-excursion (delete-trailing-whitespace)) (if (string= "" pkg-name) (progn ...)) (if (string= "" prompt) (progn ...)) (let (... ... section) (message "parsing %s ..." cin-file-name) (while ... ...) (goto-char ...) (replace-string "#-#\\" "") (goto-char ...) (insert ...) (message "parsing %s finished, quail package name is `%s'" cin-file-name ...) (if action ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
cin-parse-file("~/lisp/quail-cin/test.cin" t nil nil eval-buffer)
quail-cin-load-file("~/lisp/quail-cin/test.cin" t)
eval((quail-cin-load-file "~/lisp/quail-cin/test.cin" t) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
--------------------------------------- * Backtrace buffer end * --------------------------------
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.