idris-hackers / idris-mode

Idris syntax highlighting, compiler-supported editing, interactive REPL and more things for Emacs.
GNU General Public License v3.0
268 stars 70 forks source link

match only .ipkg extension #494

Closed KeenS closed 5 years ago

KeenS commented 5 years ago

Current implementation matches all the names which ends with "ipkg", including inappropriate names like "example-multipkg". This patch changes to match only ipkg extensions.

ELISP> (string-match (concat "\\\." "ipkg" "$") "mypkg.ipkg")
5 (#o5, #x5, ?\C-e)
ELISP> (string-match (concat "\\\." "ipkg" "$") "ipkg")
nil
ELISP> (string-match (concat "\\\." "ipkg" "$") "multipkg")
nil
jsoo1 commented 5 years ago

Looks good. If you could add a test that would be awesome. If not, no worries. Thanks a lot!

jsoo1 commented 5 years ago

Also, do you think we should be using file-name-extension (https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Components.html)?

jsoo1 commented 5 years ago

We'll save file-name-extension for another day. Thanks!