Gnus development mailing list
 help / color / mirror / Atom feed
* \1 in gnus-home-score-file
@ 1998-07-20  9:16 Robert Bihlmeyer
  0 siblings, 0 replies; only message in thread
From: Robert Bihlmeyer @ 1998-07-20  9:16 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 563 bytes --]

Hi,

WIBNI if the following was possible:

	(setq gnus-home-score-file '(("^nndoc:\\(.*\\)-[^-]*$" "\\1.SCORE")))

This should set, for example, the home-score-file for an expanded
comp.risks digest (named "nndoc:comp.risks-1") to "comp.risks.SCORE".
But \1 and friends do not work in gnus-home-score-file.

A patch to accomplish this is included below. It breaks
backward-compatibility in a minor way: People that had score files
named like "\1.SCORE" will lose. Is anybody using this? On DOSoid
emacsen perhaps? I think the benefit is greater than the losses.


[-- Attachment #2: Type: text/plain, Size: 1081 bytes --]

diff -u qgnus/lisp/gnus-score.el~ qgnus/lisp/gnus-score.el
--- qgnus/lisp/gnus-score.el~	Mon Jul 20 11:15:35 1998
+++ qgnus/lisp/gnus-score.el	Mon Jul 20 11:15:35 1998
@@ -2792,8 +2792,8 @@
 	      (funcall elem group))
 	     ;; Regexp-file cons
 	     ((consp elem)
-	      (when (string-match (car elem) group)
-		(cadr elem))))))
+	      (when (string-match (gnus-globalify-regexp (car elem)) group)
+		(replace-match (cadr elem) t nil group ))))))
     (when found
       (nnheader-concat gnus-kill-files-directory found))))
 
diff -u qgnus/lisp/gnus-util.el~ qgnus/lisp/gnus-util.el
--- qgnus/lisp/gnus-util.el~	Mon Jul 20 11:16:02 1998
+++ qgnus/lisp/gnus-util.el	Mon Jul 20 11:16:02 1998
@@ -965,6 +965,12 @@
     (error "Not a symbol: %s" alist))
   `(setq ,alist (delq (assq ,key ,alist) ,alist)))
 
+(defun gnus-globalify-regexp (re)
+  "Returns a regexp that matches a whole line, iff RE matches a part of it."
+  (concat (unless (string-match "^\\^" re) "^.*")
+	  re
+	  (unless (string-match "\\$$" re) ".*$")))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]


	Robbe

-- 
Robert Bihlmeyer	reads: Deutsch, English, MIME, Latin-1, NO SPAM!
<robbe@orcus.priv.at>	<http://stud2.tuwien.ac.at/~e9426626/sig.html>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-07-20  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-20  9:16 \1 in gnus-home-score-file Robert Bihlmeyer

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).