all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* string in a register
@ 2002-12-05  8:49 Masatake YAMATO
  0 siblings, 0 replies; only message in thread
From: Masatake YAMATO @ 2002-12-05  8:49 UTC (permalink / 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))))))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-05  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-05  8:49 string in a register Masatake YAMATO

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.