Explorar o código

Merge branch 'maint'

Nicolas Goaziou %!s(int64=7) %!d(string=hai) anos
pai
achega
966af419f9
Modificáronse 2 ficheiros con 16 adicións e 11 borrados
  1. 9 10
      lisp/org-macs.el
  2. 7 1
      testing/lisp/test-org-macs.el

+ 9 - 10
lisp/org-macs.el

@@ -334,16 +334,15 @@ text properties."
 			      (value (if (stringp display) display
 				       (cl-some #'stringp display))))
 			 (when value
-			   (apply
-			    #'propertize
-			    ;; Displayed string could contain
-			    ;; invisible parts, but no nested display.
-			    (funcall prune-invisible value)
-			    (plist-put props
-				       'display
-				       (and (not (stringp display))
-					    (cl-remove-if #'stringp
-							  display)))))))))))
+			   (apply #'propertize
+				  ;; Displayed string could contain
+				  ;; invisible parts, but no nested
+				  ;; display.
+				  (funcall prune-invisible value)
+				  'display
+				  (and (not (stringp display))
+				       (cl-remove-if #'stringp display))
+				  props))))))))
     ;; `display' property overrides `invisible' one.  So we first
     ;; replace characters with `display' property.  Then we remove
     ;; invisible characters.

+ 7 - 1
testing/lisp/test-org-macs.el

@@ -70,7 +70,13 @@
    (eq 'foo
        (get-text-property 1 'face
 			  (org-string-display
-			   #("123" 1 2 (display "abc" face foo)))))))
+			   #("123" 1 2 (display "abc" face foo))))))
+  ;; Also preserve `display' property in original string.
+  (should
+   (equal "abc"
+	  (let ((s #("123" 1 2 (display "abc" face foo))))
+	    (org-string-display s)
+	    (get-text-property 1 'display s)))))
 
 
 ;;; Regexp