Gnus development mailing list
 help / color / mirror / Atom feed
* user format functions
@ 2010-08-31 23:50 Richard Riley
  2010-09-01  0:02 ` Richard Riley
  2010-09-01 20:15 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Riley @ 2010-08-31 23:50 UTC (permalink / raw)
  To: ding


I have defined a user format function for my group line formar :-

,----
|   (defun gnus-user-format-function-g (headers)
|     (string-match "\\(^.*\\)\\+\\(.*\\):\\(.*\\)" gnus-tmp-group)
|     (setq gnus-tmp-group (concat (propertize (upcase(substring (match-string 2 gnus-tmp-group) 0 1)) 'face 'bold 'color 'red) " -- " (match-string 3 gnus-tmp-group)))
|     (replace-regexp-in-string "INBOX" "✉" gnus-tmp-group)
|     )
`----

The propertize doesnt work. Am I doing it correctly or does Gnus wipe
the properties I try to apply to part of the returned string?
  



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: user format functions
  2010-08-31 23:50 user format functions Richard Riley
@ 2010-09-01  0:02 ` Richard Riley
  2010-09-01 20:15 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Riley @ 2010-09-01  0:02 UTC (permalink / raw)
  To: Richard Riley; +Cc: ding


Apologies. Same question, but this time the correct code :-

,----
|   (defun gnus-user-format-function-g (headers)
|     (string-match "\\(^.*\\)\\+\\(.*\\):\\(.*\\)" gnus-tmp-group)   
|     (replace-regexp-in-string "INBOX" "✉" (concat (propertize (upcase(substring (match-string 2 gnus-tmp-group) 0 1)) 'face 'bold 'color 'red) " -- " (match-string 3 gnus-tmp-group))))
`----



Richard Riley <rileyrg@googlemail.com> writes:

> I have defined a user format function for my group line formar :-
>
> ,----
> |   (defun gnus-user-format-function-g (headers)
> |     (string-match "\\(^.*\\)\\+\\(.*\\):\\(.*\\)" gnus-tmp-group)
> |     (setq gnus-tmp-group (concat (propertize (upcase(substring (match-string 2 gnus-tmp-group) 0 1)) 'face 'bold 'color 'red) " -- " (match-string 3 gnus-tmp-group)))
> |     (replace-regexp-in-string "INBOX" "✉" gnus-tmp-group)
> |     )
> `----
>
> The propertize doesnt work. Am I doing it correctly or does Gnus wipe
> the properties I try to apply to part of the returned string?
>




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: user format functions
  2010-08-31 23:50 user format functions Richard Riley
  2010-09-01  0:02 ` Richard Riley
@ 2010-09-01 20:15 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-01 20:15 UTC (permalink / raw)
  To: ding

Richard Riley <rileyrg@googlemail.com> writes:

> The propertize doesnt work. Am I doing it correctly or does Gnus wipe
> the properties I try to apply to part of the returned string?

Yes, I think so.

Try the following patch and see whether that makes any difference.

diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el
index 91a1784..5b3198a 100644
--- a/lisp/gnus-spec.el
+++ b/lisp/gnus-spec.el
@@ -658,7 +658,7 @@ are supported for %s."
 		  (push el flist)))
 	    (insert elem-type)
 	    (push (car elem) flist))))
-      (setq fstring (buffer-substring-no-properties (point-min) (point-max))))
+      (setq fstring (buffer-substring (point-min) (point-max))))
 
     ;; Do some postprocessing to increase efficiency.
     (setq


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-01 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-31 23:50 user format functions Richard Riley
2010-09-01  0:02 ` Richard Riley
2010-09-01 20:15 ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).