all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rostislav Svoboda <rostislav.svoboda@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: "emacs-devel@gnu.org Development" <emacs-devel@gnu.org>
Subject: [PATCH] Re: new-line chars '\n' not printed?
Date: Sat, 18 Apr 2015 20:45:08 +0200	[thread overview]
Message-ID: <CAEtmmew_30qLmdNvUBeXCjw05GjEbC6V+u5AUJmiQStFJOb6uQ@mail.gmail.com> (raw)

>> 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))))))



                 reply	other threads:[~2015-04-18 18:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAEtmmew_30qLmdNvUBeXCjw05GjEbC6V+u5AUJmiQStFJOb6uQ@mail.gmail.com \
    --to=rostislav.svoboda@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.