Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Thien-Thi Nguyen <ttn@gnuvola.org>
Cc: "Gabor Z. Papp" <gzp@papp.hu>, ding@gnus.org, emacs-devel@gnu.org
Subject: Re: Top posting related changes in the cvs
Date: Mon, 09 Apr 2007 15:40:40 +0900	[thread overview]
Message-ID: <b4mmz1iyrrr.fsf@jpl.org> (raw)
In-Reply-To: <87ps6ljc3q.fsf@ambire.localdomain>

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

Hi,

I'm sorry for the late response (I was absent because of flu).

>>>>> In <873b3hm942.fsf@ambire.localdomain> Thien-Thi Nguyen wrote:

> 2005-08-01  Katsumi Yamaoka  <yamaoka@jpl.org>

>   * gnus-uu.el (gnus-uu-save-article): Use insert-buffer-substring
>     instead of insert-buffer.

>   * message.el (message-yank-original): Ditto; set the mark at the
>     end of the yanked message.

I made those changes to obey the doc string of `insert-buffer':

#v+
This function is meant for the user to run interactively.
Don't call it from programs: use `insert-buffer-substring' instead!
#v-

> insert-buffer-substring inserts before point, while insert-buffer
> inserts after point.

Sure.  Therefore, I've made it behave like `insert-buffer' as
follows:

#v+
      (push-mark (save-excursion
		   (insert-buffer-substring message-reply-buffer)
		   (point)))
#v-

(This is just what `insert-buffer' defined in simple.el does.)

> my analysis is that the exchange-point-and-mark relied on
> insert-buffer's behavior, and thus became incorrect after the
> 2005-08-01 change, since point and mark were already in the correct
> order.

Anyway, I verified that, before this change, there has already
been the problem that happens when `message-yank-original' is
called interactively.  So, I'm not a culprit. ;-)

>>>>> In <87ps6ljc3q.fsf@ambire.localdomain> Thien-Thi Nguyen wrote:

> () Reiner Steib <reinersteib+gmane@imap.cc>
> () Wed, 04 Apr 2007 00:05:29 +0200

>    I gather that you refer to an interactive call of
>    `message-yank-original' (C-c C-y) after doing a reply/followup
>    without citing the original (using `r'/`f').

> yes.

>    However, when using `R'/`F', I don't get this behavior anymore:
>    Point is _below_ the quote, which is wrong.

> patch below seems to fix `R'/`F' w/ light testing.
> here is a ChangeLog entry:

>         * gnus-msg.el (gnus-inews-yank-articles):
>         Fix bug: Make sure point is at eob after yanking.

> probably all callers of `message-yank-original' should be checked.
> does that give good results?

I think the recent change in `message-yank-original' and this
fix are the right solutions for Gnus v5.11.  However, for No
Gnus, it doesn't solve the problem in the case where
`message-cite-reply-above' is non-nil and `message-yank-original'
is called interactively.  How about this one?

	* message.el (message-yank-original): Don't exchange point and mark.

I also removed the `(unless (< (point) (mark-marker)) ...)' test
since I think it will never return nil.


[-- Attachment #2: patch for Gnus v5.11 --]
[-- Type: text/plain, Size: 1044 bytes --]

*** message.el~	Tue Mar 27 21:43:24 2007
--- message.el	Mon Apr  9 06:35:11 2007
***************
*** 3346,3358 ****
        (delete-windows-on message-reply-buffer t)
        (push-mark (save-excursion
  		   (insert-buffer-substring message-reply-buffer)
  		   (point)))
        (unless arg
! 	(funcall message-cite-function))
!       (unless (< (point) (mark-marker))
!         (message-exchange-point-and-mark))
!       (unless (bolp)
! 	(insert ?\n))
        (unless modified
  	(setq message-checksum (message-checksum))))))
  
--- 3346,3361 ----
        (delete-windows-on message-reply-buffer t)
        (push-mark (save-excursion
  		   (insert-buffer-substring message-reply-buffer)
+ 		   (unless (bolp)
+ 		     (insert ?\n))
  		   (point)))
        (unless arg
! 	(funcall message-cite-function)
! 	(unless (eq (char-before (mark t)) ?\n)
! 	  (let ((pt (point)))
! 	    (goto-char (mark t))
! 	    (insert-before-markers ?\n)
! 	    (goto-char pt))))
        (unless modified
  	(setq message-checksum (message-checksum))))))
  

[-- Attachment #3: patch for No Gnus --]
[-- Type: text/plain, Size: 1828 bytes --]

*** gnus-msg.el~	Wed Mar 28 02:31:28 2007
--- gnus-msg.el	Mon Apr  9 06:35:11 2007
***************
*** 789,794 ****
--- 789,795 ----
  		 (nnheader-narrow-to-headers)
  		 (nnheader-parse-naked-head)))))
  	(message-yank-original)
+ 	(exchange-point-and-mark)
  	(setq beg (or beg (mark t))))
        (when articles
  	(insert "\n")))
*** message.el~	Sun Apr  1 21:54:14 2007
--- message.el	Mon Apr  9 06:35:11 2007
***************
*** 3550,3569 ****
        (delete-windows-on message-reply-buffer t)
        (push-mark (save-excursion
  		   (insert-buffer-substring message-reply-buffer)
  		   (point)))
        (unless arg
! 	(funcall message-cite-function))
!       (if message-cite-reply-above
! 	  (progn
! 	    (message-goto-body)
! 	    (insert body-text)
! 	    (newline)
! 	    (message-goto-body)
! 	    (message-exchange-point-and-mark))
! 	(unless (< (point) (mark-marker))
! 	  (message-exchange-point-and-mark)))
!       (unless (bolp)
! 	(insert ?\n))
        ;; Add a `message-setup-very-last-hook' here?
        ;; Add `gnus-article-highlight-citation' here?
        (unless modified
--- 3550,3572 ----
        (delete-windows-on message-reply-buffer t)
        (push-mark (save-excursion
  		   (insert-buffer-substring message-reply-buffer)
+ 		   (unless (bolp)
+ 		     (insert ?\n))
  		   (point)))
        (unless arg
! 	(funcall message-cite-function)
! 	(unless (eq (char-before (mark t)) ?\n)
! 	  (let ((pt (point)))
! 	    (goto-char (mark t))
! 	    (insert-before-markers ?\n)
! 	    (goto-char pt))))
!       (when message-cite-reply-above
! 	(message-goto-body)
! 	(insert body-text)
! 	(unless (bolp)
! 	  (insert ?\n))
! 	(newline)
! 	(message-goto-body))
        ;; Add a `message-setup-very-last-hook' here?
        ;; Add `gnus-article-highlight-citation' here?
        (unless modified

[-- Attachment #4: Type: text/plain, Size: 10 bytes --]


Regards,

[-- Attachment #5: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2007-04-09  6:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03 17:29 Gabor Z. Papp
2007-04-03 20:45 ` Reiner Steib
2007-04-03 21:38   ` Thien-Thi Nguyen
2007-04-03 22:05     ` Reiner Steib
2007-04-03 23:02       ` Thien-Thi Nguyen
2007-04-03 23:11         ` Gabor Z. Papp
2007-04-09  6:40         ` Katsumi Yamaoka [this message]
2007-04-09 18:30           ` Thien-Thi Nguyen
2007-04-09 19:49           ` Reiner Steib
2007-04-09 23:15             ` Katsumi Yamaoka
2007-04-03 21:10 ` Graham Murray

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=b4mmz1iyrrr.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=gzp@papp.hu \
    --cc=ttn@gnuvola.org \
    /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).