From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.bugs Subject: Re: longlines-mode and comments Date: Mon, 17 Dec 2007 18:40:21 +0000 Message-ID: <35DB6480-F9E8-47C3-843F-0FA6BB4B5A94@gmail.com> References: <3E823B74-5830-445A-8DEE-51A4AB4AFB44@gmail.com> <474E95A7.4090807@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v915) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197917018 2966 80.91.229.12 (17 Dec 2007 18:43:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Dec 2007 18:43:38 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 17 19:43:50 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J4KvO-0006Au-Lz for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Dec 2007 19:42:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4Kv5-0006Yj-8w for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Dec 2007 13:42:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J4KtD-00045Z-NF for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2007 13:40:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J4KtB-000426-Og for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2007 13:40:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4KtB-00041s-Im for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2007 13:40:29 -0500 Original-Received: from ug-out-1314.google.com ([66.249.92.169]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J4KtB-0003Kl-4R for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2007 13:40:29 -0500 Original-Received: by ug-out-1314.google.com with SMTP id a2so1816837ugf.48 for ; Mon, 17 Dec 2007 10:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=tDv+ifp0VKj+Bl8eXIpUGSCX/ELLFtB7aWlqW59hMBU=; b=c47WVafT7CaXrUujjg2olCeomPBNoktQ4fJn2jXAxoYSyHKBdLwrP68FhYxqqr03hQGgXfZzeQosbl4Cu87OtRMdDVL82GBSsoJ1z++qklZy/PdA5BgnEoYxSyElCNt12WTWByIcV5IUyH6QQ1R2PbosZxq4m6Pu85/Bvj4yBLk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=sIePOsUUZJsyqvsYAJLySGteqUc//6OOUI/ISTrUMZxbDJfNXSrUtUl77R+qVCdymTlaiHsGvd0TtR5WJdU+9+Ho0PVyJbN+fazT2AXS+d6uJoO2cnh55M1LvBaPSSV1jZ7VOCvsYfn6zE+ysnaqf6F+W7EcpITAhDDeOjyP9h0= Original-Received: by 10.67.24.11 with SMTP id b11mr3815356ugj.2.1197916825138; Mon, 17 Dec 2007 10:40:25 -0800 (PST) Original-Received: from scarlett.inf.ed.ac.uk ( [129.215.174.113]) by mx.google.com with ESMTPS id e34sm12396285ugd.2007.12.17.10.40.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Dec 2007 10:40:22 -0800 (PST) In-Reply-To: <474E95A7.4090807@gmx.at> X-Mailer: Apple Mail (2.915) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17180 Archived-At: I posted this a while ago: >> emacs-lisp-mode, or latex-mode (AUCTeX) >> Turn on longlines-mode. >> Paste a long line (paragraph in the long-lines sense) into the >> buffer, which should be wrapped correctly and displayed as a >> paragraph of text. >> Select the entire paragraph and call `comment-region'. >> Result: The comment mark (;; or % or whatever) is placed all over >> the lines, and only the first line has it in the right place, i.e. >> at the beginning. would the following be solution? It works for me. *** newcomment.el 28 Nov 2007 12:14:50 +0000 1.101.2.2 --- newcomment.el 17 Dec 2007 18:22:18 +0000 *************** *** 1035,1040 **** --- 1035,1041 ---- (comment-normalize-vars) (if (> beg end) (let (mid) (setq mid beg beg end end mid))) (save-excursion + (if longlines-mode (longlines-decode-region beg end)) ;; FIXME: maybe we should call uncomment depending on ARG. (funcall comment-region-function beg end arg))) What remains is: >> (Also, when `longlines-wrap-follows-window-size' is turned on, >> then the line/paragraph is reformatted.) >> The expected (correct) behavior would be to add the comment command >> at the beginning of the line in the file, i.e. at the beginning of >> the paragraph, that is, after each hard return. >> Note that the other expected thing there is that the syntax >> highlighting (font-lock) works, i.e. that the whole comment is >> shown using the right face. This, IMHO, is a second bug. It seems like `longlines-wrap-line' has a provision for the case, but it doesn't work (I don't understand that code). What does work is to not comment wrap lines at all until a better solution is found. *** longlines.el 28 Nov 2007 12:14:50 +0000 1.33.2.5 --- longlines.el 17 Dec 2007 18:37:40 +0000 *************** *** 257,267 **** If wrapping is performed, point remains on the line. If the line does not need to be wrapped, move point to the next line and return t." (if (longlines-set-breakpoint) ! (progn (insert-before-markers ?\n) ! (backward-char 1) ! (delete-char -1) ! (forward-char 1) ! nil) (if (longlines-merge-lines-p) (progn (end-of-line) ;; After certain commands (e.g. kill-line), there may be two --- 259,273 ---- If wrapping is performed, point remains on the line. If the line does not need to be wrapped, move point to the next line and return t." (if (longlines-set-breakpoint) ! (progn ! (unless (nth 4 (syntax-ppss (point))) ! ;; We are not in a comment context. ! (insert-before-markers ?\n) ! (backward-char 1) ! (delete-char -1) ! ! (forward-char 1)) ! nil) (if (longlines-merge-lines-p) (progn (end-of-line) ;; After certain commands (e.g. kill-line), there may be two