unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mohammed Sadiq <sadiq@sadiqpk.org>
To: 60463@debbugs.gnu.org
Subject: bug#60463: 29.0.60; c-ts-mode: M-x align doesn't work
Date: Sun, 22 Jan 2023 14:16:31 +0530	[thread overview]
Message-ID: <78fa4e9486dc13bd542ed8fcb9a624e0@sadiqpk.org> (raw)
In-Reply-To: <a20ad04d0fe8db406ecfbe5b968c831f@sadiqpk.org>

Minimal example to reproduce the said issue (save to test.el):

(let ((buffer (generate-new-buffer "temp.c")))
   (with-current-buffer buffer
     (c-ts-mode)
     (insert "int main (int argc,\nchar *argv[])")
     (align (point-min) (point-max))))

Execute the file with:
emacs -Q -batch -l test.el

Error log:
Error: wrong-type-argument (stringp nil)
   mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode 
0x1a9892714fae86ab>))
   debug-early-backtrace()
   debug-early(error (wrong-type-argument stringp nil))
   looking-at(nil)
   c-guess-basic-syntax()
   #f(compiled-function () #<bytecode -0x4fad04c1216d689>)()
   align-region(1 34 "^\\s-*[{}]?\\s-*$" ((lisp-second-arg (regexp . 
"\\(^\\s-+[^( \11\n]\\|(\\(\\S-+\\)\\s-+\\)\\S-+\\(\\s-+\\)") (group . 
3) (modes . align-lisp-modes) (run-if . #f(compiled-function () 
#<bytecode 0x81a7eb0ffdc1>))) (lisp-alist-dot (regexp . 
"\\(\\s-*\\)\\.\\(\\s-*\\)") (group 1 2) (modes . align-lisp-modes)) 
(open-comment (regexp . #f(compiled-function (end reverse) #<bytecode 
-0x13267ef2968538a5>)) (modes . align-open-comment-modes)) 
(c-macro-definition (regexp . "^\\s-*#\\s-*define\\s-+\\S-+\\(\\s-+\\)") 
(modes . align-c++-modes)) (c-variable-declaration (regexp . 
"[*&0-9A-Za-z_]>?[][&*]*\\(\\s-+[*&]*\\)[A-Za-z_][][0-9A-Za-z:_]*\\s-*\\(\\()\\|=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)\\s-*[;,]\\|)\\s-*$\\)") 
(group . 1) (modes . align-c++-modes) (justify . t) (valid . 
#f(compiled-function () #<bytecode -0x4fad04c1216d689>))) (c-assignment 
(regexp . "[^-=!^&*+<>/| 
\11\n]\\(\\s-*[-=!^&*+<>/|]*\\)=\\(\\s-*\\)\\([^= \11\n]\\|$\\)") (group 
1 2) (modes . align-c++-modes) (justify . t) (tab-stop)) 
(perl-assignment (regexp . "[^=!^&*+<>/| 
\11\n-]\\(\\s-*\\)=[~>]?\\(\\s-*\\)\\([^>= \11\n]\\|$\\)") (group 1 2) 
(modes . align-perl-modes) (tab-stop)) (python-assignment (regexp . 
"[^=!<> \11\n]\\(\\s-*\\)=\\(\\s-*\\)\\([^>= \11\n]\\|$\\)") (group 1 2) 
(modes quote (python-mode)) (tab-stop)) (make-assignment (regexp . 
"^\\s-*\\w+\\(\\s-*\\):?=\\(\\s-*\\)\\([^\11\n \\]\\|$\\)") (group 1 2) 
(modes quote (makefile-mode)) (tab-stop)) (c-comma-delimiter (regexp . 
",\\(\\s-*\\)[^/ \11\n]") (repeat . t) (modes . align-c++-modes) (run-if 
. #f(compiled-function () #<bytecode 0x81a7eb0ffdc1>))) 
(basic-comma-delimiter (regexp . ",\\(\\s-*\\)[^# \11\n]") (repeat . t) 
(modes append align-perl-modes '(python-mode)) (run-if . 
#f(compiled-function () #<bytecode 0x81a7eb0ffdc1>))) (c++-comment 
(regexp . "\\(\\s-*\\)\\(//.*\\|/\\*.*\\*/\\s-*\\)$") (modes . 
align-c++-modes) (column . comment-column) (valid . #f(compiled-function 
() #<bytecode 0x1bf81a64bd88fae1>))) (c-chain-logic (regexp . 
"\\(\\s-*\\)\\(&&\\|||\\|\\<and\\>\\|\\<or\\>\\)") (modes . 
align-c++-modes) (valid . #f(compiled-function () #<bytecode 
-0xb23a5ce0f1f5466>))) (perl-chain-logic (regexp . 
"\\(\\s-*\\)\\(&&\\|||\\|\\<and\\>\\|\\<or\\>\\)") (modes . 
align-perl-modes) (valid . #f(compiled-function () #<bytecode 
0x11a8c45291e76f7c>))) (python-chain-logic (regexp . 
"\\(\\s-*\\)\\(\\<and\\>\\|\\<or\\>\\)") (modes quote (python-mode)) 
(valid . #f(compiled-function () #<bytecode -0xb23a5ce0cced366>))) 
(c-macro-line-continuation (regexp . "\\(\\s-*\\)\\\\$") (modes . 
align-c++-modes) (column . c-backslash-column)) (basic-line-continuation 
(regexp . "\\(\\s-*\\)\\\\$") (modes quote (python-mode makefile-mode))) 
(tex-record-separator (regexp . #f(compiled-function (end reverse) 
#<bytecode 0xd4975ad92ca8cb1>)) (group 1 2) (modes . align-tex-modes) 
(repeat . t)) (tex-tabbing-separator (regexp . #f(compiled-function (end 
reverse) #<bytecode 0xd4975a5d4908a71>)) (group 1 2) (modes . 
align-tex-modes) (repeat . t) (run-if . #f(compiled-function () 
#<bytecode 0xa75a925f89192>))) (tex-record-break (regexp . 
"\\(\\s-*\\)\\\\\\\\") (modes . align-tex-modes)) (text-column (regexp . 
"\\(^\\|\\S-\\)\\([ \11]+\\)\\(\\S-\\|$\\)") (group . 2) (modes . 
align-text-modes) (repeat . t) (run-if . #f(compiled-function () 
#<bytecode -0xd0330bf7d0074c6>))) (text-dollar-figure (regexp . 
"\\$?\\(\\s-+[0-9]+\\)\\.") (modes . align-text-modes) (justify . t) 
(run-if . #f(compiled-function () #<bytecode 0xac8febf118136>))) 
(css-declaration (regexp . "^\\s-*\\(?:\\w-?\\)+:\\(\\s-*\\).*;") (group 
1) (modes quote (css-mode html-mode)))) ((exc-dq-string (regexp . 
"\"\\([^\"\n]+\\)\"") (repeat . t) (modes . align-dq-string-modes)) 
(exc-sq-string (regexp . "'\\([^'\n]+\\)'") (repeat . t) (modes . 
align-sq-string-modes)) (exc-open-comment (regexp . #f(compiled-function 
(end reverse) #<bytecode -0x13267ef2968538a5>)) (modes . 
align-open-comment-modes)) (exc-c-comment (regexp . "/\\*\\(.+\\)\\*/") 
(repeat . t) (modes . align-c++-modes)) (exc-c-func-params (regexp . 
"(\\([^)\n]+\\))") (repeat . t) (modes . align-c++-modes)) (exc-c-macro 
(regexp . "^\\s-*#\\s-*\\(if\\w*\\|endif\\)\\(.*\\)$") (group . 2) 
(modes . align-c++-modes))))
   align(1 34)
   (save-current-buffer (set-buffer buffer) (c-ts-mode) (insert "int main 
(int argc,\nchar *argv[])") (align (point-min) (point-max)))
   (let ((buffer (generate-new-buffer "temp.c"))) (save-current-buffer 
(set-buffer buffer) (c-ts-mode) (insert "int main (int argc,\nchar 
*argv[])") (align (point-min) (point-max))))
   eval-buffer(#<buffer  *load*> nil "/home/sadiq/test.el" nil t)
   load-with-code-conversion("/home/sadiq/test.el" "/home/sadiq/test.el" 
nil t)
   load("/home/sadiq/test.el" nil t)
   command-line-1(("-l" "test.el"))
   command-line()
   normal-top-level()
Wrong type argument: stringp, nil





  reply	other threads:[~2023-01-22  8:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-01 10:20 bug#60463: 29.0.60; c-ts-mode: M-x align doesn't work Mohammed Sadiq
2023-01-02 22:44 ` Yuan Fu
2023-01-03  9:05   ` Mohammed Sadiq
2023-01-03 11:19     ` Stefan Kangas
2023-01-03 12:53       ` Eli Zaretskii
2023-01-03 15:53         ` Stefan Kangas
2023-01-19  9:22   ` Mohammed Sadiq
2023-01-22  8:46     ` Mohammed Sadiq [this message]
2023-01-08  0:55 ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78fa4e9486dc13bd542ed8fcb9a624e0@sadiqpk.org \
    --to=sadiq@sadiqpk.org \
    --cc=60463@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).