[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 03ce66f 173/352: Improving comments to clarify
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 03ce66f 173/352: Improving comments to clarify how indentation works. |
Date: |
Sun, 29 Aug 2021 11:22:39 -0400 (EDT) |
branch: elpa/julia-mode
commit 03ce66f4b796d05abb5b1ab5ee3e684c6f797343
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Improving comments to clarify how indentation works.
---
julia-mode.el | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index 5d81aea..d5e9ad2 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -251,7 +251,7 @@ Do not move back beyond MIN."
(+ julia-basic-offset (current-indentation))))))
(defun julia-paren-indent ()
- "Return indent by last opening paren."
+ "Return indent amount of the last opening paren."
(let* ((p (parse-partial-sexp
(save-excursion
;; only indent by paren if the last open
@@ -272,27 +272,29 @@ Do not move back beyond MIN."
(let* ((point-offset (- (current-column) (current-indentation))))
(end-of-line)
(indent-line-to
- (or (save-excursion (ignore-errors (julia-paren-indent)))
- (save-excursion
- (let ((endtok (progn
- (beginning-of-line)
- (forward-to-indentation 0)
- (julia-at-keyword julia-block-end-keywords))))
- (ignore-errors (+ (julia-last-open-block (point-min))
- (if endtok (- julia-basic-offset) 0)))))
- ;; previous line ends in =
- (save-excursion
- (if (and (not (equal (point-min) (line-beginning-position)))
- (progn
- (forward-line -1)
- (end-of-line) (backward-char 1)
- (equal (char-after (point)) ?=)))
- (+ julia-basic-offset (current-indentation))
- nil))
- ;; take same indentation as previous line
- (save-excursion (forward-line -1)
- (current-indentation))
- 0))
+ (or
+ ;; If we're inside an open paren, indent to line up arguments.
+ (save-excursion (ignore-errors (julia-paren-indent)))
+ ;; If we're on a block end keyword, unindent.
+ (save-excursion
+ (beginning-of-line)
+ (forward-to-indentation 0)
+ (let ((endtok (julia-at-keyword julia-block-end-keywords)))
+ (ignore-errors (+ (julia-last-open-block (point-min))
+ (if endtok (- julia-basic-offset) 0)))))
+ ;; If the previous line ends in =, increase the indent.
+ (save-excursion
+ (if (and (not (equal (point-min) (line-beginning-position)))
+ (progn
+ (forward-line -1)
+ (end-of-line) (backward-char 1)
+ (equal (char-after (point)) ?=)))
+ (+ julia-basic-offset (current-indentation))
+ nil))
+ ;; Otherwise, use the same indentation as previous line.
+ (save-excursion (forward-line -1)
+ (current-indentation))
+ 0))
;; Point is now at the beginning of indentation, restore it
;; to its original position (relative to indentation).
(when (>= point-offset 0)
- [nongnu] elpa/julia-mode 44cd797 116/352: Update mailmap, (continued)
- [nongnu] elpa/julia-mode 44cd797 116/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7064885 113/352: update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 137455a 119/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode db05511 143/352: Adding autoload cookie for associating .jl files with julia-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d6a298b 146/352: Removing unused constant., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1b6b38c 154/352: Don't highlight that that happens to contain a constant., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 45e1650 159/352: Correcting type regex., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode b6b52a4 162/352: tweaks to emacs syntax highlighting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode fdaa84d 163/352: emacs requires \Unnnnn unicode escapes to be padded to 8 hex digits, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6c7d21e 165/352: julia-mode.el: syntax entry for '/' and '.', ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 03ce66f 173/352: Improving comments to clarify how indentation works.,
ELPA Syncer <=
- [nongnu] elpa/julia-mode e81afbf 054/352: Add Stephan to .mailmap. Welcome, also!, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode cb0a2a3 066/352: sparse ref() using matmul, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 412cbc8 067/352: Add Jameson to .mailmap and otherwise organize and update it., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 37f4f34 083/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3513e2a 087/352: Update mailmap., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7daea0a 097/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 2eab982 110/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 5d4e2ca 030/352: Fix mailmap. Sane now., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ed56114 053/352: Add .mailmap entry for George. Welcome!, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d145e83 063/352: Add StridedMatrix etc. to julia-mode, ELPA Syncer, 2021/08/29