help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: v. 29.1.1 | Missing syntax colouring option


From: Emanuel Berg
Subject: Re: v. 29.1.1 | Missing syntax colouring option
Date: Thu, 10 Aug 2023 17:44:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Ricky Tigg wrote:

> Hello. As a regular Fedora GNU-Linux user I am used to
> gnome-editor.

Welcome to the real world :)

> an option dedicated to set the *coding language* is missing
> from the UI.

You can change mode manually with, e.g. M-x emacs-lisp-mode RET

But it is better to have this done automatically, one way is
to base it on file extensions (suffixes) like this

(setq auto-mode-alist `(
    ("\\.bal\\'"     . balance-mode)
    ("\\.cl\\'"      . common-lisp-mode)
    ("\\.dat\\'"     . gnuplot-mode)
    ("\\.gpi\\'"     . gnuplot-mode)
    ("\\.grm\\'"     . sml-mode)
    ("\\.lu\\'"      . lua-mode)
    ("\\.nqp\\'"     . perl-mode)
    ("\\.php\\'"     . html-mode)
    ("\\.pic\\'"     . nroff-mode)
    ("\\.pl\\'"      . prolog-mode)
    ("\\.sed\\'"     . conf-mode)
    ("\\.service\\'" . conf-mode)
    ("\\.tap\\'"     . gcode-mode)
    ("\\.tex\\'"     . latex-mode)
    ("\\.xr\\'"      . conf-xdefaults-mode)
    ("torrc\\'"      . conf-mode)
    ("keys\\'"       . conf-mode)
    ("DOS\\'"        . text-mode)
  ,@auto-mode-alist) )

> The extension of the file I work with is *ps1*. I doubt
> Emacs knows how to determine that the expected code language
> is PowerShell as there is no syntax coloring.

On the contrary, in MELPA there are 4 packages devoted to
PowerShell, one is powershell which provides a "Mode for
editing PowerShell scripts". It is very likely they provide
font lock.

> Having to repeatedly specify the same path is without doubt
> not an option in modern software.

There are many ways to do that, one of the simplest is to not
kill buffers (or the Emacs session) and then simply use the
buffer menu to find files recently in use.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]