* Re: v. 29.1.1 | Missing syntax colouring option
2023-08-10 11:18 v. 29.1.1 | Missing syntax colouring option Ricky Tigg
@ 2023-08-10 15:44 ` Emanuel Berg
2023-08-10 16:08 ` [External] : " Drew Adams
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Emanuel Berg @ 2023-08-10 15:44 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [External] : v. 29.1.1 | Missing syntax colouring option
2023-08-10 11:18 v. 29.1.1 | Missing syntax colouring option Ricky Tigg
2023-08-10 15:44 ` Emanuel Berg
@ 2023-08-10 16:08 ` Drew Adams
2023-08-10 19:47 ` Emanuel Berg
2023-08-10 17:48 ` Eli Zaretskii
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2023-08-10 16:08 UTC (permalink / raw)
To: Ricky Tigg, help-gnu-emacs@gnu.org
> the software lacks the option *Open a recent file*.
Are you sure?
M-x recentf-mode
M-x recentf-open
> Having to repeatedly specify the same path is
> without doubt not an option in modern software.
> It would be worth adding that option.
Huh? Modern software doesn't offer an option
to _have to_ repeatedly specify the same path?
And you want an option to have to do that?
Unclear, at best. If that's what you _really_
want, why?
Maybe you mean something that's almost the
opposite of what you request? Be able to _not
have to_ specify the same path over and over?
If so, your wish is granted: Just use `M-x cd',
or `M-: (setq default-directory ...)'.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : v. 29.1.1 | Missing syntax colouring option
2023-08-10 16:08 ` [External] : " Drew Adams
@ 2023-08-10 19:47 ` Emanuel Berg
0 siblings, 0 replies; 10+ messages in thread
From: Emanuel Berg @ 2023-08-10 19:47 UTC (permalink / raw)
To: help-gnu-emacs
Drew Adams wrote:
>> the software lacks the option *Open a recent file*.
>
> Are you sure?
>
> M-x recentf-mode
> M-x recentf-open
Actually that maybe isn't a bad idea to have by default in the
GUI Emacs, a menu with recent files just as in the software
the OP is used to, and in the same place, because
1) it is not a bad feature, and
2) if newcomers get frustrated by that first thing that
happens, maybe they don't come back a second (actually
third) time.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: v. 29.1.1 | Missing syntax colouring option
2023-08-10 11:18 v. 29.1.1 | Missing syntax colouring option Ricky Tigg
2023-08-10 15:44 ` Emanuel Berg
2023-08-10 16:08 ` [External] : " Drew Adams
@ 2023-08-10 17:48 ` Eli Zaretskii
2023-08-10 18:09 ` Emanuel Berg
2023-08-10 19:49 ` Jens Schmidt via Users list for the GNU Emacs text editor
2023-08-10 19:56 ` Rudolf Schlatte
4 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2023-08-10 17:48 UTC (permalink / raw)
To: help-gnu-emacs
> From: Ricky Tigg <ricky.tigg@gmail.com>
> Date: Thu, 10 Aug 2023 14:18:39 +0300
>
> Also an observation that cannot be missed; the software lacks the option *Open
> a recent file*. Having to repeatedly specify the same path is without doubt
> not an option in modern software. It would be worth adding that option..
Since you haven't described in enough detail what you mean by "Open a
recent file", I will mention another optional feature, in addition to
recentf-mode: desktop-save-mode. It records all the files you had
open when you quit Emacs, and also the configuration of windows and
frames, and restores all that when you restart Emacs. With
desktop-save-mode, you don't even need to re-open the previously-open
files, as Emacs will do that for you.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: v. 29.1.1 | Missing syntax colouring option
2023-08-10 11:18 v. 29.1.1 | Missing syntax colouring option Ricky Tigg
` (2 preceding siblings ...)
2023-08-10 17:48 ` Eli Zaretskii
@ 2023-08-10 19:49 ` Jens Schmidt via Users list for the GNU Emacs text editor
2023-08-10 20:24 ` Emanuel Berg
2023-08-10 19:56 ` Rudolf Schlatte
4 siblings, 1 reply; 10+ messages in thread
From: Jens Schmidt via Users list for the GNU Emacs text editor @ 2023-08-10 19:49 UTC (permalink / raw)
To: help-gnu-emacs
On 2023-08-10 13:18, Ricky Tigg wrote:
> 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.
Not every imaginable package is included up-front in Emacs, some
(actually: many, and not all of them imaginable) are available as
external packages and require additional installation.
There is a PowerShell Emacs major mode including syntax highlighting
on MELPA (https://melpa.org/). However MELPA is not in the list of
default package archives, so some extra work is needed to get that
going. See section "Package Installation" in the Emacs manual. The
EmacsWiki also gives instructions, just google for "emacswiki melpa".
> Also an observation that cannot be missed; the software lacks the option *Open
> a recent file*. Having to repeatedly specify the same path is without doubt
> not an option in modern software. It would be worth adding that option..
> Regards.
Others have provided already options, but maybe you look for something
as simple as a history when finding files or doing other file operations
*from the minibuffer* (that very bottom line in an Emacs frame)? Just
use cursor-up and cursor-down after starting any such file operation.
For example:
C-x C-f <up>
would bring up the path of the previous file operation to your current
prompt. AFAICT that history gets populated even if you access files
through the menu bar or tool bar.
Oh, and you can use the savehist package, which is built-in to Emacs, to
save the minibuffer history across Emacs sessions.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: v. 29.1.1 | Missing syntax colouring option
2023-08-10 11:18 v. 29.1.1 | Missing syntax colouring option Ricky Tigg
` (3 preceding siblings ...)
2023-08-10 19:49 ` Jens Schmidt via Users list for the GNU Emacs text editor
@ 2023-08-10 19:56 ` Rudolf Schlatte
2023-08-10 20:27 ` Emanuel Berg
4 siblings, 1 reply; 10+ messages in thread
From: Rudolf Schlatte @ 2023-08-10 19:56 UTC (permalink / raw)
To: help-gnu-emacs
Ricky Tigg <ricky.tigg@gmail.com> writes:
> 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.
There is a powershell-mode for Emacs at
https://github.com/jschaf/powershell.el; the README file contains
installation instructions.
^ permalink raw reply [flat|nested] 10+ messages in thread