summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2022-12-05 15:17:55 +0100
committerJonas Bernoulli <jonas@bernoul.li>2022-12-05 15:17:55 +0100
commita60efa80cdb8c72dacb1e16729a801206a4e80bf (patch)
tree67e7edf51c5eb0133d669e67ab00d3b83788c428 /elisp
parent47bb86d6829ffa81ec021ee6217379b216d95bfc (diff)
downloadgeiser-a60efa80cdb8c72dacb1e16729a801206a4e80bf.tar.gz
geiser-a60efa80cdb8c72dacb1e16729a801206a4e80bf.tar.bz2
Take the byte-compilers advice into account
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-autodoc.el2
-rw-r--r--elisp/geiser-completion.el2
-rw-r--r--elisp/geiser-connection.el7
-rw-r--r--elisp/geiser-debug.el20
-rw-r--r--elisp/geiser-doc.el2
-rw-r--r--elisp/geiser-edit.el7
-rw-r--r--elisp/geiser-log.el18
-rw-r--r--elisp/geiser-repl.el3
-rw-r--r--elisp/geiser-syntax.el19
-rw-r--r--elisp/geiser-xref.el1
10 files changed, 40 insertions, 41 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index f18a6ed..abf1d97 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -185,7 +185,7 @@ you can set this variable to nil to avoid them."
(s))
(while (and p (not s))
(setq s (or (cdr (assoc (car p) signs))
- (and geiser-mode
+ (and (bound-and-true-p geiser-mode)
(cdr (geiser-edit--find-def (car p) t)))))
(unless s (setq p (car path) path (cdr path))))
(cond ((stringp s) s)
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index 4064af7..584e9e0 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -97,7 +97,7 @@
(defvar geiser-completion--symbol-begin-function nil)
-(defun geiser-completion--def-symbol-begin (module)
+(defun geiser-completion--def-symbol-begin (_module)
(save-excursion (skip-syntax-backward "^-()>") (point)))
(geiser-impl--register-local-method
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el
index f11ed4c..b7d312e 100644
--- a/elisp/geiser-connection.el
+++ b/elisp/geiser-connection.el
@@ -170,7 +170,7 @@
(and tq (tq-close tq))))
(defvar geiser-con--startup-prompt nil)
-(defun geiser-con--startup-prompt (p s)
+(defun geiser-con--startup-prompt (_p s)
(setq geiser-con--startup-prompt
(concat geiser-con--startup-prompt s))
nil)
@@ -188,8 +188,7 @@
(defun geiser-con--connection-activate (c)
(when (not (car c))
- (let* ((tq (geiser-con--connection-tq c))
- (proc (geiser-con--connection-process c))
+ (let* ((proc (geiser-con--connection-process c))
(tq-filter (geiser-con--connection-tq-filter c)))
(while (accept-process-output proc 0.01))
(set-process-filter proc tq-filter)
@@ -269,7 +268,7 @@
(timeout (/ (or timeout geiser-connection-timeout) 1000.0))
(step (/ timeout 10)))
(with-timeout (timeout (geiser-con--request-deactivate req))
- (condition-case e
+ (condition-case nil
(while (and (geiser-con--connection-process con)
(not (geiser-con--connection-completed-p con id)))
(accept-process-output proc step))
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 500598c..88f1e72 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -35,6 +35,9 @@
"Debugging and error display options."
:group 'geiser)
+(define-obsolete-variable-alias 'geiser-debug-always-display-sexp-after-p
+ 'geiser-debug-always-display-sexp-after "0.26.2")
+
(geiser-custom--defcustom geiser-debug-always-display-sexp-after nil
"Whether to always display the sexp whose evaluation caused an
error after the error message in the debug pop-up.
@@ -43,9 +46,6 @@ If nil, expressions shorter than `geiser-debug-long-sexp-lines`
lines are shown before the error message."
:type 'boolean)
-(define-obsolete-variable-alias 'geiser-debug-always-display-sexp-after-p
- 'geiser-debug-always-display-sexp-after "0.26.2")
-
(geiser-custom--defcustom geiser-debug-long-sexp-lines 6
"Length of an expression in order to be relegated to the bottom
of the debug pop-up (after the error message).
@@ -54,6 +54,9 @@ If `geiser-debug-always-display-sexp-after` is t, this variable
has no effect."
:type 'int)
+(define-obsolete-variable-alias 'geiser-debug-jump-to-debug-p
+ 'geiser-debug-jump-to-debug "0.26.2")
+
(geiser-custom--defcustom geiser-debug-jump-to-debug t
"When set to t (the default), jump to the debug pop-up buffer
in case of evaluation errors.
@@ -61,8 +64,8 @@ in case of evaluation errors.
See also `geiser-debug-show-debug`. "
:type 'boolean)
-(define-obsolete-variable-alias 'geiser-debug-jump-to-debug-p
- 'geiser-debug-jump-to-debug "0.26.2")
+(define-obsolete-variable-alias 'geiser-debug-show-debug-p
+ 'geiser-debug-show-debug "0.26.2")
(geiser-custom--defcustom geiser-debug-auto-next-error-p nil
"When set, automatically invoke `next-error' on of evaluation errors.
@@ -79,8 +82,8 @@ This option takes effect even if `geiser-debug-jump-to-debug`
is set."
:type 'boolean)
-(define-obsolete-variable-alias 'geiser-debug-show-debug-p
- 'geiser-debug-show-debug "0.26.2")
+(define-obsolete-variable-alias 'geiser-debug-auto-display-images-p
+ 'geiser-debug-auto-display-images "0.26.2")
(geiser-custom--defcustom geiser-debug-auto-display-images t
"Whether to automatically invoke the external viewer to display
@@ -89,9 +92,6 @@ images when they're evaluated.
See also `geiser-repl-auto-display-images-p'."
:type 'boolean)
-(define-obsolete-variable-alias 'geiser-debug-auto-display-images-p
- 'geiser-debug-auto-display-images "0.26.2")
-
(geiser-custom--defcustom geiser-debug-treat-ansi-colors nil
"Colorize ANSI escape sequences produced by the scheme process.
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 374daa3..de18d9f 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -137,7 +137,7 @@ value if the default action should be skipped.")
(with--geiser-implementation impl
(if (null target)
(geiser-doc-module module impl)
- (let ((geiser-eval--get-module-function (lambda (x) module)))
+ (let ((geiser-eval--get-module-function (lambda (_) module)))
(geiser-doc-symbol target module impl)))))))
(defvar-local geiser-doc--buffer-link nil)
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index 480f053..3cafaa0 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -188,7 +188,7 @@ or following links in error buffers.")
(match-string 2)
(or (match-string 3) 0)
'window)
- (unless no-fill (fill-region (match-end 0) (point-at-eol)))))))
+ (unless no-fill (fill-region (match-end 0) (line-end-position)))))))
(defun geiser-edit--open-next (&optional n reset)
(interactive)
@@ -277,7 +277,10 @@ With prefix, asks for the symbol to locate."
(defun geiser-pop-symbol-stack ()
"Pop back to where \\[geiser-edit-symbol-at-point] was last invoked."
(interactive)
- (xref-pop-marker-stack))
+ (if (fboundp 'xref-go-back)
+ (xref-go-back)
+ (with-no-warnings
+ (xref-pop-marker-stack))))
(defun geiser-edit-module (module &optional method no-error)
"Asks for a module and opens it in a new buffer."
diff --git a/elisp/geiser-log.el b/elisp/geiser-log.el
index 389e7ca..ead748f 100644
--- a/elisp/geiser-log.el
+++ b/elisp/geiser-log.el
@@ -40,9 +40,15 @@
(defvar geiser-log--max-message-size 20480
"Maximum size of individual Geiser log messages.")
+(define-obsolete-variable-alias
+ 'geiser-log-verbose-p 'geiser-log-verbose "0.26.2")
+
(defvar geiser-log-verbose nil
"Log purely informational messages.")
+(define-obsolete-variable-alias
+ 'geiser-log-verbose-debug-p 'geiser-log-verbose-debug "0.26.2")
+
(defvar geiser-log-verbose-debug nil
"Log very verbose informational messages. Useful only for debugging.")
@@ -50,14 +56,6 @@
(defvar geiser-log--inhibit nil
"Set this to t to inhibit all log messages")
-(define-obsolete-variable-alias
- 'geiser-log-verbose-p 'geiser-log-verbose "0.26.2")
-
-(define-obsolete-variable-alias
- 'geiser-log-verbose-debug-p 'geiser-log-verbose-debug "0.26.2")
-
-
-
;;; Log buffer and mode:
@@ -71,14 +69,14 @@
"Simple mode for Geiser log messages buffer."
(buffer-disable-undo)
(add-hook 'after-change-functions
- (lambda (b e len)
+ (lambda (b _e _len)
(let ((inhibit-read-only t))
(when (> b geiser-log--max-buffer-size)
(delete-region (point-min) b))))
nil t)
;; Maybe this feature would better be implemented as a revert-buffer function?
(add-hook 'after-change-functions
- (lambda (b e len)
+ (lambda (_b _e _len)
(when geiser-log-autoscroll-buffer-p
(let ((my-window (get-buffer-window (geiser-log--buffer) t)))
(when (window-live-p my-window)
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 069fc1f..c256c81 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -53,9 +53,6 @@ See also `geiser-repl-current-project-function' for the function
used to discover a buffer's project."
:type 'boolean)
-(declare project-root "project.el")
-(declare project-current "project.el")
-
(defun geiser-repl-project-root ()
"Use project.el, to determine a buffer's project root."
(when-let (p (project-current)) (project-root p)))
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 6410ecc..dbbf9e5 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -293,14 +293,17 @@ implementation-specific entries for font-lock-keywords.")
(defun geiser-syntax--read-from-string (string &optional start end)
(when (stringp string)
- (let* ((start (or start 0))
- (end (or end (length string)))
- (max-lisp-eval-depth (min 20000
- (max max-lisp-eval-depth (- end start))))
- (max-specpdl-size (* 2 max-lisp-eval-depth)))
- (with-temp-buffer
- (save-excursion (insert string))
- (cons (geiser-syntax--read) (point))))))
+ ;; In Emacs 29 this variable doesn't have an effect
+ ;; anymore and `max-lisp-eval-depth' achieves the same.
+ (with-suppressed-warnings ((obsolete max-specpdl-size))
+ (let* ((start (or start 0))
+ (end (or end (length string)))
+ (max-lisp-eval-depth (min 20000
+ (max max-lisp-eval-depth (- end start))))
+ (max-specpdl-size (* 2 max-lisp-eval-depth)))
+ (with-temp-buffer
+ (save-excursion (insert string))
+ (cons (geiser-syntax--read) (point)))))))
(defun geiser-syntax--form-from-string (s)
(car (geiser-syntax--read-from-string s)))
diff --git a/elisp/geiser-xref.el b/elisp/geiser-xref.el
index 24504f7..0726d62 100644
--- a/elisp/geiser-xref.el
+++ b/elisp/geiser-xref.el
@@ -79,7 +79,6 @@
(signature (cdr (assoc "signature" xref)))
(signature-txt (and signature
(geiser-autodoc--str* signature)))
- (module (cdr (assoc "module" xref)))
(p (point)))
(when signature
(insert " - ")