diff --git a/.github/workflows/build_khoj_el.yml b/.github/workflows/build_khoj_el.yml new file mode 100644 index 00000000..b7dba2a4 --- /dev/null +++ b/.github/workflows/build_khoj_el.yml @@ -0,0 +1,39 @@ +# melpa quality checks like checkdoc, byte-compile, package-lint for khoj.el +# using melpazoid: https://github.com/riscy/melpazoid + +name: build khoj.el +on: + push: + branches: + - 'master' + paths: + - src/interface/emacs/*.el + - .github/workflows/build_khoj_el.yml + pull_request: + branches: + - 'master' + paths: + - src/interface/emacs/*.el + - .github/workflows/build_khoj_el.yml + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: { python-version: 3.9 } + - name: Install + run: | + python -m pip install --upgrade pip + sudo apt-get install emacs && emacs --version + git clone https://github.com/riscy/melpazoid.git ~/melpazoid + pip install ~/melpazoid + - name: Run + env: + # Khoj recipe from https://github.com/melpa/melpa/pull/8321/files + RECIPE: (khoj :fetcher github :repo "debanjum/khoj" :files ("src/interface/emacs/*.el")) + EXIST_OK: true + LOCAL_REPO: ${{ github.workspace }} + run: echo $GITHUB_REF && make -C ~/melpazoid diff --git a/src/interface/emacs/README.org b/src/interface/emacs/README.org index 7ae1809e..8a998c73 100644 --- a/src/interface/emacs/README.org +++ b/src/interface/emacs/README.org @@ -1,5 +1,5 @@ * Khoj Emacs 🦅 - [[https://stable.melpa.org/#/khoj][file:https://stable.melpa.org/packages/khoj-badge.svg]] [[https://melpa.org/#/khoj][file:https://melpa.org/packages/khoj-badge.svg]] + [[https://stable.melpa.org/#/khoj][file:https://stable.melpa.org/packages/khoj-badge.svg]] [[https://melpa.org/#/khoj][file:https://melpa.org/packages/khoj-badge.svg]] [[https://github.com/debanjum/khoj/actions/workflows/build_khoj_el.yml][https://github.com/debanjum/khoj/actions/workflows/build_khoj_el.yml/badge.svg?]] /Natural language search from within Emacs using [[https://github.com/debanjum/khoj][Khoj]]/ diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index 9083d8fc..a36221b3 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -390,7 +390,7 @@ Render results in BUFFER-NAME." ;; set content type to last used or based on current buffer or to default :init-value (lambda (obj) (oset obj value (format "--content-type=%s" (or khoj--content-type (khoj--buffer-name-to-content-type (buffer-name)))))) ;; dynamically set choices to content types enabled on khoj backend - :choices (mapcar #'symbol-name (khoj--get-enabled-content-types))) + :choices (or (ignore-errors (mapcar #'symbol-name (khoj--get-enabled-content-types))) '("org" "markdown" "ledger" "music" "image"))) (transient-define-suffix khoj--search-command (&optional args) (interactive (list (transient-args transient-current-command)))