Run ses-after-entry-functions with run-hook-with-args.

* lisp/ses.el (ses-after-entry-functions): Indicate that
`ses--row' and `ses--col' are dynamically bound while hook is run.
(ses-read-cell, ses-read-symbol): Use `run-hook-with-args' rather
than `dolist'+`funcall' to run hook `ses-after-entry-functions'.
This commit is contained in:
Vincent Belaïche 2025-07-10 12:53:25 +02:00
parent 699105ed3f
commit e70a8c9e6f

View file

@ -101,7 +101,9 @@
(defcustom ses-after-entry-functions '(forward-char)
"Things to do after entering a value into a cell.
An abnormal hook that usually runs a cursor-movement function.
Each function is called with ARG=1."
Each function is called with ARG=1.
Variables `ses--row' and `ses--col' are dynamically bound to cell
coordinates during hook call."
:type 'hook
:options '(forward-char backward-char next-line previous-line))
@ -2588,8 +2590,7 @@ Return nil if cell formula was unsafe and user declined confirmation."
(ses-command-hook) ; Update cell widths before movement.
(let ((ses--row row)
(ses--col col))
(dolist (x ses-after-entry-functions)
(funcall x 1)))))
(run-hook-with-args 'ses-after-entry-functions 1))))
(defun ses-read-symbol (row col symb)
"Self-insert for a symbol as a cell formula.
@ -2610,8 +2611,7 @@ spreadsheet is available for completions."
(ses-command-hook) ; Update cell widths before movement.
(let ((ses--row row)
(ses--col col))
(dolist (x ses-after-entry-functions)
(funcall x 1)))))
(run-hook-with-args 'ses-after-entry-functions 1))))
(defun ses-clear-cell-forward (count)
"Delete formula and printer for current cell and then move to next cell.