Skip to content

Commit

Permalink
Text to describe set up that may be necessary to use the Emacs text e…
Browse files Browse the repository at this point in the history
…ditor (#25)

* initial commit of emacs changes, still more to do

* further changes for location of initialization file

* Update learners/setup.md

Updated following review

Co-authored-by: Dimitrios Theodorakis <[email protected]>

* Update learners/setup.md

Updated following review

Co-authored-by: Dimitrios Theodorakis <[email protected]>

---------

Co-authored-by: Dimitrios Theodorakis <[email protected]>
  • Loading branch information
theabro and astroDimitrios authored Oct 11, 2024
1 parent d91394f commit b7a26e8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
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

0 comments on commit b7a26e8

Please sign in to comment.