]> code.delx.au - gnu-emacs-elpa/commitdiff
[Fix #2 again] Private prefixes with the display property
authorArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 14 Sep 2015 13:05:42 +0000 (14:05 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 14 Sep 2015 13:05:42 +0000 (14:05 +0100)
nameless.el

index c3d9965ce14df5fb2db8fd617fca1a59437ae456..1817b8f873b7a82f85cf7874ead4aa45243697ea 100644 (file)
@@ -120,19 +120,19 @@ displayed as `::internal-impl', instead of `:-internal-impl'."
                      (and nameless-affect-indentation-and-filling
                           (or (not (eq nameless-affect-indentation-and-filling 'outside-strings))
                               (not (nth 3 (syntax-ppss)))))))
-          (dis (concat display nameless-prefix)))
-      (when compose
-        (if (and nameless-private-prefix
-                 (equal "-" (substring (match-string 0) -1)))
-            (progn
-              (setq dis (concat dis nameless-prefix))
-              (compose-region (match-beginning 0)
-                              (match-end 0)
-                              (nameless--make-composition dis)))
-          (compose-region (match-beginning 1)
-                          (match-end 1)
-                          (nameless--make-composition dis))))
-      `(face nameless-face ,@(unless compose (list 'display dis))))))
+          (dis (concat display nameless-prefix))
+          (beg (match-beginning 1))
+          (end (match-end 1))
+          (private-prefix (and nameless-private-prefix
+                               (equal "-" (substring (match-string 0) -1)))))
+      (when private-prefix
+        (setq beg (match-beginning 0))
+        (setq end (match-end 0))
+        (setq dis (concat dis nameless-prefix)))
+      (if compose
+          (compose-region beg end (nameless--make-composition dis))
+        (add-text-properties beg end (list 'display dis)))
+      '(face nameless-face))))
 
 (defvar-local nameless--font-lock-keywords nil)