armindarvish / consult-gh

An Interactive interface for "GitHub CLI" client inside GNU Emacs using Consult
GNU General Public License v3.0
108 stars 12 forks source link

Browsing code of specific user #145

Closed AdrienWehrle closed 2 months ago

AdrienWehrle commented 2 months ago

Hi!

thank you a lot for working on this very useful tool! :)

I'd like to use consult-gh-search-code to browse my own code database only. I could do so by passing #test -- --owner=AdrienWehrle but typing this every single time is rather inefficient. Would you see a way around this like setting some customized default command lines arguments where I could set owner continuously?

Thank you a lot in advance for your help! :)

armindarvish commented 2 months ago

@AdrienWehrle You can define a new function and append consult-gh-search-code-args like this:

(defun consult-gh-search-my-code (&optional initial repo noaction)
  "Search my own code"
  (interactive)
  (let ((consult-gh-search-code-args (append consult-gh-search-code-args '("--owner=AdrienWehrle"))))
    (consult-gh-search-code initial repo noaction)))

If that's the only use-case you have for searching code, you can also customize consult-gh-search-code-args and add "--owner=AdrienWehrle" to that list permanently!

AdrienWehrle commented 2 months ago

Amazing thanks a lot! :)