Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text to describe set up that may be necessary to use the Emacs text editor #25

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
site: sandpaper::sandpaper_site
---

This is a new lesson built with [The Carpentries Workbench][workbench]. It is currently in pre-alpha development by the [Edinburgh Parallel Computing Centre][epcc-link], the [National Oceanography Centre][noc-link], and the [UK Met Office][uk-met-link].
This is a new lesson built with [The Carpentries Workbench][workbench]. It is currently in pre-alpha development by the [Edinburgh Parallel Computing Centre][epcc-link], the [National Centre for Atmospheric Science][ncas-link], the [National Oceanography Centre][noc-link], and the [UK Met Office][uk-met-link].

This course is aimed at users and developers who know how to program,
but have little or no experience in Fortran, and those who may wish to
Expand Down
28 changes: 28 additions & 0 deletions learners/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,33 @@ If you are not taking this course on archer2 we recommend installing the [GFortr

:::::::::::::::::::::::::

## Text Editors and Integrated Development Environments (IDEs)

While Fortran files are plain text and can be edited with any plain text editor, it is recommened that you use an editor that is capable of _syntax highlighting_. Setup instructions for some editors are available below.

### Emacs

[Emacs][emacs-link] is a cross-platform text editor available for Linux, MacOS, and Windows. Emacs applies syntax highlighting for most Fortran files, but additional file extensions, such as `.X90` may be valid Fortran files but will not be picked up in Emacs _f90-mode_. This mode allows for tab-completion of Fortran statements and the addition of a drop-down menu that provides additional Fortran-related options.

Files can be manually set to f90-mode using `M-x f90-mode`, but file extensions can be added to your [Emacs initialization file][emacs-init-link] to ensure that these are recognised when opened. The format for this is
```lisp
(setq auto-mode-alist
(append '(("\\.mf90" . f90-mode)
("\\.X90" . f90-mode)
) auto-mode-alist))
```
::::::::::::::::: tab

### Windows/MacOS

From your home directory, initialization settings can be placed within your `.emacs.d/init.el` file.

### Linux

Initialization settings can be placed within your `~/.config/emacs/init.el` file. This location follows the Linux desktop environment guidelines.

### Legacy (cross platform)

The `.emacs` or `.emacs.el` file is an older method of configuring Emacs. This file is held in your home directory.

:::::::::::::::::::::::::
4 changes: 4 additions & 0 deletions links.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ any links that you are not going to use.
[contact]: mailto:[email protected]

[epcc-link]: https://www.epcc.ed.ac.uk/
[ncas-link]: https://ncas.ac.uk/
[noc-link]: https://noc.ac.uk/
[uk-met-link]: https://www.metoffice.gov.uk/

[install-gfortran]: https://fortran-lang.org/learn/os_setup/install_gfortran/

[emacs-link]: https://www.gnu.org/software/emacs/
[emacs-init-link]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html