"J.D. Smith" <[email protected]> writes:

>> In toplevel form:
>> org-inside.el:190:16: Warning: variable ‘_’ not left unused
>> org-inside.el:433:17: Warning: variable ‘_’ not left unused
>
> These are when/if-let* predicate bindings, for which the (_ (pred-p))
> form is now dictated.  So I think we have to ignore these warnings
> (unless you know of a trick) as due to an old byte-compiler bug:
>
> | If only the test result is of interest, use ‘_’ as SYMBOL, i.e. (_
> | VALUEFORM), in which case VALUEFORM is evaluated and checked for nil
> | but the result is not bound.
>
> If it bothers you we could bind a dummy var-name, but this will be a
> very common situation (v29 bug vs. v31 new requirement).

Just drop if-let/when-let and use more traditional code (see the attached).
We generally avoid warnings, even false-positive, to make sure that real
warnings do not sneak in, lost in the noise of false-positives.

>> In end of data:
>> org-inside.el:201:8: Warning: the function ‘set-window-cursor-type’ is not 
>> known to be defined.
>> org-inside.el:200:50: Warning: the function ‘window-cursor-type’ is not 
>> known to be defined.
>
> There were introduced in v30.  Buffer-local cursor type doesn't work
> well here, because the same buffer displayed in two windows can have
> different "inside" status.  I've added an 'fboundp guard and a note to
> the custom docstring.

I do not see fboundp guard on the branch. Did you forget to push?

>From d3790ec8ee4eeea3e42bc1ec06cebf128767bfeb Mon Sep 17 00:00:00 2001
Message-ID: <d3790ec8ee4eeea3e42bc1ec06cebf128767bfeb.1787474015.git.yanta...@posteo.net>
From: Ihor Radchenko <[email protected]>
Date: Sun, 23 Aug 2026 10:31:36 +0200
Subject: [PATCH] lisp/org-inside.el: Avoid using _ binding that raises warning
 in Emacs 29

* lisp/org-inside.el (ois/window):
(org-inside--frame-changed): Use ordinary `let` + `if'/`when' instead
of `when-let*' and `if-let*'.
---
 lisp/org-inside.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/org-inside.el b/lisp/org-inside.el
index 6e243bc6a..5a700a6ff 100644
--- a/lisp/org-inside.el
+++ b/lisp/org-inside.el
@@ -186,9 +186,9 @@ (cl-defstruct (org-inside-state
 
 (defun ois/window (state)
   "Return the window associated with STATE's primary overlay."
-  (when-let* ((ov (ois/ov state))
-              (_ (overlayp ov)))
-    (overlay-get ov 'window)))
+  (let ((ov (ois/ov state)))
+    (when (overlayp ov)
+      (overlay-get ov 'window))))
 
 (defun org-inside--restore-cursor (win old-type)
   "Restore old cursor in WIN to OLD-TYPE (if any).
@@ -431,11 +431,11 @@ (defun org-inside--frame-changed (frame)
 either appeared or disappeared."
   (walk-windows
    (lambda (win)
-     (if-let* ((old-buf (window-old-buffer win)) ; may return t
-               (_ (bufferp old-buf)))
-         (with-current-buffer old-buf
-           (org-inside--buffer-changed win))
-       (org-inside--buffer-changed win))
+     (let ((old-buf (window-old-buffer win))) ; may return t
+       (if (and old-bufer (bufferp old-buf))
+           (with-current-buffer old-buf
+             (org-inside--buffer-changed win))
+         (org-inside--buffer-changed win)))
      nil frame)))
 
 (defun org-inside--add-properties (type _beg _end visible-beg visible-end)
-- 
2.54.0

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to