Skip to content

Commit

Permalink
further changes for location of initialization file
Browse files Browse the repository at this point in the history
  • Loading branch information
theabro committed Oct 9, 2024
1 parent c13b93b commit 60232ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
23 changes: 17 additions & 6 deletions learners/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,27 @@ While Fortran files are plain text can could be edited with any plain text edito

### Emacs

[Emacs](https://www.gnu.org/software/emacs/) is a cross-platform text editor available for Linux, MacOS, and Windows. It will contain syntax highlighting for many Fortran file, but additional file extensions, such as `.X90` may be valid Fortran files but will not be picked up in Emacs _fortran-mode_ or _f90-mode_. These modes allow for tab-completion of Fortran statements and the addition of an drop-down menu that provides additional Fortran-related options.

Files can be manually set to fortran-mode or f90-mode using `M-x fortran-mode` or `M-x f90-mode`, but file extensions can be added to your Emacs configuration file to ensure that these are recognised when opened. The format for this is
[Emacs][emacs-link] is a cross-platform text editor available for Linux, MacOS, and Windows. It will contain syntax highlighting for many Fortran file, 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 '(("\\.mf77$" . fortran-mode)
("\\.mh$" . fortran-mode)
(append '(("\\.mf90" . f90-mode)
("\\.X90" . f90-mode)
("\\.mf90" . 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.

:::::::::::::::::::::::::
3 changes: 3 additions & 0 deletions links.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ any links that you are not going to use.
[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 60232ab

Please sign in to comment.