fix warnings from emacs 31
authorIan Kelling <iank@fsf.org>
Tue, 27 May 2025 20:31:49 +0000 (16:31 -0400)
committerIan Kelling <iank@fsf.org>
Tue, 27 May 2025 20:31:49 +0000 (16:31 -0400)
visible-mark.el

index d9c7f7b03f7b86f1520e5a7e7ab0eeb0bbd9962e..f1235099cba1f07f468af7e4571b5a56aed0c93a 100644 (file)
@@ -1,3 +1,4 @@
+;;; ...  -*- lexical-binding: t -*-
 ;;; visible-mark.el --- Make marks visible.
 
 ;; Copyright (C) 2014 by Ian Kelling
@@ -69,9 +70,6 @@
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl))
-
 (defgroup visible-mark nil
   "Show the position of your mark."
   :group 'convenience
@@ -97,7 +95,7 @@ to the window margin."
   :group 'visible-mark
   :type 'boolean)
 
-(defcustom global-visible-mark-mode-exclude-alist nil
+(defcustom global-visible-mark-mode-exclude-list nil
   "A list of buffer names to be excluded."
   :group 'visible-mark
   :type '(repeat regexp))
@@ -220,23 +218,22 @@ the last defined face will be reused."
         (overlay-put overlay 'face face)
         (move-overlay overlay pos (1+ pos)))))))
 
-(require 'easy-mmode)
 (defun visible-mark-mode-maybe ()
   (when (cond
          ((minibufferp (current-buffer)) nil)
-         ((cl-flet ((fun (arg)
-                         (if (null arg) nil
-                           (or (string-match (car arg) (buffer-name))
-                               (fun (cdr arg))))))
-            (fun global-visible-mark-mode-exclude-alist)) nil)
+         ((let ((regex-list global-visible-mark-mode-exclude-list)
+                 match)
+             (while (and (not match) regex-list)
+               (setq match (string-match (car regex-list) (buffer-name))
+                     regex-list (cdr regex-list)))
+             match) nil)
          (t t))
     (visible-mark-mode t)))
 
 ;;;###autoload
 (define-minor-mode visible-mark-mode
   "A mode to make the mark visible."
-  nil nil nil
-  :group 'visible-mark
+  :init-value nil
   (if visible-mark-mode
       (progn
         (visible-mark-initialize-overlays)
@@ -246,8 +243,10 @@ the last defined face will be reused."
     (remove-hook 'post-command-hook 'visible-mark-move-overlays t)))
 
 ;;;###autoload
-(define-global-minor-mode
-  global-visible-mark-mode visible-mark-mode visible-mark-mode-maybe
+(define-globalized-minor-mode
+  global-visible-mark-mode
+  visible-mark-mode
+  visible-mark-mode-maybe
   :group 'visible-mark)
 
 (provide 'visible-mark)