Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File mode specification error #747

Closed
VernonGrant opened this issue Jun 15, 2023 · 5 comments · Fixed by #748
Closed

File mode specification error #747

VernonGrant opened this issue Jun 15, 2023 · 5 comments · Fixed by #748

Comments

@VernonGrant
Copy link

VernonGrant commented Jun 15, 2023

Hi,

I'm getting the following error when opening a PHP file or when trying to enable php-mode manually.

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 0)
  php-mode-debug-reinstall()
  php-mode()
  php-mode-maybe()
  set-auto-mode-0(php-mode-maybe nil)
  set-auto-mode--apply-alist((("\\.liquid" . web-mode) ("\\(?:\\(?:\\.\\(?:b\\(?:\\(?:abel\\|ower\\)rc\\)\\|json\\(?:l..." . json-mode) ("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode) ("\\.cljs\\'" . clojurescript-mode) ("\\.cljc\\'" . clojurec-mode) ("\\.\\(clj\\|cljd\\|dtm\\|edn\\)\\'" . clojure-mode) ("\\.dockerfile\\'" . dockerfile-mode) ("/Dockerfile\\(?:\\.[^/\\]*\\)?\\'" . dockerfile-mode) ("\\.editorconfig\\'" . editorconfig-conf-mode) ("go\\.mod\\'" . go-dot-mod-mode) ("\\.go\\'" . go-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode) ("\\.\\(?:php[s345]?\\|phtml\\)\\'" . php-mode-maybe) ("\\.\\(?:php\\.inc\\|stub\\)\\'" . php-mode) ("/\\.php_cs\\(?:\\.dist\\)?\\'" . php-mode) ("\\.ts\\'" . typescript-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|jbuilder\\|rabl\\|ge..." . ruby-mode) ("\\.re?st\\'" . rst-mode) ("\\.py[iw]?\\'" . python-mode) ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\'" . scss-mode) ("\\.awk\\'" . awk-mode) ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ("\\.m\\'" . objc-mode) ("\\.ii\\'" . c++-mode) ("\\.i\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.y\\(acc\\)?\\'" . c-mode) ("\\.h\\'" . c-or-c++-mode) ("\\.c\\'" . c-mode) ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode) ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) ("\\.\\(cc\\|hh\\)\\'" . c++-mode) ("\\.\\(bat\\|cmd\\)\\'" . bat-mode) ...) nil nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer mio-features.php<2>> "/path/to/some/project..." nil nil "/path/to/some/project..." (104268 2049))
  #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x3dff765178b3cab>)("/path/to/some/project..." nil nil nil)
  apply(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x3dff765178b3cab>) "/path/to/some/project..." (nil nil nil))
  editorconfig--advice-find-file-noselect(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x3dff765178b3cab>) "/path/to/some/project..." nil nil nil)
  apply(editorconfig--advice-find-file-noselect #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x3dff765178b3cab>) ("/path/to/some/project..." nil nil nil))
  find-file-noselect("/path/to/some/project..." nil nil nil)
  find-file("/path/to/some/project...")
  dired--find-file(find-file "/path/to/some/project...")
  dired--find-possibly-alternative-file("/path/to/some/project...")
  dired-find-file()
  funcall-interactively(dired-find-file)
  call-interactively(dired-find-file nil nil)
  command-execute(dired-find-file)

I'm using:

  • GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-05-31
  • php-mode 1.24.3
  • PHP 8.1.2-1ubuntu2.11
@NateEag
Copy link
Member

NateEag commented Jun 15, 2023

Looks like this is because php-mode-debug-install is called without the required force arg.

My inclination would be to make the force arg optional and default it to nil, so that feature remains available to anyone who's relying on it but the current usage asks users if they want to reinstall php-mode instead of erroring.

@zonuexe , does that sound reasonable to you? Is there some other approach you'd like better?

@zonuexe
Copy link
Member

zonuexe commented Jun 16, 2023

@VernonGrant
Sorry, this is a php-mode bug. Please use M-x php-mode-debug-reinstall manually.

@zonuexe
Copy link
Member

zonuexe commented Jun 16, 2023

@VernonGrant
Feel free to reopen the issue if the issue is not resolved.

@NateEag
Thank you for your support!

@NateEag
Copy link
Member

NateEag commented Jun 17, 2023

@zonuexe sure thing! Glad I could be a little help - you've put so much effort into php-mode over the years. ❤️

@VernonGrant
Copy link
Author

@zonuexe @NateEag I really appreciate all the work you guys are doing, thanks for resolving the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants