Topic on User talk:ArielGlenn/Emacs as a PHP IDE

MarkAHershberger (talkcontribs)

Here is what I use

(use-package editorconfig)
(use-package prog-mode
  :init
  (defun mah/setup-prettify ()
    "Called when mode is activated."
    ;; specify font for all unicode characters
    (when (member "Symbola" (font-family-list))
      (set-fontset-font t 'symbol "Symbola")
      (set-fontset-font t 'greek "Go Mono"))
    (mapcar (lambda (x)
              (push x prettify-symbols-alist))
            '(("<=" . ?≤) (">=" . ?≥) ("->" . ?→) ("!==" . ?≢)
              ("==" . ?≅) ("===" . ?≡) ("lambda" . ?λ)
              ("=>" . ?⇒) ("!=" . ?≠) ("nil" . ?∅))))
  :hook ((prog-mode . prettify-symbols-mode)
         (prog-mode . editorconfig-mode)
         (prog-mode . mah/setup-prettify)))

(Well, ok, I use prettify, too, so if you don't like having Unicode equivalents to those operators, you can ignore that part.)

(Here's a question: why do are tabs set to 4 spaces in the editor here, but when they're displayed in the pre, they are eight?)

ArielGlenn (talkcontribs)

Hey thanks for this, when I get my head up from IDE tweaks I'll definitely look at better php mode settings, and these will be first on the list!

I will skip the greek operators, thanks, since that would just be potential for confusion with actual greek text.

Tab display is an utter mystery to me. Cargo cult copy-paste all the way and cross my fingers, that's my mantra!

MarkAHershberger (talkcontribs)

Greek is only used for lambda. The others are in the Symbola font. So, if you don't want the greek bit:

 (defun mah/setup-prettify ()
   "Called when mode is activated."
   ;; specify font for all unicode characters
   (when (member "Symbola" (font-family-list))
     (set-fontset-font t 'symbol "Symbola")
   (mapcar (lambda (x)
             (push x prettify-symbols-alist))
           '(("<=" . ?≤) (">=" . ?≥) ("->" . ?→)
             ("==" . ?≅) ("===" . ?≡) ("!==" . ?≢)
             ("=>" . ?⇒) ("!=" . ?≠) ("nil" . ?∅))))

Or you could just take out the (set-fontset-font t 'greek "Go Mono") and your own greek font would be used.

Reply to "tabs vs. spaces"