From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Make Emacs print "^J" instead of "\n" with `print-escape-newlines'? Date: Thu, 21 Nov 2013 00:41:40 +0100 Message-ID: <87hab6iqtn.fsf@gmail.com> References: <87siuqj17v.fsf@gmail.com> <528d2031$0$2128$426a74cc@news.free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384990938 7077 80.91.229.3 (20 Nov 2013 23:42:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 23:42:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 21 00:42:23 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1VjHPa-0007Qn-SV for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Nov 2013 00:42:23 +0100 Original-Received: from localhost ([::1]:57686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjHPa-0003fC-8S for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Nov 2013 18:42:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjHPJ-0003em-Cv for help-gnu-emacs@gnu.org; Wed, 20 Nov 2013 18:42:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjHPA-0000H0-IR for help-gnu-emacs@gnu.org; Wed, 20 Nov 2013 18:42:05 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:43163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjHPA-0000GX-CB for help-gnu-emacs@gnu.org; Wed, 20 Nov 2013 18:41:56 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VjHP8-0007DG-Bf for help-gnu-emacs@gnu.org; Thu, 21 Nov 2013 00:41:54 +0100 Original-Received: from g231235118.adsl.alicedsl.de ([92.231.235.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Nov 2013 00:41:54 +0100 Original-Received: from tjolitz by g231235118.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Nov 2013 00:41:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231235118.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:B6PCgiNxXb/SsS3ZuA11sJOrSfc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94551 Archived-At: Damien Wyart writes: > * Thorsten Jolitz in gnu.emacs.help: >> > is there any way to make Emacs print "^J" instead of "\n" with >> > (print-escape-newlines t)? > >> But I would still be interested in the first part. > > I think you would need to modify the following part of src/print.c: > > if (c == '\n' && print_escape_newlines) > { > PRINTCHAR ('\\'); > PRINTCHAR ('n'); > } > > (not sure how to tell PRINTCHAR to print ^J) and recompile Emacs. I see, although thats probably a bit too low-level for me. But thanks for the hint, it motivated me to finally download the Emacs sources, the C code seems to be quite readable - even when not knowing much about C at all. -- cheers, Thorsten