Backport: Avoid using obsolete indent-relative-maybe

* lisp/electric.el (electric-indent-functions-without-reindent):
* lisp/indent.el (indent-according-to-mode): Check for
indent-relative-first-indent-point in addition to its obsolete alias
indent-relative-maybe.
* lisp/obsolete/vi.el (vi-com-map): Use
indent-relative-first-indent-point in place of its obsolete alias
indent-relative-maybe.

(cherry picked from commit 0e468a6204)
This commit is contained in:
Basil L. Contovounesios 2019-04-02 00:56:04 +01:00
parent 9d7e08dd8f
commit 7565d2d2fb
3 changed files with 10 additions and 8 deletions

View file

@ -223,9 +223,9 @@ Python does not lend itself to fully automatic indentation.")
(defvar electric-indent-functions-without-reindent (defvar electric-indent-functions-without-reindent
'(indent-relative indent-to-left-margin indent-relative-maybe '(indent-relative indent-to-left-margin indent-relative-maybe
py-indent-line coffee-indent-line org-indent-line yaml-indent-line indent-relative-first-indent-point py-indent-line coffee-indent-line
haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent org-indent-line yaml-indent-line haskell-indentation-indent-line
yaml-indent-line) haskell-indent-cycle haskell-simple-indent yaml-indent-line)
"List of indent functions that can't reindent. "List of indent functions that can't reindent.
If `indent-line-function' is one of those, then `electric-indent-mode' will If `indent-line-function' is one of those, then `electric-indent-mode' will
not try to reindent lines. It is normally better to make the major not try to reindent lines. It is normally better to make the major

View file

@ -65,15 +65,17 @@ e.g., `c-tab-always-indent', and do not respect this variable."
"Indent line in proper way for current major mode. "Indent line in proper way for current major mode.
Normally, this is done by calling the function specified by the Normally, this is done by calling the function specified by the
variable `indent-line-function'. However, if the value of that variable `indent-line-function'. However, if the value of that
variable is `indent-relative' or `indent-relative-maybe', handle variable is `indent-relative' or `indent-relative-first-indent-point',
it specially (since those functions are used for tabbing); in handle it specially (since those functions are used for tabbing);
that case, indent by aligning to the previous non-blank line." in that case, indent by aligning to the previous non-blank line."
(interactive) (interactive)
(save-restriction (save-restriction
(widen) (widen)
(syntax-propertize (line-end-position)) (syntax-propertize (line-end-position))
(if (memq indent-line-function (if (memq indent-line-function
'(indent-relative indent-relative-maybe)) '(indent-relative
indent-relative-maybe
indent-relative-first-indent-point))
;; These functions are used for tabbing, but can't be used for ;; These functions are used for tabbing, but can't be used for
;; indenting. Replace with something ad-hoc. ;; indenting. Replace with something ad-hoc.
(let ((column (save-excursion (let ((column (save-excursion

View file

@ -132,7 +132,7 @@ command extensions.")
(define-key vi-com-map "\C-e" 'vi-expose-line-below) (define-key vi-com-map "\C-e" 'vi-expose-line-below)
(define-key vi-com-map "\C-f" 'vi-forward-windowful) (define-key vi-com-map "\C-f" 'vi-forward-windowful)
(define-key vi-com-map "\C-g" 'keyboard-quit) (define-key vi-com-map "\C-g" 'keyboard-quit)
(define-key vi-com-map "\C-i" 'indent-relative-maybe) ; TAB (define-key vi-com-map "\C-i" 'indent-relative-first-indent-point) ; TAB
(define-key vi-com-map "\C-j" 'vi-next-line) ; LFD (define-key vi-com-map "\C-j" 'vi-next-line) ; LFD
(define-key vi-com-map "\C-k" 'vi-kill-line) ; extension (define-key vi-com-map "\C-k" 'vi-kill-line) ; extension
(define-key vi-com-map "\C-l" 'recenter) (define-key vi-com-map "\C-l" 'recenter)