AUCTeX: turn off autoindent












3














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)









share|improve this question




















  • 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 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










  • @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 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
















3














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)









share|improve this question




















  • 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 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










  • @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 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














3












3








3







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)









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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










  • @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 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














  • 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 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










  • @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 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








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










1 Answer
1






active

oldest

votes


















2














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.






share|improve this answer



















  • 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






  • 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






  • 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










  • 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




    @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











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
});


}
});














draft saved

draft discarded


















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









2














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.






share|improve this answer



















  • 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






  • 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






  • 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










  • 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




    @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
















2














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.






share|improve this answer



















  • 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






  • 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






  • 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










  • 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




    @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














2












2








2






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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 1 at 12:30

























answered Jan 1 at 0:15









gusbrsgusbrs

7,1142840




7,1142840








  • 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






  • 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






  • 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










  • 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




    @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














  • 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






  • 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






  • 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










  • 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




    @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








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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?