Gnus development mailing list
 help / color / mirror / Atom feed
* Re: Problem with gnus-article-hide-citation
       [not found] <87y71eeav9.fsf@pcdesk.net>
@ 2008-09-27 16:32 ` David Engster
  2008-09-28 23:28   ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2008-09-27 16:32 UTC (permalink / raw)
  To: ding; +Cc: Tyler Spivey

[Followup from gnus.bug]

Tyler Spivey <tspivey@pcdesk.net> writes:
> I'll try to describe this bug as best I can, so hopefully it can get
> fixed. When I press WWc on a message, then start cursoring around the
> article buffer, the > characters are still in it. They aren't visible
> on the screen, but I am blind and use an emacs speech package which
> picks them up. To reproduce this, press WWc on a message, then put
> point on the first character of any remaining text that wasn't hidden
> (below the buttons). press C-a C-b, the cursor should be on a blank
> line, but note that if you press C-x = the current character is a >.
> Also, if you hit C-a on that line, it'll jump you to the next line.

I can confirm this behavior. I'm not sure why this is happening and if
this is actually a bug in Gnus or in Emacs. I always thought that the
user commands for cursor navigation would skip over hidden text, but in
the first column in the line after the button, the point position is
indeed on the beginning of the hidden citation, usually containing a
">".

I tried putting the hidden text directly after the button (i.e. in the
same line). It is still accessible, but it would be at a line ending and
not at the beginning of the next line, which I guess would at least
solve the above problem?

Other suggestions?

-David



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

* Re: Problem with gnus-article-hide-citation
  2008-09-27 16:32 ` Problem with gnus-article-hide-citation David Engster
@ 2008-09-28 23:28   ` Katsumi Yamaoka
  2008-09-29  9:25     ` David Engster
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2008-09-28 23:28 UTC (permalink / raw)
  To: ding; +Cc: Tyler Spivey

>>>>> David Engster wrote:
> [Followup from gnus.bug]

> Tyler Spivey <tspivey@pcdesk.net> writes:
>> I'll try to describe this bug as best I can, so hopefully it can get
>> fixed. When I press WWc on a message, then start cursoring around the
>> article buffer, the > characters are still in it. They aren't visible
>> on the screen, but I am blind and use an emacs speech package which
>> picks them up. To reproduce this, press WWc on a message, then put
>> point on the first character of any remaining text that wasn't hidden
>> (below the buttons). press C-a C-b, the cursor should be on a blank
>> line, but note that if you press C-x = the current character is a >.
>> Also, if you hit C-a on that line, it'll jump you to the next line.

> I can confirm this behavior. I'm not sure why this is happening and if
> this is actually a bug in Gnus or in Emacs. I always thought that the
> user commands for cursor navigation would skip over hidden text, but in
> the first column in the line after the button, the point position is
> indeed on the beginning of the hidden citation, usually containing a
">".

> I tried putting the hidden text directly after the button (i.e. in the
> same line). It is still accessible, but it would be at a line ending and
> not at the beginning of the next line, which I guess would at least
> solve the above problem?

> Other suggestions?

I doubted the behavior of C-a (i.e. move-beginning-of-line) is
really useful.  It moves the point to the next visible field,
but shouldn't it be the end of the previous visible field (or
the beginning of the buffer)?  Anyway, how about trying the
following for a while?  It is just what Emacs 21 does:

(global-set-key "\C-a" 'beginning-of-line)

BTW, doesn't Emacspeak provide an option that controls whether
to speak invisible text?  I think invisible text should not be
seen by default both to eyes and to ears.

Regards,



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

* Re: Problem with gnus-article-hide-citation
  2008-09-28 23:28   ` Katsumi Yamaoka
@ 2008-09-29  9:25     ` David Engster
  2008-09-29  9:45       ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2008-09-29  9:25 UTC (permalink / raw)
  To: ding; +Cc: Tyler Spivey

Katsumi Yamaoka <yamaoka@jpl.org> writes:
> I doubted the behavior of C-a (i.e. move-beginning-of-line) is
> really useful.  It moves the point to the next visible field,
> but shouldn't it be the end of the previous visible field (or
> the beginning of the buffer)?  Anyway, how about trying the
> following for a while?  It is just what Emacs 21 does:
>
> (global-set-key "\C-a" 'beginning-of-line)

The problem is that the hidden text practically shadows the first
character of the visible one. You may try this with the following test
code:

(save-excursion
  (set-buffer (get-buffer-create "invtest"))
  (erase-buffer)
  (insert "\naaaaa\nbbbbb\n")
  (goto-char (point-min))
  (forward-line 1)
  (set-text-properties (point) (1+ (point-at-eol)) '(invisible t intangible t)))

Now switch to the buffer "invtest", and put the cursor on the first
"b". Doing C-x = here will show the hidden "a" on position 2. If you go
one step to the right, C-x = will (correctly) show the second "b" at
position 9. In fact, it seems you cannot really access the first "b" at
position 8 through cursor movements. Therefore, EmacsSpeak would not
only have to ignore invisible text, but skip it until it reaches the
first visible character. This seems rather odd to me, and I also didn't
expect that behavior after reading the section on invisible text in the
ELisp reference.

-David



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

* Re: Problem with gnus-article-hide-citation
  2008-09-29  9:25     ` David Engster
@ 2008-09-29  9:45       ` Katsumi Yamaoka
  2008-09-29 10:35         ` David Engster
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2008-09-29  9:45 UTC (permalink / raw)
  To: ding; +Cc: Tyler Spivey

>>>>> David Engster wrote:
> The problem is that the hidden text practically shadows the first
> character of the visible one. You may try this with the following test
> code:

> (save-excursion
>   (set-buffer (get-buffer-create "invtest"))
>   (erase-buffer)
>   (insert "\naaaaa\nbbbbb\n")
>   (goto-char (point-min))
>   (forward-line 1)
>   (set-text-properties (point) (1+ (point-at-eol)) '(invisible t intangible t)))

> Now switch to the buffer "invtest", and put the cursor on the first
> "b". Doing C-x = here will show the hidden "a" on position 2. If you go
> one step to the right, C-x = will (correctly) show the second "b" at
> position 9.

Emacs 22.1 behaves similarly, but in Emacs 21.4, the cursor doesn't
move and C-x = shows the first "b" at position 8.  One more step to
the right, the cursor moves to the second "b".  It seems to be a bug
that has been introduced in Emacs 22.

> In fact, it seems you cannot really access the first "b" at
> position 8 through cursor movements. Therefore, EmacsSpeak would not
> only have to ignore invisible text, but skip it until it reaches the
> first visible character. This seems rather odd to me, and I also didn't
> expect that behavior after reading the section on invisible text in the
> ELisp reference.

> -David



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

* Re: Problem with gnus-article-hide-citation
  2008-09-29  9:45       ` Katsumi Yamaoka
@ 2008-09-29 10:35         ` David Engster
  2008-10-04 13:51           ` David Engster
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2008-09-29 10:35 UTC (permalink / raw)
  To: ding; +Cc: Tyler Spivey

Katsumi Yamaoka <yamaoka@jpl.org> writes:
>> The problem is that the hidden text practically shadows the first
>> character of the visible one. You may try this with the following test
>> code:

> Emacs 22.1 behaves similarly, but in Emacs 21.4, the cursor doesn't
> move and C-x = shows the first "b" at position 8.  One more step to
> the right, the cursor moves to the second "b".  It seems to be a bug
> that has been introduced in Emacs 22.

This bug also seems to be already known:

http://thread.gmane.org/gmane.emacs.devel/50202

After reading Stefan's response on this issue, I don't think it makes
much sense to bring this up again in emacs-devel. 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. I already played around with that, but it's
a bit tricky to get right...

-David



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

* Re: Problem with gnus-article-hide-citation
  2008-09-29 10:35         ` David Engster
@ 2008-10-04 13:51           ` David Engster
  0 siblings, 0 replies; 6+ messages in thread
From: David Engster @ 2008-10-04 13:51 UTC (permalink / raw)
  To: ding; +Cc: Tyler Spivey

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

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

end of thread, other threads:[~2008-10-04 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87y71eeav9.fsf@pcdesk.net>
2008-09-27 16:32 ` Problem with gnus-article-hide-citation 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 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).