Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: A lot of questions concerning `gnus-score-edit-file-at-point'
Date: Tue, 30 Dec 2003 14:40:20 +0100	[thread overview]
Message-ID: <v9k74e5sqj.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <m3isjzp8z2.fsf@hamster.pflaesterer.de>

On Tue, Dec 30 2003, Karl Pflästerer wrote:

> On 29 Dec 2003, Reiner Steib <- 4.uce.03.r.s@nurfuerspam.de wrote:
[...]
>> But we can make the *Score Trace* buffer more readable with
>> `truncate-lines': We can use `abbreviate-file-name' on the full file
>> name and also print the file name (without directory and extension).
>> It could look like this:
>
>> ("@my-fqdn>$" 10000 nil r) [my-posts] ->  ~/News/score/topics/my-posts.SCORE
>
> What are »[my-posts]«?

"my-posts" is the name of the score file without directory and without
extension:

+			  (file-name-sans-extension
+			   (file-name-nondirectory file))

> [b] 
> (defun gnus-score-edit-file-at-point ()
[...]
> 	 (sep "[ \n\r\t]*")
> 	 (reg (cddr (assq 'newformat gnus-score-trace-format-alist)))
> 	(file (save-excursion
> 		;; only works in a Score Trace buffer
> 		(end-of-line)
> 		(if (and (re-search-backward reg (point-at-bol) t)
> 			 (re-search-forward  reg (point-at-eol) t))
> 		  (buffer-substring (point) (point-at-eol))
> 		  nil))))
[...]
> (defvar gnus-score-trace-format-alist
>   (list ;; name            format string     regexp    
>    (cons 'newformat (cons "%S [%s] -> %s\n" "-> +"))
>    (cons 'oldformat (cons "%S -> %3$s\n"    "-> +"))))

I don't understand the aim behind `gnus-score-trace-format-alist' in
your code.  If 'newformat (or 'oldformat) is hard-coded in the
relevant functions, I see no need for the variable.

We could use a variable to hold the delimiters (and maybe regexps?):

("@my-fqdn>$" 10000 nil r) [my-posts] ->  ~/News/score/topics/my-posts.SCORE
^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^_^^^^^----------------------------------
(a)                        |  (c)   | (e)             (f)
                          (b)      (d)

(a) the score rule
(b) opening delimiter for (c)
(c) abbreviated score file name (w/o directory and extension)
(d) closing delimiter for (c)
(e) separator (needed in `gnus-score-edit-file-at-point')
(f) full name of the score file

(b), (d) and (e) could be in the variable (alist).
`gnus-score-edit-file-at-point' and `gnus-score-find-trace' use this
variable.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




  reply	other threads:[~2003-12-30 13:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-28 17:45 Karl Pflästerer
2003-12-29 17:15 ` Reiner Steib
2003-12-29 19:59   ` Karl Pflästerer
2003-12-29 21:15     ` Reiner Steib
2003-12-29 23:10       ` Karl Pflästerer
2003-12-30 13:40         ` Reiner Steib [this message]
2003-12-30 17:30           ` Karl Pflästerer
2003-12-30 20:58             ` Reiner Steib
2003-12-30 21:17               ` Karl Pflästerer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9k74e5sqj.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).