From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 17955@debbugs.gnu.org, Leo Liu <sdl.web@gmail.com>
Subject: bug#17955: 24.3.92; octave.el: indentation following ... or \
Date: Sat, 29 May 2021 07:06:41 +0200 [thread overview]
Message-ID: <87a6oet9ge.fsf@gnus.org> (raw)
In-Reply-To: <jwvy4w6vu13.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Sun, 06 Jul 2014 21:49:41 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> So you should be able to control indentation of "b" above by tweaking
> the (:after . "=") or (:before . "=") rule.
I've never played around with the SMIE indentation before, but looking
at other examples, I came up with this:
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index a1a5192ee1..5d877fc6ba 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -460,7 +460,8 @@ octave-smie-rules
(smie-rule-parent octave-block-offset)
;; For (invalid) code between switch and case.
;; (if (smie-rule-parent-p "switch") 4)
- nil))))
+ nil))
+ ('(:after . "=") octave-block-offset)))
(defun octave-indent-comment ()
"A function for `smie-indent-functions' (which see)."
And the results look OK to me:
a = \
b
foo = \
dasd
So I've pushed this to Emacs 28; feel free to tweak further.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-05-29 5:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-06 9:36 bug#17955: 24.3.92; octave.el: indentation following ... or \ Leo Liu
2014-07-07 1:49 ` Stefan Monnier
2021-05-29 5:06 ` Lars Ingebrigtsen [this message]
2021-05-29 14:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-30 4:26 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6oet9ge.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=17955@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=sdl.web@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).