branch: externals/a68-mode commit 9249efde00b68f3d3da40c012ccff040b75c1bf7 Author: Jose E. Marchesi <jose.march...@oracle.com> Commit: Jose E. Marchesi <jose.march...@oracle.com>
Do auto-stropping only after space and newline --- a68-mode.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/a68-mode.el b/a68-mode.el index 749ba8d691..1030d56ce8 100644 --- a/a68-mode.el +++ b/a68-mode.el @@ -426,16 +426,18 @@ into a68--mode-indicants." a68--mode-indicants) (defun a68--do-auto-stropping () - (let (id beginning end) - (save-excursion - (when (looking-back (rx bow (group (any "a-z") (zero-or-more (any "a-z0-9_")))) - nil t) - (setq beginning (match-beginning 1)) - (setq end (match-end 1)) - (setq id (upcase (buffer-substring-no-properties beginning end))))) - (when (member id (append a68-keywords a68--mode-indicants)) - (goto-char end) - (delete-region beginning end) - (insert id)))) + (when (or (eq (char-before) ?\s) + (eq (char-before) ?\n)) + (let (id beginning end) + (save-excursion + (when (looking-back (rx bow (group (any "a-z") (zero-or-more (any "a-z0-9_")))) + nil t) + (setq beginning (match-beginning 1)) + (setq end (match-end 1)) + (setq id (upcase (buffer-substring-no-properties beginning end))))) + (when (member id (append a68-keywords a68--mode-indicants)) + (goto-char end) + (delete-region beginning end) + (insert id))))) ;;; a68-mode.el ends here