Gnus development mailing list
 help / color / mirror / Atom feed
From: David Engster <deng@randomsample.de>
To: ding@gnus.org
Cc: Tyler Spivey <tspivey@pcdesk.net>
Subject: Re: Problem with gnus-article-hide-citation
Date: Sat, 04 Oct 2008 15:51:10 +0200	[thread overview]
Message-ID: <874p3scvu9.fsf@randomsample.de> (raw)
In-Reply-To: <kzej339r4j.fsf@kafka.physik3.gwdg.de> (David Engster's message of "Mon, 29 Sep 2008 12:35:24 +0200")

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

David Engster <deng@randomsample.de> writes:
> I agree that one place were this could be fixed is EmacsSpeak, but we
> could also at least try to circumvent this problem by putting the
> hidden text after the button, i.e. at the end of the line.

Attached is a patch against current CVS which implements the above
workaraound, so that hidden citations don't shadow the first character
of the visible text. I'd appreciate if others could test if this patch
breaks anything with hiding citations. Please note that I had to remove
the explicit newlines at the end of
gnus-cited-opened/closed-text-button-line-format; they will now be put
there implicitly. This is an incompatible change, but I'd say a rather
small (and only cosmetic) one.

If no one objects in the next few days, I'd like to commit this. I will
then also fix the doc string for gnus-article-toggle-cited-text.

-David


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cite-patch.diff --]
[-- Type: text/x-diff, Size: 2753 bytes --]

? cite-patch.diff
Index: gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 7.283
diff -u -r7.283 gnus-art.el
--- gnus-art.el	3 Oct 2008 04:21:54 -0000	7.283
+++ gnus-art.el	4 Oct 2008 13:26:26 -0000
@@ -1679,9 +1679,9 @@
     (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences)
     (gnus-treat-wash-html gnus-article-wash-html)
     (gnus-treat-emphasize gnus-article-emphasize)
+    (gnus-treat-highlight-citation gnus-article-highlight-citation)
     (gnus-treat-hide-citation gnus-article-hide-citation)
     (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe)
-    (gnus-treat-highlight-citation gnus-article-highlight-citation)
     (gnus-treat-body-boundary gnus-article-treat-body-boundary)
     (gnus-treat-play-sounds gnus-earcon-display)))
 
Index: gnus-cite.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-cite.el,v
retrieving revision 7.40
diff -u -r7.40 gnus-cite.el
--- gnus-cite.el	19 May 2008 08:47:42 -0000	7.40
+++ gnus-cite.el	4 Oct 2008 13:26:26 -0000
@@ -42,12 +42,12 @@
   :link '(custom-manual "(gnus)Article Highlighting")
   :group 'gnus-article)
 
-(defcustom gnus-cited-opened-text-button-line-format "%(%{[-]%}%)\n"
+(defcustom gnus-cited-opened-text-button-line-format "%(%{[-]%}%)"
   "Format of opened cited text buttons."
   :group 'gnus-cite
   :type 'string)
 
-(defcustom gnus-cited-closed-text-button-line-format "%(%{[+]%}%)\n"
+(defcustom gnus-cited-closed-text-button-line-format "%(%{[+]%}%)"
   "Format of closed cited text buttons."
   :group 'gnus-cite
   :type 'string)
@@ -600,7 +600,8 @@
 	      ;; We use markers for the end-points to facilitate later
 	      ;; wrapping and mangling of text.
 	      (setq beg (set-marker (make-marker) beg)
-		    end (set-marker (make-marker) end))
+		    end (set-marker (make-marker) (1- end)))
+	      (set-marker-insertion-type beg t)
 	      (gnus-add-text-properties-when 'article-type nil beg end props)
 	      (goto-char beg)
 	      (when (and gnus-cite-blank-line-after-header
@@ -651,8 +652,8 @@
       (let ((gnus-article-mime-handle-alist-1 gnus-article-mime-handle-alist))
 	(gnus-set-mode-line 'article))
       (save-excursion
+	(delete-region start beg)
 	(goto-char start)
-	(gnus-delete-line)
 	(put-text-property
 	 (point)
 	 (progn
@@ -666,7 +667,9 @@
 	    `gnus-article-toggle-cited-text
 	    args)
 	   (point))
-	 'article-type 'annotation)))))
+	 'article-type 'annotation)
+	(when hidden
+	  (insert "\n"))))))
 
 (defun gnus-article-hide-citation-maybe (&optional arg force)
   "Toggle hiding of cited text that has an attribution line.

      reply	other threads:[~2008-10-04 13:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y71eeav9.fsf@pcdesk.net>
2008-09-27 16:32 ` David Engster
2008-09-28 23:28   ` Katsumi Yamaoka
2008-09-29  9:25     ` David Engster
2008-09-29  9:45       ` Katsumi Yamaoka
2008-09-29 10:35         ` David Engster
2008-10-04 13:51           ` David Engster [this message]

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=874p3scvu9.fsf@randomsample.de \
    --to=deng@randomsample.de \
    --cc=ding@gnus.org \
    --cc=tspivey@pcdesk.net \
    /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).