From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/78143 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.gnus.general Subject: Re: message-yank-original issue Date: Mon, 28 Mar 2011 16:41:38 -0400 Message-ID: References: <871v2ako4c.fsf@fencepost.gnu.org> <87lj0ha52s.fsf@lifelogs.com> <87y64g6833.fsf@lifelogs.com> <87ei5tzneu.fsf@turtle.gmx.de> <877hbjkquz.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301358758 7542 80.91.229.12 (29 Mar 2011 00:32:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2011 00:32:38 +0000 (UTC) Cc: , David Kastrup , Katsumi Yamaoka To: Ted Zlatanov Original-X-From: ding-owner+M26455@lists.math.uh.edu Tue Mar 29 02:32:33 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4MrJ-0000qR-2i for ding-account@gmane.org; Tue, 29 Mar 2011 02:32:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Q4MqH-00071P-Af; Mon, 28 Mar 2011 19:31:29 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Q4MqB-00070h-TU for ding@lists.math.uh.edu; Mon, 28 Mar 2011 19:31:23 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Q4MqA-0006fo-Gw for ding@lists.math.uh.edu; Mon, 28 Mar 2011 19:31:23 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Q4Mq9-0007zJ-3a for ding@gnus.org; Tue, 29 Mar 2011 02:31:21 +0200 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p2T0WT9I028584; Mon, 28 Mar 2011 20:32:30 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 00C536687C; Mon, 28 Mar 2011 16:41:38 -0400 (EDT) In-Reply-To: <877hbjkquz.fsf@lifelogs.com> (Ted Zlatanov's message of "Mon, 28 Mar 2011 14:05:40 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3810=0 X-NAI-Spam-Version: 2.2.0.9286 : core <3810> : streams <614374> : uri <837526> X-Spam-Score: -0.3 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:78143 Archived-At: > I'm not sure what's going on with message.el. It clearly says > (eval-when-compile > (require 'cl)) > so it should not be erroring out. Stefan wanted to go back to using > `case' instead of `cond' so I'll defer to him. How 'bout the patch below, which makes the bulk of the eval'd code visible to the byte-compiler, as god intended it to be. Stefan === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-03-18 02:09:58 +0000 +++ lisp/gnus/message.el 2011-03-28 20:38:41 +0000 @@ -3721,22 +3721,9 @@ (while (re-search-forward citexp nil t) (replace-match (if remove "" "\n")))))) -(defun message-yank-original (&optional arg) - "Insert the message being replied to, if any. -Puts point before the text and mark after. -Normally indents each nonblank line ARG spaces (default 3). However, -if `message-yank-prefix' is non-nil, insert that prefix on each line. - -This function uses `message-cite-function' to do the actual citing. - -Just \\[universal-argument] as argument means don't indent, insert no -prefix, and don't delete any headers." - (interactive "P") +(defun message--yank-original-internal (arg) (let ((modified (buffer-modified-p)) body-text) - ;; eval the let forms contained in message-cite-style - (eval - `(let ,message-cite-style (when (and message-reply-buffer message-cite-function) (when (equal message-cite-reply-position 'above) @@ -3776,7 +3763,23 @@ ;; Add a `message-setup-very-last-hook' here? ;; Add `gnus-article-highlight-citation' here? (unless modified - (setq message-checksum (message-checksum)))))))) + (setq message-checksum (message-checksum)))))) + +(defun message-yank-original (&optional arg) + "Insert the message being replied to, if any. +Puts point before the text and mark after. +Normally indents each nonblank line ARG spaces (default 3). However, +if `message-yank-prefix' is non-nil, insert that prefix on each line. + +This function uses `message-cite-function' to do the actual citing. + +Just \\[universal-argument] as argument means don't indent, insert no +prefix, and don't delete any headers." + (interactive "P") + ;; eval the let forms contained in message-cite-style + (eval + `(let ,message-cite-style + (message--yank-original-internal ',arg)))) (defun message-yank-buffer (buffer) "Insert BUFFER into the current buffer and quote it."