LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I get emacs to indent for tab AND respect tab to demarcate paragraphs (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-get-emacs-to-indent-for-tab-and-respect-tab-to-demarcate-paragraphs-4175591505/)

RandomTroll 10-15-2016 11:32 PM

How do I get emacs to indent for tab AND respect tab to demarcate paragraphs
 
In emacs 24.3 and earlier, I could choose to indent for tabs at the beginning of a line and use paragraph-indent-minor mode to make fill respect a tab as the beginning of a paragraph (instead of whitespace to be eliminated).

Beginning in 24.4 I couldn't. When package 24.3 no longer ran with updated libraries I built my own version of 24.3. Now I can no longer build it, so I'm trying to figure out how to make current emacs do what I want.

I can make emacs always-indent on startup with tab-always-indent in .emacs, but it doesn't start in parindent mode, I have to turn it on, which is a bore, *and* turns off tabs making indents.

How can I make emacs start in parindent mode and indent for tab?

smallpond 10-16-2016 07:28 PM

Can't you turn on paragraph-indent--mode in a text-mode-hook?

RandomTroll 10-17-2016 10:13 AM

Quote:

Originally Posted by smallpond (Post 5618905)
Can't you turn on paragraph-indent--mode in a text-mode-hook?

I can't find 'text-mode-hook' in 'info emacs' or when I search help when in emacs.

In fundamental mode tab indents ('cause I have 'tab-always-indent' on) but when I switch to (or start up in) a paragraph-indent mode it doesn't. Before version 24.4 it did.

I hoped to find it in one of the 'el's (e.g., text-mode.el or indent.el) but substituting 24.3's 'el's made no difference.

bigrigdriver 10-17-2016 12:39 PM

If I have read the Emacs manual correctly, you should set Paragraph-Indent Text mode instead of the usual Text mode.
Then set the buffer option [Save for Future Sessions] to have the option on startup.
See sections 51.1.3 Changing a Variable and 51.1.4 Saving Customizations of the Emacs manual.

RandomTroll 10-18-2016 12:37 PM

Quote:

Originally Posted by bigrigdriver (Post 5619206)
you should set Paragraph-Indent Text mode instead of the usual Text mode.

I do, and wrote that I do.


Quote:

Originally Posted by bigrigdriver (Post 5619206)
Then set the buffer option [Save for Future Sessions] to have the option on startup.

I edit $HOME/.emacs. Beginning with 24.4 emacs no longer respects tab-always-indent in text modes. It respects it in fundamental mode (and C and HTML), but fundamental mode does not treat indentation as the beginning of a paragraph.


All times are GMT -5. The time now is 07:07 PM.