all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* The <RET> will always left justify a line.
@ 2021-07-14  2:18 Hongyi Zhao
  2021-07-14 11:31 ` Eli Zaretskii
  2021-07-14 13:39 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 5+ messages in thread
From: Hongyi Zhao @ 2021-07-14  2:18 UTC (permalink / raw)
  To: help-gnu-emacs

I tried with `emacs -Q' and find that the <RET> will always left justify a line.

Any hints for this behavior?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: The <RET> will always left justify a line.
  2021-07-14  2:18 The <RET> will always left justify a line Hongyi Zhao
@ 2021-07-14 11:31 ` Eli Zaretskii
  2021-07-14 13:27   ` Hongyi Zhao
  2021-07-14 13:39 ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-07-14 11:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Wed, 14 Jul 2021 10:18:12 +0800
> 
> I tried with `emacs -Q' and find that the <RET> will always left justify a line.
> 
> Any hints for this behavior?

electric-indent-mode



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: The <RET> will always left justify a line.
  2021-07-14 11:31 ` Eli Zaretskii
@ 2021-07-14 13:27   ` Hongyi Zhao
  0 siblings, 0 replies; 5+ messages in thread
From: Hongyi Zhao @ 2021-07-14 13:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Wed, Jul 14, 2021 at 7:31 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Wed, 14 Jul 2021 10:18:12 +0800
> >
> > I tried with `emacs -Q' and find that the <RET> will always left justify a line.
> >
> > Any hints for this behavior?
>
> electric-indent-mode

According to your comment above and the notes on
<https://emacs.stackexchange.com/questions/30147/disabling-electric-indent-mode-for-one-mode-latex-mode-only>,
I customized the following function to turn off it for the LaTeX mode
provided by AUCTex:

```
(defun remove-electric-indent-mode ()
  (progn
  (electric-indent-local-mode -1)))
(add-hook 'LaTeX-mode-hook 'remove-electric-indent-mode)
```

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: The <RET> will always left justify a line.
  2021-07-14  2:18 The <RET> will always left justify a line Hongyi Zhao
  2021-07-14 11:31 ` Eli Zaretskii
@ 2021-07-14 13:39 ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-07-14 13:51   ` Hongyi Zhao
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-07-14 13:39 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao [2021-07-14 10:18:12] wrote:
> I tried with `emacs -Q' and find that the <RET> will always left
> justify a line.

That is not true.  The behavior will depend on the major mode
(basically by default RET will first reindent the current line (in most
major modes, anyway)).

> Any hints for this behavior?

My crystal ball suggests that you're using the wrong major mode.


        Stefan




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: The <RET> will always left justify a line.
  2021-07-14 13:39 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-07-14 13:51   ` Hongyi Zhao
  0 siblings, 0 replies; 5+ messages in thread
From: Hongyi Zhao @ 2021-07-14 13:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

On Wed, Jul 14, 2021 at 9:40 PM Stefan Monnier via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Hongyi Zhao [2021-07-14 10:18:12] wrote:
> > I tried with `emacs -Q' and find that the <RET> will always left
> > justify a line.
>
> That is not true.  The behavior will depend on the major mode
> (basically by default RET will first reindent the current line (in most
> major modes, anyway)).
>
> > Any hints for this behavior?
>
> My crystal ball suggests that you're using the wrong major mode.

But disable the `electric-indent-local-mode' really does the trick for
a specific buffer.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-14 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-14  2:18 The <RET> will always left justify a line Hongyi Zhao
2021-07-14 11:31 ` Eli Zaretskii
2021-07-14 13:27   ` Hongyi Zhao
2021-07-14 13:39 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-14 13:51   ` Hongyi Zhao

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.