AUCTeX: turn off autoindent
This isn't TeX, per se, but it is about writing TeX, so perhaps it is appropriate. I find that AUCTeX's autoindent works in a way that runs counter to how I work. In case I am not clear, for instance, I like to have footnotes indented as below. When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column. I move it back and start a new line, as below, and when I type "paragraph." and hit ENTER it moves "Start" by two spaces.
end.footnote{%
This is a footnote.}
Start of a new paragraph.
Second line
Whe it happens once it is an annoyance. Hundreds of times is an issue.
I've spent too much time tweaking autoindent and at this point I'd rather just indent by hand. I've searched for how to turn it off in a number of places, including here and on emacs sites, without enlightenment. At the moment this is my .emacs file, but I'm just flailing.
;; JH trying to turn off AUCTeX indenting
(setq LaTeX-indent-environment-list '())
(setq LaTeX-indent-level 0)
(setq LaTeX-item-indent 0)
(setq LaTeX-left-right-indent-level 0)
(setq TeX-brace-indent-level 0)
editors auctex
add a comment |
This isn't TeX, per se, but it is about writing TeX, so perhaps it is appropriate. I find that AUCTeX's autoindent works in a way that runs counter to how I work. In case I am not clear, for instance, I like to have footnotes indented as below. When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column. I move it back and start a new line, as below, and when I type "paragraph." and hit ENTER it moves "Start" by two spaces.
end.footnote{%
This is a footnote.}
Start of a new paragraph.
Second line
Whe it happens once it is an annoyance. Hundreds of times is an issue.
I've spent too much time tweaking autoindent and at this point I'd rather just indent by hand. I've searched for how to turn it off in a number of places, including here and on emacs sites, without enlightenment. At the moment this is my .emacs file, but I'm just flailing.
;; JH trying to turn off AUCTeX indenting
(setq LaTeX-indent-environment-list '())
(setq LaTeX-indent-level 0)
(setq LaTeX-item-indent 0)
(setq LaTeX-left-right-indent-level 0)
(setq TeX-brace-indent-level 0)
editors auctex
1
do you want to turn off auto-fill-mode entirely (M-x auto-fill-mode) ?
– David Carlisle
Dec 31 '18 at 17:00
Don't have any emacs to test anymore, so this is just a not so strong hypothesis, but are you sure some0shouldn't be replaced withnil?
– sztruks
Dec 31 '18 at 19:49
@DavidCarlisle I did not mean to ask about autofill, I meant autoindent, where when you hit <enter> AUCTeX will change the indent of the line. I edited the post to try to be clearer.
– Jim Hefferon
Dec 31 '18 at 22:18
@sztruks I am clearly doing something wrong, but I think that those are numbers to indent by.
– Jim Hefferon
Dec 31 '18 at 22:18
1
@JimHefferon hmm doesn't for me, but then I last configured auctex last century:-)C-h ksuggest <enter> runs the function set by the customisable variable TeX-newline-function so perhaps you want to customise that...
– David Carlisle
Dec 31 '18 at 22:29
add a comment |
This isn't TeX, per se, but it is about writing TeX, so perhaps it is appropriate. I find that AUCTeX's autoindent works in a way that runs counter to how I work. In case I am not clear, for instance, I like to have footnotes indented as below. When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column. I move it back and start a new line, as below, and when I type "paragraph." and hit ENTER it moves "Start" by two spaces.
end.footnote{%
This is a footnote.}
Start of a new paragraph.
Second line
Whe it happens once it is an annoyance. Hundreds of times is an issue.
I've spent too much time tweaking autoindent and at this point I'd rather just indent by hand. I've searched for how to turn it off in a number of places, including here and on emacs sites, without enlightenment. At the moment this is my .emacs file, but I'm just flailing.
;; JH trying to turn off AUCTeX indenting
(setq LaTeX-indent-environment-list '())
(setq LaTeX-indent-level 0)
(setq LaTeX-item-indent 0)
(setq LaTeX-left-right-indent-level 0)
(setq TeX-brace-indent-level 0)
editors auctex
This isn't TeX, per se, but it is about writing TeX, so perhaps it is appropriate. I find that AUCTeX's autoindent works in a way that runs counter to how I work. In case I am not clear, for instance, I like to have footnotes indented as below. When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column. I move it back and start a new line, as below, and when I type "paragraph." and hit ENTER it moves "Start" by two spaces.
end.footnote{%
This is a footnote.}
Start of a new paragraph.
Second line
Whe it happens once it is an annoyance. Hundreds of times is an issue.
I've spent too much time tweaking autoindent and at this point I'd rather just indent by hand. I've searched for how to turn it off in a number of places, including here and on emacs sites, without enlightenment. At the moment this is my .emacs file, but I'm just flailing.
;; JH trying to turn off AUCTeX indenting
(setq LaTeX-indent-environment-list '())
(setq LaTeX-indent-level 0)
(setq LaTeX-item-indent 0)
(setq LaTeX-left-right-indent-level 0)
(setq TeX-brace-indent-level 0)
editors auctex
editors auctex
edited Dec 31 '18 at 23:49
Jim Hefferon
asked Dec 31 '18 at 15:59
Jim HefferonJim Hefferon
4012
4012
1
do you want to turn off auto-fill-mode entirely (M-x auto-fill-mode) ?
– David Carlisle
Dec 31 '18 at 17:00
Don't have any emacs to test anymore, so this is just a not so strong hypothesis, but are you sure some0shouldn't be replaced withnil?
– sztruks
Dec 31 '18 at 19:49
@DavidCarlisle I did not mean to ask about autofill, I meant autoindent, where when you hit <enter> AUCTeX will change the indent of the line. I edited the post to try to be clearer.
– Jim Hefferon
Dec 31 '18 at 22:18
@sztruks I am clearly doing something wrong, but I think that those are numbers to indent by.
– Jim Hefferon
Dec 31 '18 at 22:18
1
@JimHefferon hmm doesn't for me, but then I last configured auctex last century:-)C-h ksuggest <enter> runs the function set by the customisable variable TeX-newline-function so perhaps you want to customise that...
– David Carlisle
Dec 31 '18 at 22:29
add a comment |
1
do you want to turn off auto-fill-mode entirely (M-x auto-fill-mode) ?
– David Carlisle
Dec 31 '18 at 17:00
Don't have any emacs to test anymore, so this is just a not so strong hypothesis, but are you sure some0shouldn't be replaced withnil?
– sztruks
Dec 31 '18 at 19:49
@DavidCarlisle I did not mean to ask about autofill, I meant autoindent, where when you hit <enter> AUCTeX will change the indent of the line. I edited the post to try to be clearer.
– Jim Hefferon
Dec 31 '18 at 22:18
@sztruks I am clearly doing something wrong, but I think that those are numbers to indent by.
– Jim Hefferon
Dec 31 '18 at 22:18
1
@JimHefferon hmm doesn't for me, but then I last configured auctex last century:-)C-h ksuggest <enter> runs the function set by the customisable variable TeX-newline-function so perhaps you want to customise that...
– David Carlisle
Dec 31 '18 at 22:29
1
1
do you want to turn off auto-fill-mode entirely (
M-x auto-fill-mode ) ?– David Carlisle
Dec 31 '18 at 17:00
do you want to turn off auto-fill-mode entirely (
M-x auto-fill-mode ) ?– David Carlisle
Dec 31 '18 at 17:00
Don't have any emacs to test anymore, so this is just a not so strong hypothesis, but are you sure some
0 shouldn't be replaced with nil ?– sztruks
Dec 31 '18 at 19:49
Don't have any emacs to test anymore, so this is just a not so strong hypothesis, but are you sure some
0 shouldn't be replaced with nil ?– sztruks
Dec 31 '18 at 19:49
@DavidCarlisle I did not mean to ask about autofill, I meant autoindent, where when you hit <enter> AUCTeX will change the indent of the line. I edited the post to try to be clearer.
– Jim Hefferon
Dec 31 '18 at 22:18
@DavidCarlisle I did not mean to ask about autofill, I meant autoindent, where when you hit <enter> AUCTeX will change the indent of the line. I edited the post to try to be clearer.
– Jim Hefferon
Dec 31 '18 at 22:18
@sztruks I am clearly doing something wrong, but I think that those are numbers to indent by.
– Jim Hefferon
Dec 31 '18 at 22:18
@sztruks I am clearly doing something wrong, but I think that those are numbers to indent by.
– Jim Hefferon
Dec 31 '18 at 22:18
1
1
@JimHefferon hmm doesn't for me, but then I last configured auctex last century:-)
C-h k suggest <enter> runs the function set by the customisable variable TeX-newline-function so perhaps you want to customise that...– David Carlisle
Dec 31 '18 at 22:29
@JimHefferon hmm doesn't for me, but then I last configured auctex last century:-)
C-h k suggest <enter> runs the function set by the customisable variable TeX-newline-function so perhaps you want to customise that...– David Carlisle
Dec 31 '18 at 22:29
add a comment |
1 Answer
1
active
oldest
votes
David Carlile has a point in mentioning TeX-newline-function, which is, by default, set to newline. Looking the latter's docstring, we find:
If ‘electric-indent-mode’ is enabled, this indents the final new line
that it adds, and reindents the preceding line. To just insert
a newline, use M-x electric-indent-just-newline.
I can reproduce the behavior you describe with my settings, and it appears electric-indent-mode is on by default (I don't have it explicitly in my init file, and it was on here). Indeed, disabling it, the editor does let me "Start of a new paragraph." without the extra spaces.
So, disabling electric-indent-mode (in LaTeX-mode, or everywhere, as you prefer) or setting TeX-newline-function to electric-indent-just-newline may be two good alternatives for you.
One sensible way to disable electric-indent-mode for specific modes is suggested at Disabling electric-indent-mode for one mode (latex mode) only. Which is to create a function to disable electric-indent-local-mode and then hook it to the mode(s) of interest:
(defun JH/remove-electric-indent-mode ()
(electric-indent-local-mode -1))
(add-hook 'LaTeX-mode-hook 'JH/remove-electric-indent-mode)
(add-hook 'tex-mode-hook 'JH/remove-electric-indent-mode)
;; and so on
However, you seem to be fighting auto-indent in general, when it should be there to help you. For example, the reason in the first place why "When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column." seems to be that you set (setq TeX-brace-indent-level 0). Furthermore, the fact that "when I type "paragraph." and hit ENTER it moves "Start" by two spaces" seems to indicate you have indentation set to two spaces. However, when you manually indented your footnote, you added four spaces.
The default behavior seems to rely heavily on auto-indent doing the right thing, which makes sense. However, I think you could get things to work quite close to what your are picturing, along with auto-indent, with:
(setq TeX-brace-indent-level 4)
Which will set your footnotes (and any other open braces) indented to four spaces, while the rest remains with two spaces. That alone should allow you to type what you describe.
2
electric-indent-modechanged behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.
– jfbu
Jan 1 at 11:01
1
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disableelectric-indent-modefor AUCTeX?
– gusbrs
Jan 1 at 11:16
1
For reference, one sensible way to disableelectric-indent-modeforLaTeX-mode: emacs.stackexchange.com/a/30148/18951
– gusbrs
Jan 1 at 11:27
I had forgotten but I turned it off as part of a hook tolisp-mode, see gist and it is inherited by tex mode in particular. And myinitial-major-modeis left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard*scratch*buffer)
– jfbu
Jan 1 at 11:59
1
@JimHefferon I was actually unaware ofelectric-indent-modeworkings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.
– gusbrs
Jan 1 at 12:34
|
show 4 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468047%2fauctex-turn-off-autoindent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
David Carlile has a point in mentioning TeX-newline-function, which is, by default, set to newline. Looking the latter's docstring, we find:
If ‘electric-indent-mode’ is enabled, this indents the final new line
that it adds, and reindents the preceding line. To just insert
a newline, use M-x electric-indent-just-newline.
I can reproduce the behavior you describe with my settings, and it appears electric-indent-mode is on by default (I don't have it explicitly in my init file, and it was on here). Indeed, disabling it, the editor does let me "Start of a new paragraph." without the extra spaces.
So, disabling electric-indent-mode (in LaTeX-mode, or everywhere, as you prefer) or setting TeX-newline-function to electric-indent-just-newline may be two good alternatives for you.
One sensible way to disable electric-indent-mode for specific modes is suggested at Disabling electric-indent-mode for one mode (latex mode) only. Which is to create a function to disable electric-indent-local-mode and then hook it to the mode(s) of interest:
(defun JH/remove-electric-indent-mode ()
(electric-indent-local-mode -1))
(add-hook 'LaTeX-mode-hook 'JH/remove-electric-indent-mode)
(add-hook 'tex-mode-hook 'JH/remove-electric-indent-mode)
;; and so on
However, you seem to be fighting auto-indent in general, when it should be there to help you. For example, the reason in the first place why "When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column." seems to be that you set (setq TeX-brace-indent-level 0). Furthermore, the fact that "when I type "paragraph." and hit ENTER it moves "Start" by two spaces" seems to indicate you have indentation set to two spaces. However, when you manually indented your footnote, you added four spaces.
The default behavior seems to rely heavily on auto-indent doing the right thing, which makes sense. However, I think you could get things to work quite close to what your are picturing, along with auto-indent, with:
(setq TeX-brace-indent-level 4)
Which will set your footnotes (and any other open braces) indented to four spaces, while the rest remains with two spaces. That alone should allow you to type what you describe.
2
electric-indent-modechanged behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.
– jfbu
Jan 1 at 11:01
1
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disableelectric-indent-modefor AUCTeX?
– gusbrs
Jan 1 at 11:16
1
For reference, one sensible way to disableelectric-indent-modeforLaTeX-mode: emacs.stackexchange.com/a/30148/18951
– gusbrs
Jan 1 at 11:27
I had forgotten but I turned it off as part of a hook tolisp-mode, see gist and it is inherited by tex mode in particular. And myinitial-major-modeis left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard*scratch*buffer)
– jfbu
Jan 1 at 11:59
1
@JimHefferon I was actually unaware ofelectric-indent-modeworkings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.
– gusbrs
Jan 1 at 12:34
|
show 4 more comments
David Carlile has a point in mentioning TeX-newline-function, which is, by default, set to newline. Looking the latter's docstring, we find:
If ‘electric-indent-mode’ is enabled, this indents the final new line
that it adds, and reindents the preceding line. To just insert
a newline, use M-x electric-indent-just-newline.
I can reproduce the behavior you describe with my settings, and it appears electric-indent-mode is on by default (I don't have it explicitly in my init file, and it was on here). Indeed, disabling it, the editor does let me "Start of a new paragraph." without the extra spaces.
So, disabling electric-indent-mode (in LaTeX-mode, or everywhere, as you prefer) or setting TeX-newline-function to electric-indent-just-newline may be two good alternatives for you.
One sensible way to disable electric-indent-mode for specific modes is suggested at Disabling electric-indent-mode for one mode (latex mode) only. Which is to create a function to disable electric-indent-local-mode and then hook it to the mode(s) of interest:
(defun JH/remove-electric-indent-mode ()
(electric-indent-local-mode -1))
(add-hook 'LaTeX-mode-hook 'JH/remove-electric-indent-mode)
(add-hook 'tex-mode-hook 'JH/remove-electric-indent-mode)
;; and so on
However, you seem to be fighting auto-indent in general, when it should be there to help you. For example, the reason in the first place why "When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column." seems to be that you set (setq TeX-brace-indent-level 0). Furthermore, the fact that "when I type "paragraph." and hit ENTER it moves "Start" by two spaces" seems to indicate you have indentation set to two spaces. However, when you manually indented your footnote, you added four spaces.
The default behavior seems to rely heavily on auto-indent doing the right thing, which makes sense. However, I think you could get things to work quite close to what your are picturing, along with auto-indent, with:
(setq TeX-brace-indent-level 4)
Which will set your footnotes (and any other open braces) indented to four spaces, while the rest remains with two spaces. That alone should allow you to type what you describe.
2
electric-indent-modechanged behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.
– jfbu
Jan 1 at 11:01
1
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disableelectric-indent-modefor AUCTeX?
– gusbrs
Jan 1 at 11:16
1
For reference, one sensible way to disableelectric-indent-modeforLaTeX-mode: emacs.stackexchange.com/a/30148/18951
– gusbrs
Jan 1 at 11:27
I had forgotten but I turned it off as part of a hook tolisp-mode, see gist and it is inherited by tex mode in particular. And myinitial-major-modeis left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard*scratch*buffer)
– jfbu
Jan 1 at 11:59
1
@JimHefferon I was actually unaware ofelectric-indent-modeworkings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.
– gusbrs
Jan 1 at 12:34
|
show 4 more comments
David Carlile has a point in mentioning TeX-newline-function, which is, by default, set to newline. Looking the latter's docstring, we find:
If ‘electric-indent-mode’ is enabled, this indents the final new line
that it adds, and reindents the preceding line. To just insert
a newline, use M-x electric-indent-just-newline.
I can reproduce the behavior you describe with my settings, and it appears electric-indent-mode is on by default (I don't have it explicitly in my init file, and it was on here). Indeed, disabling it, the editor does let me "Start of a new paragraph." without the extra spaces.
So, disabling electric-indent-mode (in LaTeX-mode, or everywhere, as you prefer) or setting TeX-newline-function to electric-indent-just-newline may be two good alternatives for you.
One sensible way to disable electric-indent-mode for specific modes is suggested at Disabling electric-indent-mode for one mode (latex mode) only. Which is to create a function to disable electric-indent-local-mode and then hook it to the mode(s) of interest:
(defun JH/remove-electric-indent-mode ()
(electric-indent-local-mode -1))
(add-hook 'LaTeX-mode-hook 'JH/remove-electric-indent-mode)
(add-hook 'tex-mode-hook 'JH/remove-electric-indent-mode)
;; and so on
However, you seem to be fighting auto-indent in general, when it should be there to help you. For example, the reason in the first place why "When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column." seems to be that you set (setq TeX-brace-indent-level 0). Furthermore, the fact that "when I type "paragraph." and hit ENTER it moves "Start" by two spaces" seems to indicate you have indentation set to two spaces. However, when you manually indented your footnote, you added four spaces.
The default behavior seems to rely heavily on auto-indent doing the right thing, which makes sense. However, I think you could get things to work quite close to what your are picturing, along with auto-indent, with:
(setq TeX-brace-indent-level 4)
Which will set your footnotes (and any other open braces) indented to four spaces, while the rest remains with two spaces. That alone should allow you to type what you describe.
David Carlile has a point in mentioning TeX-newline-function, which is, by default, set to newline. Looking the latter's docstring, we find:
If ‘electric-indent-mode’ is enabled, this indents the final new line
that it adds, and reindents the preceding line. To just insert
a newline, use M-x electric-indent-just-newline.
I can reproduce the behavior you describe with my settings, and it appears electric-indent-mode is on by default (I don't have it explicitly in my init file, and it was on here). Indeed, disabling it, the editor does let me "Start of a new paragraph." without the extra spaces.
So, disabling electric-indent-mode (in LaTeX-mode, or everywhere, as you prefer) or setting TeX-newline-function to electric-indent-just-newline may be two good alternatives for you.
One sensible way to disable electric-indent-mode for specific modes is suggested at Disabling electric-indent-mode for one mode (latex mode) only. Which is to create a function to disable electric-indent-local-mode and then hook it to the mode(s) of interest:
(defun JH/remove-electric-indent-mode ()
(electric-indent-local-mode -1))
(add-hook 'LaTeX-mode-hook 'JH/remove-electric-indent-mode)
(add-hook 'tex-mode-hook 'JH/remove-electric-indent-mode)
;; and so on
However, you seem to be fighting auto-indent in general, when it should be there to help you. For example, the reason in the first place why "When I type the close curly braces and ENTER AUCTeX will bring the footnote back to the first column." seems to be that you set (setq TeX-brace-indent-level 0). Furthermore, the fact that "when I type "paragraph." and hit ENTER it moves "Start" by two spaces" seems to indicate you have indentation set to two spaces. However, when you manually indented your footnote, you added four spaces.
The default behavior seems to rely heavily on auto-indent doing the right thing, which makes sense. However, I think you could get things to work quite close to what your are picturing, along with auto-indent, with:
(setq TeX-brace-indent-level 4)
Which will set your footnotes (and any other open braces) indented to four spaces, while the rest remains with two spaces. That alone should allow you to type what you describe.
edited Jan 1 at 12:30
answered Jan 1 at 0:15
gusbrsgusbrs
7,1142840
7,1142840
2
electric-indent-modechanged behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.
– jfbu
Jan 1 at 11:01
1
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disableelectric-indent-modefor AUCTeX?
– gusbrs
Jan 1 at 11:16
1
For reference, one sensible way to disableelectric-indent-modeforLaTeX-mode: emacs.stackexchange.com/a/30148/18951
– gusbrs
Jan 1 at 11:27
I had forgotten but I turned it off as part of a hook tolisp-mode, see gist and it is inherited by tex mode in particular. And myinitial-major-modeis left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard*scratch*buffer)
– jfbu
Jan 1 at 11:59
1
@JimHefferon I was actually unaware ofelectric-indent-modeworkings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.
– gusbrs
Jan 1 at 12:34
|
show 4 more comments
2
electric-indent-modechanged behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.
– jfbu
Jan 1 at 11:01
1
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disableelectric-indent-modefor AUCTeX?
– gusbrs
Jan 1 at 11:16
1
For reference, one sensible way to disableelectric-indent-modeforLaTeX-mode: emacs.stackexchange.com/a/30148/18951
– gusbrs
Jan 1 at 11:27
I had forgotten but I turned it off as part of a hook tolisp-mode, see gist and it is inherited by tex mode in particular. And myinitial-major-modeis left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard*scratch*buffer)
– jfbu
Jan 1 at 11:59
1
@JimHefferon I was actually unaware ofelectric-indent-modeworkings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.
– gusbrs
Jan 1 at 12:34
2
2
electric-indent-mode changed behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.– jfbu
Jan 1 at 11:01
electric-indent-mode changed behaviour at Emacs 24.4, see here and it is nightmarish with AUCTeX mode. I turn it off for tex in my init file. Also for some other modes.– jfbu
Jan 1 at 11:01
1
1
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disable
electric-indent-mode for AUCTeX?– gusbrs
Jan 1 at 11:16
@jfbu Thank you for the pointer, I wasn't aware of this discussion. Though it doesn't really interfere much with my own use, I do agree messing with <Ret> default behavior in this way is quite intrusive. Given your experience with the matter, would you say I should revise the advice in the answer? How do you usually disable
electric-indent-mode for AUCTeX?– gusbrs
Jan 1 at 11:16
1
1
For reference, one sensible way to disable
electric-indent-mode for LaTeX-mode: emacs.stackexchange.com/a/30148/18951– gusbrs
Jan 1 at 11:27
For reference, one sensible way to disable
electric-indent-mode for LaTeX-mode: emacs.stackexchange.com/a/30148/18951– gusbrs
Jan 1 at 11:27
I had forgotten but I turned it off as part of a hook to
lisp-mode, see gist and it is inherited by tex mode in particular. And my initial-major-mode is left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard *scratch* buffer)– jfbu
Jan 1 at 11:59
I had forgotten but I turned it off as part of a hook to
lisp-mode, see gist and it is inherited by tex mode in particular. And my initial-major-mode is left unmodified (lisp-interaction-mode) (I don't know if that last remark has any relevance, it seems to regard *scratch* buffer)– jfbu
Jan 1 at 11:59
1
1
@JimHefferon I was actually unaware of
electric-indent-mode workings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.– gusbrs
Jan 1 at 12:34
@JimHefferon I was actually unaware of
electric-indent-mode workings, because it felt sensible to me. But it was nice to get a better grasp on it. And, I must admit, depending on what you expect, it does make sense to disable it selectively or altogether.– gusbrs
Jan 1 at 12:34
|
show 4 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468047%2fauctex-turn-off-autoindent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
do you want to turn off auto-fill-mode entirely (
M-x auto-fill-mode) ?– David Carlisle
Dec 31 '18 at 17:00
Don't have any emacs to test anymore, so this is just a not so strong hypothesis, but are you sure some
0shouldn't be replaced withnil?– sztruks
Dec 31 '18 at 19:49
@DavidCarlisle I did not mean to ask about autofill, I meant autoindent, where when you hit <enter> AUCTeX will change the indent of the line. I edited the post to try to be clearer.
– Jim Hefferon
Dec 31 '18 at 22:18
@sztruks I am clearly doing something wrong, but I think that those are numbers to indent by.
– Jim Hefferon
Dec 31 '18 at 22:18
1
@JimHefferon hmm doesn't for me, but then I last configured auctex last century:-)
C-h ksuggest <enter> runs the function set by the customisable variable TeX-newline-function so perhaps you want to customise that...– David Carlisle
Dec 31 '18 at 22:29