Skip to content

Commit

Permalink
Merge pull request #13 from ShiroTakeda/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ShiroTakeda authored Oct 24, 2024
2 parents 6fb90d9 + a39a5f5 commit 0bbce5f
Show file tree
Hide file tree
Showing 21 changed files with 1,030 additions and 1,782 deletions.
54 changes: 18 additions & 36 deletions BUGS_PROBLEMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,46 @@ Maintainer: Shiro Takeda
Known bugs and problems of GAMS mode.
============================================================

## The old version Emacs
## Older Versions of Emacs

I only test gams-mode.el in Emacs 27 and gams-mode.el is likely not to work
well in the old version of Emacs.
I have only tested `gams-mode.el` in Emacs 29. Therefore, `gams-mode.el` is likely to not work well in older versions of Emacs.


## Viewing documents

`gams-view-document` (C-cC-m) does not work in the old versions of GAMS
which has different folder structure to the current GAMS.
The `gams-view-document` command (C-c C-m) does not work in older versions of GAMS that have a different folder structure compared to the current GAMS.


## End gams statement block with `;`
## Ending GAMS Statement Blocks with Semicolons

Automatic indent and coloring often fail when gams statement blocks do not
end with character `;` (semicolon). Although gams syntax does not
necessarily require `;` (`;` is often omissible), please end statement
blocks with `;`.
Automatic indentation and syntax highlighting often fail when GAMS statement blocks do not end with a semicolon (;). Although GAMS syntax does not necessarily require a semicolon (it is often optional), please end statement blocks with a semicolon.


## Make each gams declaration (definition) block small
## Keep GAMS Declaration Blocks Small

You may often include many elements into one declaration block. For example,
you may declare dozens of sets in one `set` statement. But, such large
declaration block often makes GAMS mode extremely slow because it requires a
lot of time to color the buffer. So, you had better divide a large
declaration block into several small blocks.
You might often include many elements in one declaration block. For example, you may declare dozens of sets in one `set` statement. However, such large declaration blocks often make GAMS mode extremely slow because it requires a lot of time to color the buffer. Therefore, it is better to divide large declaration blocks into several smaller blocks.


## TAB key

Emacs comes with various major modes such as C mode, Perl mode, Fortran
mode, Java mode, LaTeX mode etc. In these major modes, TAB key is
conventionally binded not to inserting TAB character itself but to the
another function, namely, indentation function. GAMS mode follows this
convention of major modes. So, in GAMS mode, TAB key is used to make
indentation of the current line and not used to insert TAB character.
Emacs comes with various major modes such as C mode, Perl mode, Fortran mode, Java mode, LaTeX mode, etc. In these major modes, the TAB key is conventionally bound not to insert the TAB character itself but to another function, namely, indentation. GAMS mode follows this convention. Therefore, in GAMS mode, the TAB key is used to indent the current line and not to insert a TAB character.

But if you want to use TAB key to insert TAB character, put the following
code in your "init.el":
If you want to use the TAB key to insert a TAB character, add the following code to your `init.el`:

;; Bind indent-line to F2.
(define-key gams-mode-map [f2] 'gams-indent-line)
;; Bind inserting TAB character to TAB key.
(define-key gams-mode-map "\t" 'gams-insert-tab)

By this code, TAB key is binded to inserting TAB character and F2 key is
binded to the indentation.
```emacs-lisp
;; Bind indent-line to F2.
(define-key gams-mode-map [f2] 'gams-indent-line)
;; Bind inserting TAB character to TAB key.
(define-key gams-mode-map "\t" 'gams-insert-tab)
```

With this code, the TAB key will be bound to insert a TAB character, and the F2 key will be bound to indentation.

## File name

In GAMS mode, file names with spaces and characters other than alphabet and
number often cause troubles (e.g. file name like "test (example 1).gms").
To avoid troubles, you had better use file name only with alphabet and
number.
In GAMS mode, file names with spaces and characters other than alphabets and numbers often cause problems (e.g., a file name like "test (example 1).gms"). To avoid issues, it is better to use file names containing only alphabets and numbers.




<!--
--------------------
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,29 @@ Maintainer: Shiro Takeda
Change logs of GAMS mode.
====================================================

Version 6.16
----------------------------------

* The font-locking and autocompletion features have been improved.

* `company-mode`, which is a text completion framework for Emacs, has been
available in GAMS mode since version 6.13. If you want to use
company-mode in GAMS mode, 1) install company-mode by yourself, and 2)
add the following code to init.el

```emacs-lisp
(add-hook
'gams-mode-hook
#'(lambda () (company-mode))
)
```

Version 6.15
----------------------------------

* In GAMS-SIL mode, $label command is now treated in the same way as
$title command.



Version 6.14
Expand Down
Loading

0 comments on commit 0bbce5f

Please sign in to comment.