((or (eq (following-char) ?\')
(eq (preceding-char) ?\'))
(setq left-quote ?\`)))
+
+ ;; When after a named character literal, skip over the entire
+ ;; literal, not only its last word.
+ (when (= (preceding-char) ?})
+ (let ((begin (save-excursion
+ (backward-char)
+ (skip-syntax-backward "w-")
+ (backward-char 3)
+ (when (looking-at-p "\\\\N{") (point)))))
+ (when begin (goto-char begin))))
+
(forward-sexp -1)
;; If we were after `?\e' (or similar case),
;; use the whole thing, not just the `e'.
(elisp--xref-find-definitions (eval '(provide 'stephe-leake-feature)))
nil)
+(ert-deftest elisp--preceding-sexp--char-name ()
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "?\\N{HEAVY CHECK MARK}")
+ (should (equal (elisp--preceding-sexp) ?\N{HEAVY CHECK MARK}))))
+
(provide 'elisp-mode-tests)
;;; elisp-mode-tests.el ends here