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

sintax highlight and indentation #9

Open
davigega opened this issue Oct 29, 2019 · 15 comments
Open

sintax highlight and indentation #9

davigega opened this issue Oct 29, 2019 · 15 comments

Comments

@davigega
Copy link

Hello!
I'm new to emacs and I decided to use your package to work with csound.
I manage to install the csound-mode from Melpa and the compilation is working great (even the guide in the mini buffer, which I found great!), but the text highlight and indentation features are not.
Any suggestion?

@hlolli
Copy link
Owner

hlolli commented Oct 31, 2019

Could you send me your output from M-x describe-mode

for me I have

Enabled minor modes: Aggressive-Indent Auto-Composition
Auto-Compression Auto-Encryption Column-Number Company Dimmer
Display-Time Eldoc Electric-Indent Eval-Sexp-Fu-Flash File-Name-Shadow
Flx-Ido Font-Lock Global-Aggressive-Indent Global-Auto-Revert
Global-Company Global-Eldoc Global-Font-Lock Global-Hl-Line
Global-Undo-Tree Ido-Everywhere Ido-Vertical Line-Number Mode-Icons
Mouse-Wheel Override-Global Projectile Recentf Savehist Shell-Dirtrack
Show-Paren Size-Indication Tabbar Tabbar-Mwheel Tooltip Transient-Mark
Undo-Tree Which-Key Xclip Yas Yas-Global

(Information about these minor modes follows the major mode info.)

Csound Mode mode defined in ‘csound-mode.el’:
A major mode for interacting and coding Csound

but for the indentation, it could depend how you set up indentation globally, some users bind it to TAB, most bind newline (enter) to newline-and-indent, I personally use agsressive-indent-mode.

@burnedmonk
Copy link

I really appreciate this project.
.I have the same problem. it doesn't even work with eldoc.
what are the necessary packages?
thank you very much

@hlolli
Copy link
Owner

hlolli commented Nov 4, 2019

If you've installed it via melpa, it should all work out of the box automatically. I guess I did something wrong. Could you help me solve this by sending me the version of csound-mode which you're using and the result of M-x describe-mode while you have a csound file opened?

If there's no syntax highlighting, it could mean that font-lock-mode is disabled. If eldoc doesn't work, it probably means that eldoc-mode is off. But both should be on by default.

@davigega
Copy link
Author

davigega commented Nov 4, 2019

sorry for the late answer:
csound-mode
version: 20191005.80

describe-mode

Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Autopair Autopair-Global Blink-Cursor Eldoc Electric-Indent
File-Name-Shadow Font-Lock Global-Auto-Complete Global-Eldoc
Global-Font-Lock Global-Linum Line-Number Linum Menu-Bar Mouse-Wheel
Pyvenv Shell-Dirtrack Show-Paren Tool-Bar Tooltip Transient-Mark

I also checked the font-lock-mode is enable by using:
M-x font-lock-mode twice. The first one returns Font-Lock mode disable in current buffer and the second time it enables it again

@burnedmonk
Copy link

I try on a fresh install in emacs for OS X and linux
csound-mode ver 20191005.807

describe-mode

Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Blink-Cursor Eldoc Electric-Indent File-Name-Shadow Font-Lock
Global-Eldoc Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel
Tool-Bar Tooltip Transient-Mark

I activate
debug-on-error
on my .emacs file

Debugger entered--Lisp error: (void-function first)
  first(("ares oscils iamp, icps, iphs [, iflg]"))
  csound-eldoc-template-lookup((#("asig" 0 4 (fontified t)) #("oscils" 0 6 (fontified t)) #(".7" 0 2 (fontified t)) #("220" 0 3 (fontified t)) #("0" 0 1 (fontified t)) #("iflg" 0 4 (fontified t))))
  csound-eldoc-function()
  eldoc-print-current-symbol-info()
  #f(compiled-function () #<bytecode 0x400f18cf>)()
  apply(#f(compiled-function () #<bytecode 0x400f18cf>) nil)
  timer-event-handler([t 0 0 500000 nil #f(compiled-function () #<bytecode 0x400f18cf>) nil idle 0])

thank you very much and sorry for my little eng

@hlolli
Copy link
Owner

hlolli commented Nov 9, 2019

@burnedmonk thank so much for this good catch!

I pushed a fix ba4a5dd for this right away. For some reson, first was renamed to cl-first some time ago, it's not the first time I'm having these kinds of problems with the cl-lib.

I will research the other problems later on soon. I'm working on a better testing environment to help me catch these mistakes earlier.

@burnedmonk
Copy link

Now eldoc works great!

@JoVide
Copy link

JoVide commented Mar 30, 2021

Hi!
After trying on and off for a few month to get the syntax highlighting to work I just discovered that I've been installing csound-mode through melpa-stable (version 0.2.1, I think) instead of melpa. The melpa-stable version works, except for the syntax highlighting. Now I've installed it through melpa and everything so far works perfectly!

I just wanted to drop this here if someone else has the same issue. I love the work that's been done on this mode and I hope to learn more elisp to hopefully be able to contribute in the future.

@jave
Copy link

jave commented Dec 12, 2022

Hi! After trying on and off for a few month to get the syntax highlighting to work I just discovered that I've been installing csound-mode through melpa-stable (version 0.2.1, I think) instead of melpa. The melpa-stable version works, except for the syntax highlighting. Now I've installed it through melpa and everything so far works perfectly!

I just wanted to drop this here if someone else has the same issue. I love the work that's been done on this mode and I hope to learn more elisp to hopefully be able to contribute in the future.

thanks, this helped me as well!

@michaelmariaott
Copy link

For me the syntax highlighting stopped working, after installing the company mode. Reinstalling csound-mode or uninstalling company-mode does not help. It was otherwise a clean Emacs installation (Windows 11).

Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Blink-Cursor Company Eldoc Electric-Indent File-Name-Shadow Font-Lock
Global-Eldoc Global-Font-Lock Indent-Tabs Line-Number Menu-Bar
Mouse-Wheel Show-Paren Tool-Bar Tooltip Transient-Mark

@interperipheral
Copy link

I am having this issue as well on Windows 10. The syntax highlighting works fine on first install of the package but stops working permanently after restart.
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor Column-Number Company Company-Quickhelp Company-Quickhelp-Local Delete-Selection Eldoc Electric-Indent File-Name-Shadow Font-Lock Global-Auto-Revert Global-Company Global-Eldoc Global-Font-Lock Global-Hl-Line Indent-Tabs Line-Number Menu-Bar Mouse-Wheel Shell-Dirtrack Show-Paren Tooltip Transient-Mark Windmove

@hlolli
Copy link
Owner

hlolli commented Apr 4, 2023

I think it may be related to the fact that hl-mode has been deprecated for a better solution. I haven't looked deep into this. Im thinking because I'm missing "highlight" there in the minor modes, I'll look into this and update!

@PvonN
Copy link
Contributor

PvonN commented Apr 16, 2023

For me the syntax highlighting works not quite well. Its highlighting paths and comments but nothing else.
How should it look like?

describe-mode:
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Auto-Fill Blink-Cursor Column-Number Corfu Eldoc Electric-Indent
File-Name-Shadow Font-Lock Global-Corfu Global-Eldoc Global-Font-Lock
Global-Nlinum Line-Number Marginalia Menu-Bar Mouse-Wheel Nlinum
Override-Global Savehist Show-Paren Text-Scale Tooltip Transient-Mark
Vertico

@sohet
Copy link
Contributor

sohet commented Apr 19, 2023

How about adding the following line to the emacs initialization file as written at #10 (comment) ?
(with-eval-after-load 'csound-font-lock (setq csound-font-lock-list csound-font-lock-keywords))

@interperipheral
Copy link

interperipheral commented Apr 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants