mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
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:
parent
29c646d1a1
commit
8050bee438
1 changed files with 9 additions and 7 deletions
16
lisp/ses.el
16
lisp/ses.el
|
|
@ -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))
|
||||
|
||||
|
|
@ -2596,9 +2598,9 @@ Return nil if cell formula was unsafe and user declined confirmation."
|
|||
curval)))))))
|
||||
(when (ses-edit-cell row col newval)
|
||||
(ses-command-hook) ; Update cell widths before movement.
|
||||
(cl-progv '(row col) (list row col) ; cl-progv to have dynamic binding
|
||||
(dolist (x ses-after-entry-functions)
|
||||
(funcall x 1)))))
|
||||
(let ((ses--row row)
|
||||
(ses--col col))
|
||||
(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.
|
||||
|
|
@ -2617,9 +2619,9 @@ spreadsheet is available for completions."
|
|||
(list 'quote (intern newval))))))
|
||||
(when (ses-edit-cell row col symb)
|
||||
(ses-command-hook) ; Update cell widths before movement.
|
||||
(cl-progv '(row col) (list row col) ; cl-progv to have dynamic binding
|
||||
(dolist (x ses-after-entry-functions)
|
||||
(funcall x 1)))))
|
||||
(let ((ses--row row)
|
||||
(ses--col col))
|
||||
(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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue