[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'C-q C-j' looks ugly in code

From: Eric Abrahamsen
Subject: Re: 'C-q C-j' looks ugly in code
Date: Fri, 26 Jul 2013 16:49:40 +0800
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

Thorsten Jolitz <> writes:

> Hi List, 
> assume I write elisp code to replace occurences of "^J" in a string with
> the actual line-feeds, i.e. with C-q C-j.
> That works, but looks really ugly in the code:
> #+begin_src emacs-lisp
> (if A
>     (if B
>         (if C
>             ;; deeply indented code
>             (replace-string "^J" "
> " nil beg end)
>           (message "C"))
>       (message "B"))
>   (message "A"))
> #+end_src
> Is there a way to write C-q C-j in source code that does not actually
> inserts the line-feeds?

I just tested this in scratch, and it looks like (replace-string "^J" "\n")
works as expected...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]