emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode fe9d65d 222/385: helper for yatemplates


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode fe9d65d 222/385: helper for yatemplates
Date: Tue, 5 Oct 2021 23:59:35 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit fe9d65d7d2d25784132b08af534c5c0a0db3ca17
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    helper for yatemplates
---
 haskell-tng-contrib.el | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/haskell-tng-contrib.el b/haskell-tng-contrib.el
index 1c9499f..25fa70c 100644
--- a/haskell-tng-contrib.el
+++ b/haskell-tng-contrib.el
@@ -5,8 +5,8 @@
 
 ;;; Commentary:
 ;;
-;;  Untested / untestable commands that are either contributed by the community
-;;  or require an external process to exist on PATH.
+;;  Untested / untestable commands that may require an external process to 
exist
+;;  on PATH.
 ;;
 ;;; Code:
 
@@ -52,5 +52,20 @@
     (re-search-forward (rx point (group (+ (not space))) space))
     (kill-new (match-string 1))))
 
+;;;###autoload
+(defun haskell-tng-filename-to-modulename ()
+  "Infers the ModuleName for the current file based on filesystem layout."
+  (mapconcat
+   'identity
+   (reverse
+    (seq-take-while
+     (lambda (e) (let (case-fold-search)
+              (string-match-p (rx bos upper) e)))
+     (reverse
+      (split-string
+       (file-name-sans-extension buffer-file-name)
+       "\\/"))))
+   "."))
+
 (provide 'haskell-tng-contrib)
 ;;; haskell-tng-contrib.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]