From e1d60d2110987f1060c0b37d032621c669d97d5e Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 19 Oct 2025 18:49:00 -0500 Subject: fix: all: fixes to get emacs-chess working on 30.2 - added lexical-binding headers to all source files - replaced make-variable-buffer-local with defvar-local throughout source code - replaced deprecated cl library with cl-lib, including replacing assert with cl-assert to emacs-chess-steps.el - added proper headers and footers to test files when missing - populated chess images and chess sounds directory - fixed defcustom calling directory-files without error handling. xboard installation no longer required. --- chess-images.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'chess-images.el') diff --git a/chess-images.el b/chess-images.el index aacd153..edc87f2 100644 --- a/chess-images.el +++ b/chess-images.el @@ -1,4 +1,4 @@ -;;; chess-images.el --- Chessboard display style using graphical images +;;; chess-images.el --- Chessboard display style using graphical images -*- lexical-binding: t; -*- ;; Copyright (C) 2002, 2005, 2008, 2014 Free Software Foundation, Inc. @@ -40,13 +40,9 @@ "Module for drawing a chess-display using graphical images." :group 'chess-display) -(defvar chess-images-cache nil) -(defvar chess-images-size nil) -(defvar chess-images-sizes nil) - -(make-variable-buffer-local 'chess-images-cache) -(make-variable-buffer-local 'chess-images-size) -(make-variable-buffer-local 'chess-images-sizes) +(defvar-local chess-images-cache nil) +(defvar-local chess-images-size nil) +(defvar-local chess-images-sizes nil) (defun chess-images-clear-image-cache (sym value) (set sym value) @@ -58,9 +54,11 @@ :group 'chess-images) (defcustom chess-images-directory - (if (directory-files "/usr/share/games/xboard/pixmaps" nil "\\.xpm") - "/usr/share/games/xboard/pixmaps" - (expand-file-name "pieces/xboard" + (or (ignore-errors + (when (and (file-directory-p "/usr/share/games/xboard/pixmaps") + (directory-files "/usr/share/games/xboard/pixmaps" nil "\\.xpm")) + "/usr/share/games/xboard/pixmaps")) + (expand-file-name "pieces/xboard" (file-name-directory (or load-file-name buffer-file-name)))) "Directory containing the chess piece bitmap images. -- cgit v1.2.3