From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rostislav Svoboda Newsgroups: gmane.emacs.devel Subject: [PATCH] Re: new-line chars '\n' not printed? Date: Sat, 18 Apr 2015 20:45:08 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1429382766 9638 80.91.229.3 (18 Apr 2015 18:46:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 18:46:06 +0000 (UTC) Cc: "emacs-devel@gnu.org Development" To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 18 20:46:05 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YjXkh-0005GG-DB for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 20:46:03 +0200 Original-Received: from localhost ([::1]:46568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjXkg-0006pt-KT for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 14:46:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjXkU-0006pc-E4 for emacs-devel@gnu.org; Sat, 18 Apr 2015 14:45:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjXkT-0006FL-Fe for emacs-devel@gnu.org; Sat, 18 Apr 2015 14:45:50 -0400 Original-Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]:38811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjXkT-0006FF-9x for emacs-devel@gnu.org; Sat, 18 Apr 2015 14:45:49 -0400 Original-Received: by igbhj9 with SMTP id hj9so34760075igb.1 for ; Sat, 18 Apr 2015 11:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=xvNGNT5xZLMfB3v5mqy3/OF9ew+adu3U5FxmHBskacE=; b=ZmfG8ER/0QXsluuFJv8AOfDTf/Vx6OtsFn7yEV9F0RiYG6nFWFB9Jl0EdTz/EIg/LU eYvmMBz+qwh8LaEzrHUEvm16Wyko7boR7pV6od7dayLTrs24QWUBgaDps45JnuhHd2xn PGPd966usa1JsfxlKIH5L/5WrE0/1FsQ1h9G2YeR8ukxgh9cZ+Ix/5jAVP1eDsY+EOQM UArnxSYGJbzaHQlzTIrliVRyVpcePIlJNPU+S7hWyt9OGZ18xLw+U7EnotIRsGVWl9Rv HV2H/oHMzu8y7JXIuoxoVzeVMtXr1m08lfdO3qyaIfxVS8Cmv0e3v5ZVpYe1ZUeORc9F v0Zw== X-Received: by 10.50.20.233 with SMTP id q9mr11116743ige.9.1429382748801; Sat, 18 Apr 2015 11:45:48 -0700 (PDT) Original-Received: by 10.64.30.99 with HTTP; Sat, 18 Apr 2015 11:45:08 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185630 Archived-At: >> can anybody explain please me why the '\n' char is not printed: > > Because the text is filled. > > (fill-region-as-paragraph pt2 (point)) > > Andreas. Thx! I found the list of key-chords printed by help-fns--key-bindings is separated by the ',' char and it becomes unreadable if one of the key-chord contains ','. So below is a patch to fix it. Could you please give me an advice what to do to get it merged to the upstream? New help-fns--key-bindings output: It is bound to: C-c , d s-d Old output: It is bound to C-c , d, s-d. thx Bost PS: And here comes my very first patch for emacs :-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e4890e0..4840f41 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -309,26 +309,27 @@ suitable file is found, return nil." (princ ".\n")) (when keys - (princ (if remapped - "Without this remapping, it would be bound to " - "It is bound to ")) - ;; If lots of ordinary text characters run this command, - ;; don't mention them one by one. - (if (< (length non-modified-keys) 10) - (princ (mapconcat 'key-description keys ", ")) - (dolist (key non-modified-keys) - (setq keys (delq key keys))) - (if keys - (progn - (princ (mapconcat 'key-description keys ", ")) - (princ ", and many ordinary text characters")) - (princ "many ordinary text characters")))) + (let ((indent "\n ")) + (princ + (concat (if remapped + "Without this remapping, it would be bound to:" + "It is bound to:") + indent)) + ;; If lots of ordinary text characters run this command, + ;; don't mention them one by one. + (if (< (length non-modified-keys) 10) + (princ (mapconcat 'key-description keys indent)) + (dolist (key non-modified-keys) + (setq keys (delq key keys))) + (if keys + (progn + (princ (mapconcat 'key-description keys indent)) + (princ ", and many ordinary text characters")) + (princ "many ordinary text characters"))))) (when (or remapped keys non-modified-keys) - (princ ".") (terpri))))) (with-current-buffer standard-output - (fill-region-as-paragraph pt2 (point)) (unless (looking-back "\n\n") (terpri))))))