@@ -1342,25 +1342,25 @@ Then run `inferior-ess-r-reload-hook'."
13421342(defun ess-r-indent-line ()
13431343 " Indent current line as ESS R code.
13441344Return the amount the indentation changed by."
1345- (let ((indent (ess-calculate-indent))
1346- beg shift-amt
1347- ( case-fold-search nil )
1348- (pos ( - ( point-max ) ( point ))) )
1349- (beginning-of-line )
1350- (setq beg (point ))
1351- (skip-chars-forward " \t " )
1352- (setq shift-amt (- indent (current-column )))
1353- (if (zerop shift-amt)
1354- (if (> (- (point-max ) pos) (point ))
1355- (goto-char (- (point-max ) pos)))
1356- (delete-region beg (point ))
1357- (indent-to indent)
1358- ; ; If initial point was within line's indentation,
1359- ; ; position after the indentation.
1360- ; ; Else stay at same point in text.
1361- (when (> (- (point-max ) pos) (point ))
1362- (goto-char (- (point-max ) pos))))
1363- shift-amt))
1345+ (when- let ((indent (ess-calculate-indent) ))
1346+ ( let (( case-fold-search nil )
1347+ (pos ( - ( point-max ) ( point )) )
1348+ beg shift-amt )
1349+ (beginning-of-line )
1350+ (setq beg (point ))
1351+ (skip-chars-forward " \t " )
1352+ (setq shift-amt (- indent (current-column )))
1353+ (if (zerop shift-amt)
1354+ (if (> (- (point-max ) pos) (point ))
1355+ (goto-char (- (point-max ) pos)))
1356+ (delete-region beg (point ))
1357+ (indent-to indent)
1358+ ; ; If initial point was within line's indentation,
1359+ ; ; position after the indentation.
1360+ ; ; Else stay at same point in text.
1361+ (when (> (- (point-max ) pos) (point ))
1362+ (goto-char (- (point-max ) pos))))
1363+ shift-amt) ))
13641364
13651365(defun ess-r-indent-exp ()
13661366 (save-excursion
0 commit comments