emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/lentic 2bce4eeb78 333/333: Minor cosmetic changes to si


From: ELPA Syncer
Subject: [elpa] externals/lentic 2bce4eeb78 333/333: Minor cosmetic changes to silence compiler warnings
Date: Tue, 27 Feb 2024 13:00:52 -0500 (EST)

branch: externals/lentic
commit 2bce4eeb78199662169f0e833322112c87cde491
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Minor cosmetic changes to silence compiler warnings
    
    * lentic-dev.el (lentic-dev-insert-face): Fix defvar.
    
    * lentic.el (lentic-when-buffer): Simplify since `buffer-live-p` does
    not need its arg to be a buffer.
    (lentic-a-oset):
    * lentic-mode.el (lentic-mode-update-all-display): Use `dolist` rather
    than `-map` if we don't use the return value.
    
    * examples/lentic-orgel-org-big.el (lentic-update-contents): Remove
    unused `unwind-protect`.
---
 examples/lentic-orgel-org-big.el | 43 ++++++++++++++++++++--------------------
 lentic-dev.el                    |  7 +++----
 lentic-mode.el                   | 11 ++++------
 lentic.el                        | 27 +++++++++----------------
 4 files changed, 37 insertions(+), 51 deletions(-)

diff --git a/examples/lentic-orgel-org-big.el b/examples/lentic-orgel-org-big.el
index 5e287ea0a4..e1433abf60 100644
--- a/examples/lentic-orgel-org-big.el
+++ b/examples/lentic-orgel-org-big.el
@@ -11,7 +11,7 @@
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2014-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2014-2024  Free Software Foundation, Inc.
 
 ;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -605,27 +605,26 @@ REST is currently just ignored."
 (defun lentic-update-contents (conf &optional start stop length-before)
   "Update the contents of that-buffer with the contents of this-buffer.
 Update mechanism depends on CONF."
-  (unwind-protect
-      (m-buffer-with-markers
-          ((start-converted
-            (when (oref conf last-change-start-converted)
-              (set-marker (make-marker)
-                          (oref conf last-change-start-converted)
-                          (oref conf that-buffer))))
-           (stop-converted
-            (when (oref conf last-change-stop-converted)
-                (set-marker (make-marker)
-                            (oref conf last-change-stop-converted)
-                            (oref conf that-buffer)))))
-        ;; used these, so dump them
-        (oset conf last-change-start-converted nil)
-        (oset conf last-change-stop-converted nil)
-        (setq inhibit-read-only t)
-        ;;(lentic-log
-        ;;"Update config: %s" lentic-config)
-        (lentic-clone conf start stop length-before
-                             start-converted stop-converted)
-        (setq inhibit-read-only nil))))
+  (m-buffer-with-markers
+   ((start-converted
+     (when (oref conf last-change-start-converted)
+       (set-marker (make-marker)
+                   (oref conf last-change-start-converted)
+                   (oref conf that-buffer))))
+    (stop-converted
+     (when (oref conf last-change-stop-converted)
+       (set-marker (make-marker)
+                   (oref conf last-change-stop-converted)
+                   (oref conf that-buffer)))))
+   ;; used these, so dump them
+   (oset conf last-change-start-converted nil)
+   (oset conf last-change-stop-converted nil)
+   (setq inhibit-read-only t)
+   ;;(lentic-log
+   ;;"Update config: %s" lentic-config)
+   (lentic-clone conf start stop length-before
+                 start-converted stop-converted)
+   (setq inhibit-read-only nil)))
 
 (defun lentic-update-point (conf)
   "Update the location of point in that-buffer to reflect this-buffer.
diff --git a/lentic-dev.el b/lentic-dev.el
index 2bfd5d5fba..946d9efe26 100644
--- a/lentic-dev.el
+++ b/lentic-dev.el
@@ -8,7 +8,7 @@
 ;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2014-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2014-2024  Free Software Foundation, Inc.
 
 ;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -127,9 +127,8 @@ to make sure there is a new one."
 
 ;; #+begin_src emacs-lisp
 
-(defvar lentic-dev-insert-face
-  "Start face to use for inserted text."
-  'font-lock-keyword-face)
+(defvar lentic-dev-insert-face 'font-lock-keyword-face
+  "Start face to use for inserted text.")
 
 ;;;###autoload
 (defun lentic-dev-random-face ()
diff --git a/lentic-mode.el b/lentic-mode.el
index b0265f6d17..4b913319a7 100644
--- a/lentic-mode.el
+++ b/lentic-mode.el
@@ -8,7 +8,7 @@
 ;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2014-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2014-2024  Free Software Foundation, Inc.
 
 ;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -293,12 +293,9 @@ See also `lentic-mode-move-lentic-window'."
   (if lentic-emergency
       (setq lentic-mode-line
             (format " %s[Emergency]" lentic-mode-line-lighter))
-    (-map
-     (lambda (b)
-       (lentic-when-with-current-buffer
-           b
-         (lentic-mode-update-mode-line)))
-     (buffer-list))
+    (dolist (b (buffer-list))
+      (lentic-when-with-current-buffer b
+        (lentic-mode-update-mode-line)))
     (force-mode-line-update t)))
 
 ;; ** lentic self-doc
diff --git a/lentic.el b/lentic.el
index 9667161b26..94d311bec6 100644
--- a/lentic.el
+++ b/lentic.el
@@ -11,7 +11,7 @@
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2014-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2014-2024  Free Software Foundation, Inc.
 
 ;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -616,26 +616,22 @@ see `lentic-init' for details."
   "When BUFFER is a live buffer eval BODY."
   (declare (debug t)
            (indent 1))
-  `(when (and ,buffer
-              (buffer-live-p ,buffer))
+  `(when (buffer-live-p ,buffer)
      ,@body))
 
 (defmacro lentic-when-with-current-buffer (buffer &rest body)
   "When BUFFER is a live buffer eval BODY with BUFFER current."
   (declare (debug t)
            (indent 1))
-  `(lentic-when-buffer
-    ,buffer
-    (with-current-buffer
-        ,buffer
-      ,@body)))
+  `(lentic-when-buffer ,buffer
+     (with-current-buffer ,buffer
+       ,@body)))
 
-(defmacro lentic-with-lentic-buffer (_buffer &rest body)
+(defmacro lentic-with-lentic-buffer (buffer &rest body)
   "With BUFFER as current, eval BODY when BUFFER has a lentic."
   (declare (debug t)
            (indent 1))
-  `(lentic-when-with-current-buffer
-       buffer
+  `(lentic-when-with-current-buffer ,buffer
      (when lentic-config
        ,@body)))
 
@@ -1286,13 +1282,8 @@ Returns OBJ. See also `lentic-a-oset'"
   "On OBJ, set all properties in PLIST.
 This is a utility function which just does the same as oset, but
 for lots of things at once. Returns OBJ."
-  (-map
-   (lambda (n)
-     (eieio-oset
-      obj
-      (car n)
-      (cadr n)))
-   (-partition 2 plist))
+  (dolist (n (-partition 2 plist))
+    (eieio-oset obj (car n) (cadr n)))
   obj)
 ;; #+end_src
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]