From: Masatake YAMATO <jet@gyve.org>
Subject: string in a register
Date: Thu, 05 Dec 2002 17:49:01 +0900 (JST) [thread overview]
Message-ID: <20021205.174901.41627010.jet@gyve.org> (raw)
Dear Emacs developers,
Could I send a patch here?
I have some interests in register.el.
If the contents of register is an just empty string("") or white
spaces, `list-registers' doesn't work well. This is a fix for it.
2002-11-20 Masatake YAMATO <jet@gyve.org> (tiny change)
* register.el (describe-register-1): use window-width
to truncate string in a register. check whether the string
in a register is an empty string or a sequence of white spaces.
Regards,
Masatake YAMATO
Index: lisp/register.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/register.el,v
retrieving revision 1.42
diff -u -r1.42 register.el
--- lisp/register.el 19 Nov 2002 07:37:59 -0000 1.42
+++ lisp/register.el 19 Nov 2002 16:35:32 -0000
@@ -234,8 +234,15 @@
(princ "the text:\n")
(princ val))
(princ "text starting with\n ")
- (string-match "[^ \t\n].\\{,20\\}" val)
- (princ (match-string 0 val))))
+ (cond
+ ;; 4 spaces are inserted in above princ. so we cannot use all (window-width).
+ ;; abs is needed for the case that (window-width) is less than 6.
+ ((string-match (format "[^ \t\n].\\{,%d\\}" (abs (- (window-width) 6))) val)
+ (princ (match-string 0 val)))
+ ((string-match "^[ \t\n]+$" val)
+ (princ " <white spaces>"))
+ (t
+ (princ "<empty string>")))))
(t
(princ "Garbage:\n")
(if verbose (prin1 val))))))
reply other threads:[~2002-12-05 8:49 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=20021205.174901.41627010.jet@gyve.org \
--to=jet@gyve.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.