emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/smalltalk-mode e3eeaf1: * smalltalk-mode.el: '' doesn't


From: Stefan Monnier
Subject: [elpa] externals/smalltalk-mode e3eeaf1: * smalltalk-mode.el: '' doesn't break a string; support prettify-symbols
Date: Sun, 21 Apr 2019 17:16:42 -0400 (EDT)

branch: externals/smalltalk-mode
commit e3eeaf1658dcfaa211c43eb7b72b3b0cb8b49e76
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * smalltalk-mode.el: '' doesn't break a string; support prettify-symbols
    
    (smalltalk--syntax-propertize): Add case for ''.
    (smalltalk-prettify-symbols-alist): New var.
    (smalltalk-mode): Use it.
---
 smalltalk-mode.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/smalltalk-mode.el b/smalltalk-mode.el
index aa5cc01..2a09c30 100644
--- a/smalltalk-mode.el
+++ b/smalltalk-mode.el
@@ -264,6 +264,10 @@
      ;; used for a character literal, but not when used within strings.
      ("\\(\\$\\)[][(){}'\")]"
       (1 (if (nth 8 (syntax-ppss)) (string-to-syntax "."))))
+     ;; A '' within a string is an escaped quote and not the end of a string
+     ;; and the beginning of another.
+     ("''" (0 (if (save-excursion (nth 3 (syntax-ppss (match-beginning 0))))
+                  (string-to-syntax "."))))
      ("<" (0 (if (smalltalk--pragma-start-p (match-beginning 0))
                  (string-to-syntax "(>"))))
      (">" (0 (if (smalltalk--pragma-end-p (match-beginning 0))
@@ -504,6 +508,12 @@ The SMIE support is currently experimental 
work-in-progress.")
          `(column . ,(current-column)))))
     ))
 
+;;;; ---[ Prettify-symbols ]--------------------------------------------
+
+(defvar smalltalk-prettify-symbols-alist
+  '(("^" . ?↑)
+    (":=" . ?←)))
+
 ;;;; ---[ Interactive functions ]---------------------------------------
 
 ;;;###autoload
@@ -529,6 +539,8 @@ Commands:
                 :forward-token  #'smalltalk--smie-forward-token
                 :backward-token #'smalltalk--smie-backward-token))
 
+  (set (make-local-variable 'prettify-symbols-alist)
+       smalltalk-prettify-symbols-alist)
   (set (make-local-variable 'require-final-newline) t)
   (set (make-local-variable 'comment-start) "\"")
   (set (make-local-variable 'comment-end) "\"")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]