[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `format-spec' fails to pass on text properties
From: |
Daniel Brockman |
Subject: |
Re: `format-spec' fails to pass on text properties |
Date: |
Fri, 13 May 2005 18:05:52 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Here's a fix that seems to work, but I'm not very experienced in
hacking Elisp so I'm probably doing something stupid.
*** emacs/lisp/gnus/format-spec.el~ 2003-09-01 17:45:23.000000000 +0200
--- emacs/lisp/gnus/format-spec.el 2005-05-13 17:48:07.438183352 +0200
***************
*** 45,54 ****
(let* ((num (match-string 1))
(spec (string-to-char (match-string 2)))
(val (cdr (assq spec specification))))
- (delete-region (1- (match-beginning 0)) (match-end 0))
(unless val
(error "Invalid format character: %s" spec))
! (insert (format (concat "%" num "s") val))))
;; Signal an error on bogus format strings.
(t
(error "Invalid format string"))))
--- 45,59 ----
(let* ((num (match-string 1))
(spec (string-to-char (match-string 2)))
(val (cdr (assq spec specification))))
(unless val
(error "Invalid format character: %s" spec))
! (let ((text (format (concat "%" num "s") val)))
! (insert-and-inherit text)
! ;; Delete the specifier body.
! (delete-region (+ (match-beginning 0) (length text))
! (+ (match-end 0) (length text)))
! ;; Delete the percent sign.
! (delete-region (1- (match-beginning 0)) (match-beginning 0)))))
;; Signal an error on bogus format strings.
(t
(error "Invalid format string"))))
--
Daniel Brockman <address@hidden>