From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55342 Path: main.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.general Subject: Re: A lot of questions concerning `gnus-score-edit-file-at-point' Date: Mon, 29 Dec 2003 22:15:05 +0100 Organization: Dept. of Theoretical Physics, University of Ulm Sender: ding-owner@lists.math.uh.edu Message-ID: References: Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1072732528 24928 80.91.224.253 (29 Dec 2003 21:15:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Dec 2003 21:15:28 +0000 (UTC) Original-X-From: ding-owner+M3882@lists.math.uh.edu Mon Dec 29 22:15:25 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ab4jV-00077j-00 for ; Mon, 29 Dec 2003 22:15:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1Ab4jK-0002Fa-00; Mon, 29 Dec 2003 15:15:14 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1Ab4jG-0002FV-00 for ding@lists.math.uh.edu; Mon, 29 Dec 2003 15:15:10 -0600 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id 99ED63A0115 for ; Mon, 29 Dec 2003 15:15:09 -0600 (CST) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Ab4jF-0002uR-00 for ; Mon, 29 Dec 2003 22:15:09 +0100 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ab4jD-0002uJ-00 for ; Mon, 29 Dec 2003 22:15:07 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Ab4jD-0006TL-00 for ; Mon, 29 Dec 2003 22:15:07 +0100 Original-Lines: 87 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: :6KQZ[nyoS_edmB.%gw-=)BYth^|2+Y+^cu%I$FSx!&>-'om>3H7A|M&n(V7fIo3P.;yo.b yq4$p;ZaBtkv)\}biaiBQe"mD}iib1AA@99-fZ7i*bLhNRVC&0Wkxg9)SH?oWc@{ Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:5X6miTxFvybULOAFKe/4Ed1+Mls= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55342 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55342 On Mon, Dec 29 2003, Karl Pfl=E4sterer wrote: > That raises another question: is the `(setq truncate-lines t)' really > necessary? I don't see a reason and I don't like it at all. Maybe `truncate-lines' has been used because most of the time people are more interested in the rule than in the file name. I also use quite often in this buffer to see the filename. Most of the time I only see the directory. 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 Instead of "[", "]" and " -> ", we can use other delimiters: Whatever fits well in the new `gnus-score-edit-file-at-point' code and is more or clear for the user. Additionally, I'd like to add some kind of "Quick help", telling the user about useful key bindings in that buffer (and maybe explain the output lines above). See the patch below[1]. Opinions? > (defun gnus-score-edit-file-at-point () > "Edit score file at point. Useful especially after `V t'." [...] > (if (or (string-match "non-file" file) (not file) (string=3D "" file)) Shouldn't this read... (if (or (not file) (string-match "non-file" file) (string=3D "" file)) If file is nil, `string-match' will error out otherwise. Bye, Reiner. --8<---------------cut here---------------start------------->8--- --- gnus-score.el 22 Dec 2003 11:39:05 -0000 6.38 +++ gnus-score.el 29 Dec 2003 20:54:48 -0000 @@ -2354,7 +2365,8 @@ (let ((gnus-newsgroup-headers (list (gnus-summary-article-header))) (gnus-newsgroup-scored nil) - trace) + trace + file) (save-excursion (nnheader-set-temp-buffer "*Score Trace*")) (setq gnus-score-trace nil) @@ -2370,12 +2382,26 @@ (interactive) (bury-buffer nil) (gnus-summary-expand-window))) - (local-set-key "e" 'gnus-score-edit-file-at-point) + (local-set-key "e" (lambda () + "Run `gnus-score-edit-file-at-point'." + (interactive) + (gnus-score-edit-file-at-point))) (setq truncate-lines t) (while trace - (insert (format "%S -> %s\n" (cdar trace) - (or (caar trace) "(non-file rule)"))) + (setq file (or (caar trace) + "(non-file rule)")) + (insert (format "%S [%s] -> %s\n" + ;; sync with `gnus-score-edit-file-at-point' + (cdar trace) + (file-name-sans-extension + (file-name-nondirectory file)) + (abbreviate-file-name file))) (setq trace (cdr trace))) + (insert + "\n\nQuick help: + + q - quit + e - edit score file entry") (goto-char (point-min)) (gnus-configure-windows 'score-trace))) (set-buffer gnus-summary-buffer) --8<---------------cut here---------------end--------------->8--- --=20 ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/