my-test.el contains the following:
(defun test01 ()
"scan for end of entry, trapping error."
(interactive)
(condition-case nil
(setq my-pt (scan-lists (point) 1 0))
(error (setq my-pt nil)))
(if my-pt
(message "my pt is %s" my-pt)
;;else
(message "my pt is nil")))
Line 1: abcdfn(def)ghi
Line 2: abcdfn@{def}ghi
I placed the cursor just before the "(" on Line 1 and then did M-x test01. This worked okay. Trying a similar test on Line 2, with the cursor just before the "{" failed, with a "my pt is nil" message. Experimenting I tried the same test in a my-test.txt file (text major mode instead of emacs-lisp major mode). In the text major mode, both Lines 1 and 2 worked okay.
Researching, I inferred that the syntax table for emacs-lisp major mode must be different from the syntax table for text major mode. However, from the my-test.el local buffer, I executed M-x describe-syntax and found the following lines:
The parent syntax table is:
...
{ (} which means: open, matches }
} ){ which means: close, matches {
...
Experimenting, I placed the following line in the my-test.el local buffer, placed the cursor at the end of the modify-syntax-entry command, and then typed C-xC-e to execute the command.
(modify-syntax-entry ?{ "(}")
I then re-executed test01 on Line 2; again it failed with a "my pt is nil" message.
Questions:
What syntax table oriented command will permit the test01 function to work correctly on Line 2, within an emacs-lisp major mode local buffer?
Once I execute the syntax command from question 1, and find test01 working correctly on Line 2, what corresponding syntax table oriented command should I use to BACK-OUT the change made from the syntax command from question 1?