]> git.eshelyaron.com Git - emacs.git/commitdiff
ix bugs when a SES buffer has named cells, and another don't.
authorVincent Belaïche <vincent.belaiche@biosency.com>
Fri, 9 May 2025 12:30:50 +0000 (14:30 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 08:56:55 +0000 (10:56 +0200)
* lisp/ses.el (ses-list-named-cells): Give a message when the list is empty.
(ses--unbind-cell-name): Do not throw error in a SES buffer w/o
any named cell for gethash from 'ses--named-cell-hashmap' being
'nil'.

(cherry picked from commit 2102554a486e457cf020a03b72276e532afc98ea)

lisp/ses.el

index d23cefc53f426e2de8cb46c45ddce130775b6af9..aa3eb1bad403e3526b328743efcd824f05c5af9b 100644 (file)
@@ -504,7 +504,7 @@ This can alter PLIST."
         (setq ses--ses-buffer-list (delq buf ses--ses-buffer-list)))
        (t
         (with-current-buffer buf
-          (when (gethash name ses--named-cell-hashmap)
+          (when (and ses--named-cell-hashmap (gethash name ses--named-cell-hashmap))
             (setq used-elsewhere t
                   buffer-list nil))))))
     (unless used-elsewhere
@@ -3452,7 +3452,7 @@ while in the SES buffer."
           ((minibufferp) ses--completion-table)
           ((derived-mode-p 'help-mode) nil)
           (t (user-error "Not in a SES buffer")))))
-  (when named-cell-hashmap
+  (if named-cell-hashmap
     (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer))))
       (help-setup-xref
        (list (lambda (named-cell-hashmap buffer)
@@ -3474,7 +3474,8 @@ while in the SES buffer."
                        (princ "\n"))
                      named-cell-hashmap))
           (with-current-buffer standard-output
-            (buffer-string)))))))
+            (buffer-string)))))
+    (message "No named cell found")))
 
 
 ;;----------------------------------------------------------------------------