File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 151151 :type 'string
152152 :group 'gptel )
153153
154- (defcustom gptel-gh-github-token-load-function 'gptel--gh-restore-from-file
154+ (defcustom gptel-gh-github-token-load-function 'gptel--gh-restore-github-token- from-file
155155 " Function to load the current github token. Default behavior is file-based based on `gptel-gh-github-token-file' ."
156156 :type 'function
157157 :group 'gptel )
199199 (setq hex (nconc hex (list (aref hex-chars (random 16 ))))))
200200 (apply #'string hex)))
201201
202- (defun gptel--gh-restore-from-file ()
203- " Restore saved object from gptel-gh-github-token-file."
204- (when (file-exists-p gptel-gh-github-token-file)
202+ (defun gptel--gh-restore-github-token-from-file ()
203+ " Restore GitHub token from the file gptel-gh-github-token-file."
204+ (gptel--gh-restore-from-file gptel-gh-github-token-file)
205+ )
206+
207+ (defun gptel--gh-restore-from-file (file )
208+ " Restore saved object from FILE."
209+ (when (file-exists-p file)
205210 ; ; We set the coding system to `utf-8-auto-dos' when reading so that
206211 ; ; files with CR EOL can still be read properly
207212 (let ((coding-system-for-read 'utf-8-auto-dos ))
208213 (with-temp-buffer
209214 (set-buffer-multibyte nil )
210- (insert-file-contents-literally gptel-gh-github-token- file)
215+ (insert-file-contents-literally file)
211216 (goto-char (point-min ))
212217 (read (current-buffer ))))))
213218
You can’t perform that action at this time.
0 commit comments