File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-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+ (defun gptel--gh-restore-from-file (file )
207+ " Restore saved object from FILE."
208+ (when (file-exists-p file)
205209 ; ; We set the coding system to `utf-8-auto-dos' when reading so that
206210 ; ; files with CR EOL can still be read properly
207211 (let ((coding-system-for-read 'utf-8-auto-dos ))
208212 (with-temp-buffer
209213 (set-buffer-multibyte nil )
210- (insert-file-contents-literally gptel-gh-github-token- file)
214+ (insert-file-contents-literally file)
211215 (goto-char (point-min ))
212216 (read (current-buffer ))))))
213217
You can’t perform that action at this time.
0 commit comments