0

I'm very new to GNU Emacs. I use 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. Here is my ~/.emacs file.

(setq-default tab-width 4)

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))

(custom-set-variables
'(package-selected-packages '(php-mode ligature))
'(tool-bar-mode nil))
(custom-set-faces
'(default ((t (:family "Fira Code" :foundry "CTDB" :slant normal :weight normal :height    128 :width normal)))))

(require 'ligature)

;; Enable the www ligature in every possible major mode
(ligature-set-ligatures t '("www"))

;; Enable ligatures in programming modes                                                           
(ligature-set-ligatures 'prog-mode '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\"    "{-" "::"
                                 ":::" ":=" "!!" "!=" "!==" "-}" "----" "-->" "->" "->>"
                                 "-<" "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_"
                                 "#_(" ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" "/**"
                                 "/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|=" "|>" "^=" "$>"
                                 "++" "+++" "+>" "=:=" "==" "===" "==>" "=>" "=>>" "<="
                                 "=<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*"
                                 "<*>" "<|" "<|>" "<$" "<$>" "<!--" "<-" "<--" "<->" "<+"
                                 "<+>" "<=" "<==" "<=>" "<=<" "<>" "<<" "<<-" "<<=" "<<<"
                                 "<~" "<~~" "</" "</>" "~@" "~-" "~>" "~~" "~~>" "%%"))

(global-ligature-mode 't)

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/catppuccin")
(load-theme 'catppuccin t)

(setq catppuccin-flavor 'macchiato) ;; 'frappe or 'latte, 'macchiato, or 'mocha
(catppuccin-reload)

;; This happens with this active or inactive
;; php-mode
;;(use-package php-mode
;;  :commands php-mode
;;  :mode "\\.php\\'")

There seems to be a problem with quotes and syntax highlighting. I did a few google searches but I couldn't find anything that would solve my problem, tried turning php-mode on and off. I don't know what my next step should be.

Reopening the file seems to temporary fix it.

enter image description here

8
  • What's your question?
    – Drew
    Feb 21, 2023 at 23:23
  • If you run emacs -Q and then load php-mode.elc manually via M-x load-file (i.e. without any of the rest of your config), do you see the same thing?
    – phils
    Feb 22, 2023 at 2:32
  • @phils I get "Cannot open load file: No such file or directory, php". I did M-x load-file RET /home/razvbir/.emacs.d/elpa/php-mode-20230212.731/php-mode.elc. After this failed, I've copied the file in the same directory as my php file and I get the same error message. I just type php-m and use tab to complete the file name, I know the file is there. Feb 22, 2023 at 11:07
  • @Drew My question is: what am I doing wrong? I assume this is not a php-mode bug and that I've might not configured something properly. Feb 22, 2023 at 11:10
  • @RăzvanBirișan Ah, there's more than one library for it to load in that directory. Try this instead: emacs -Q -L /home/razvbir/.emacs.d/elpa/php-mode-20230212.731 -l php-mode
    – phils
    Feb 22, 2023 at 18:07

1 Answer 1

0

Not an answer but my reputation is too low to comment. I've had this issue for years just as OP described.

I can reproduce it with emacs -Q, then loading php-mode with

(add-to-list 'load-path "~/.emacs.d/elpa/php-mode-20230423.1446/")
(package-initialize)

You can see the last two curly braces are highlighted red incorrectly.

enter image description here

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.