diff options
author | Glenn Morris <rgm@gnu.org> | 2017-12-20 21:15:43 -0500 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2017-12-20 21:15:43 -0500 |
commit | b1cf262a79463f28164ea1c2ffee3c657ce02ea4 (patch) | |
tree | 4a428c5e0c026c1bb30e5972e78b145335b4b747 /lisp/indent.el | |
parent | a415a97461cb10d2c6710871f90f57bd1ca34ec2 (diff) | |
parent | b3f4a3a5aee93fa2f7ad2597383befbf7b242209 (diff) | |
download | emacs-b1cf262a79463f28164ea1c2ffee3c657ce02ea4.tar.gz emacs-b1cf262a79463f28164ea1c2ffee3c657ce02ea4.tar.bz2 emacs-b1cf262a79463f28164ea1c2ffee3c657ce02ea4.zip |
Merge from origin/emacs-26
b3f4a3a (origin/emacs-26) Special-case %DUMBFW for GnuTLS between 3.2...
c2ae057 Work around GnuTLS version issues with %DUMBFW (tiny change)
2f9d9ef ; Remove the mention of "plain C code" in the docstring as well
aca827b Merge branch 'widen-less' into emacs-26
87548f5 ; Rephrase NEWS entry a bit
da0d773 (emacs-26) ; * lisp/erc/erc.el: Update URL.
3a60515 * lisp/erc/erc.el (erc-shorten-server-name): Silence compiler...
471b6c1 ; Replace non-ascii quote characters in doc strings etc
7af7f5e Fix some more aliases to user options
79fb4b5 Fix some flymake aliases
b9fbc03 (origin/widen-less) Widen in indent-for-tab-command in the no...
446faf3 Replace the mention of c-indent-defun with js-indent-line
7e9eef0 Consolidate 'widen' calls
# Conflicts:
# etc/NEWS
# lisp/progmodes/flymake-proc.el
Diffstat (limited to 'lisp/indent.el')
-rw-r--r-- | lisp/indent.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/indent.el b/lisp/indent.el index d5ba0bd8491..400280f615a 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -69,6 +69,8 @@ variable is `indent-relative' or `indent-relative-maybe', handle it specially (since those functions are used for tabbing); in that case, indent by aligning to the previous non-blank line." (interactive) + (save-restriction + (widen) (syntax-propertize (line-end-position)) (if (memq indent-line-function '(indent-relative indent-relative-maybe)) @@ -84,7 +86,7 @@ that case, indent by aligning to the previous non-blank line." (indent-line-to column) (save-excursion (indent-line-to column)))) ;; The normal case. - (funcall indent-line-function))) + (funcall indent-line-function)))) (defun indent--default-inside-comment () (unless (or (> (current-column) (current-indentation)) @@ -140,11 +142,11 @@ prefix argument is ignored." (old-indent (current-indentation))) ;; Indent the line. - (or (not (eq (funcall indent-line-function) 'noindent)) + (or (not (eq (indent--funcall-widened indent-line-function) 'noindent)) (indent--default-inside-comment) (when (or (<= (current-column) (current-indentation)) (not (eq tab-always-indent 'complete))) - (funcall (default-value 'indent-line-function)))) + (indent--funcall-widened (default-value 'indent-line-function)))) (cond ;; If the text was already indented right, try completion. @@ -166,6 +168,11 @@ prefix argument is ignored." (< (point) end-marker)) (indent-rigidly (point) end-marker indentation-change)))))))))) +(defun indent--funcall-widened (func) + (save-restriction + (widen) + (funcall func))) + (defun insert-tab (&optional arg) (let ((count (prefix-numeric-value arg))) (if (and abbrev-mode @@ -538,7 +545,9 @@ column to indent to; if it is nil, use one of the three methods above." (forward-line 1))))) ;; Use indent-region-function is available. (indent-region-function - (funcall indent-region-function start end)) + (save-restriction + (widen) + (funcall indent-region-function start end))) ;; Else, use a default implementation that calls indent-line-function on ;; each line. (t (indent-region-line-by-line start end))) |