Hi all: I want to set text properties on a string, however, any time I get a nil result after the (set|add)-text-properties call, the text is not properly propetied.
what's wrong??
I use emacs 22.1, here is the source code:
(defun show-paren-minibuffer (pair-point pos) "show the paren pair in the minibuffer, pos is current point , pair-point is the point of the paren pair" (if (not (pos-visible-in-window-p pair-point))
(let ((pair-line-number (line-number-at-pos pair-point)) (pos-line-number (line-number-at-pos pos)) show-string offset) (if (not (equal pair-line-number pos-line-number))
(save-excursion (goto-line pair-line-number) (setq offset (- pair-point (line-beginning-position))) (setq show-string (buffer-substring (line-beginning-position) (line-end-position)))
(diag-pr (set-text-properties offset offset '(comment t face highlight) show-string)) (if (< (length show-string) 20)
(setq show-string (concat (buffer-substring (- (line-beginning-position) 30) (- (line-beginning-position) 1)) "\n"
show-string "\n" (buffer-substring (+ (line-end-position) 1) (+ (line-end-position) 30))))) (message "%s" show-string))))))
and my diag-pr macro:
(defmacro diag-pr (exp) "print the _expression_ result in the *scratch buffer" `(let ((tmp-diag-var ,exp)) (print (list ',exp 'result 'is (list tmp-diag-var)) diag-buffer)
tmp-diag-var))