php-mode icon indicating copy to clipboard operation
php-mode copied to clipboard

Disable propertize

Open fxbois opened this issue 3 years ago • 6 comments

Hi could you provide a way to disable "propertize" features ? I do not want my comments to be propertized. I would like also to disable php-phpdoc-font-lock-keywords. Best regards

fxbois avatar Apr 13 '21 08:04 fxbois

Something like this?


(add-hook 'php-mode-hook #'my-php-mode-hook)

(defun my-php-mode-hook ()
  "Custom `php-mode' behaviours.  Used in `php-mode-hook'."
  (setq-local syntax-propertize-function nil)
  (remove-hook 'syntax-propertize-extend-region-functions
               #'php-syntax-propertize-extend-region t))

(advice-add 'php-syntax-propertize-function :override #'ignore)

(setq php-phpdoc-font-lock-keywords nil)

phil-s avatar Nov 10 '21 03:11 phil-s

Would it be possible to provide customs for this ?

fxbois avatar Nov 10 '21 07:11 fxbois

That's up to the maintainers, but they probably have many higher priorities.

Does it work?

phil-s avatar Nov 10 '21 08:11 phil-s

I already have solutions to disable this but I think that this kind of options should really be easily configurable

fxbois avatar Nov 10 '21 15:11 fxbois

Perhaps you could provide your solutions up front when you post something like this, then?

(a) I wouldn't have wasted any time trying to help if you'd made it clear that you already knew what to do.

(b) You can help other people who might have the same question.

(c) If you want the maintainers to do something, and you show them what needs to be done in code form, you will probably improve your chances of them considering it.

phil-s avatar Nov 10 '21 21:11 phil-s

I've checked my init.el and I only had the solution for the php-phpdoc-font-lock-keywords issue. I'll try to post a pull request for the "propertize" issue.

fxbois avatar Nov 11 '21 00:11 fxbois