[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ... indentation bug http://debbugs.gnu.org/14399
From: |
Leo Liu |
Subject: |
Re: ... indentation bug http://debbugs.gnu.org/14399 |
Date: |
Thu, 16 May 2013 12:30:55 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3) |
On 2013-05-16 02:01 +0800, John W. Eaton wrote:
> I don't plan to remove it, but I do plan to change the way
> continuations are handled in string constants so that they only kind
> of continuation that is possible in a string constant is a backslash
> followed directly by a newline character.
I am making C-M-j in octave mode do something sensible for breaking
lines, something like:
(defun octave-indent-new-comment-line (&optional soft)
"Break Octave line at point, continuing comment if within one.
Insert `octave-continuation-string' before breaking the line
unless inside a list. Signal an error if within a single-quoted
string."
(interactive)
(cond
((octave-in-comment-p) nil)
((eq (octave-in-string-p) ?')
(error "Cannot split a single-quoted string"))
((eq (octave-in-string-p) ?\")
(insert octave-continuation-string))
(t
(delete-horizontal-space)
(unless (and (cadr (syntax-ppss))
(eq (char-after (cadr (syntax-ppss))) ?\())
(insert " " octave-continuation-string))))
(indent-new-comment-line soft))
Let me know when you have finalised how double-quoted strings should be
broken.
Leo