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

Extract regexp for .ipkg sourcedir option to constant and update the regexp to include also double quotes. #627

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions idris-ipkg-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
(defconst idris-ipkg-font-lock-defaults
`(,idris-ipkg-keywords))

(defconst idris-ipkg-sourcedir-re
"^sourcedir\\s-*=\\s-*\"?\\([a-zA-Z/0-9]+\\)\"?")
;; "^\\s-*sourcedir\\s-*=\\s-*\\(\\sw+\\)"

;;; Completion

Expand Down Expand Up @@ -142,7 +145,7 @@
(goto-char (point-min))
(when (and (file-exists-p src-dir)
(file-directory-p src-dir)
(re-search-forward "^sourcedir\\s-*=\\s-*\\([a-zA-Z/0-9]+\\)" nil t))
(re-search-forward idris-ipkg-sourcedir-re nil t))
(let ((start (match-beginning 1))
(end (match-end 1))
(map (make-sparse-keymap)))
Expand Down Expand Up @@ -304,9 +307,7 @@ arguments."
(save-excursion
(goto-char (point-min))
(let ((found
(re-search-forward "^\\s-*sourcedir\\s-*=\\s-*\\(\\sw+\\)"
nil
t)))
(re-search-forward idris-ipkg-sourcedir-re nil t)))
(if found
(let ((subdir (buffer-substring-no-properties (match-beginning 1) (match-end 1))))
(concat (file-name-directory basename) subdir))
Expand Down
Loading