File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 179
179
(setq val (replace-match " " t t val))))
180
180
val)))))
181
181
182
+ ;;;### autoload
183
+ (defun haskell-guess-setting (name )
184
+ " Guess the specified setting of this project.
185
+ If there is no valid .cabal file to get the setting from (or
186
+ there is no corresponding setting with that name in the .cabal
187
+ file), then this function returns nil."
188
+ (interactive )
189
+ (when (and name buffer-file-name)
190
+ (let ((cabal-file (haskell-cabal-find-file (file-name-directory buffer-file-name))))
191
+ (when (and cabal-file (file-readable-p cabal-file))
192
+ (with-temp-buffer
193
+ (insert-file-contents cabal-file)
194
+ (haskell-cabal-get-setting name))))))
195
+
182
196
;;;### autoload
183
197
(defun haskell-cabal-get-dir ()
184
198
" Get the Cabal dir for a new project. Various ways of figuring this out,
You can’t perform that action at this time.
0 commit comments