GNU bug report logs - #18652
25.0.50; [PATCH] Add fresh-line

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Tue, 7 Oct 2014 13:04:02 UTC

Severity: wishlist

Tags: patch

Found in version 25.0.50

Fixed in version 25.1

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 18652 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 18652 <at> debbugs.gnu.org
Subject: Re: bug#18652: 25.0.50; [PATCH] Add fresh-line
Date: Tue, 07 Oct 2014 15:21:18 +0200
Leo Liu <sdl.web <at> gmail.com> writes:

> I often find myself wanting to start printing at a newline and it is a
> lot of work to do it properly. I wonder if we can add something along
> these lines?

What's wrong with this:

(defun fresh-line (printcharfun)
  "Output a newline unless already at the beginning of a line.
Value is non-nil if a newline is printed.
Do nothing and return nil if PRINTCHARFUN is a function."
   (or printcharfun (setq printcharfun standard-output))
   (and (not (functionp printcharfun))
	(not (bolp))
	(princ "\n" printcharfun)))

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




This bug report was last modified 10 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.