Roderick <hruodr@gmail.com> writes:
How to get that emacs do not take decisions for the user?
I do not want indentations and tabs that I do not type.
I do not want anything that I do not type, and I want, what I type.
Is that too much to expect from an editor?!
I wasted a lot of time trying to do it. I have the following in
.emacs:
(setq-default indent-tabs-mode t)
(electric-indent-mode -1)
And little changes has big side effects. But what I want is very
simple as said.
Any hint?
How to get that emacs do not take decisions for the user?
I do not want indentations and tabs that I do not type.
I do not want anything that I do not type, and I want, what
I type. Is that too much to expect from an editor?!
How to disable this annoying thing completely and without new
similar annoying side effects? It seems to be very difficult, if
not imposible. Perhaps the solution is stopping using emacs.
Stand of the thing:
I wasted a lot of time trying to do it. I have the following in .emacs:
(setq-default indent-tabs-mode t)
(electric-indent-mode -1)
And little changes has big side effects.
To avoid things appearing when you type 'cat<<' in sh-mode. [...]
Emacs is no a "What You Type Is What You Get" Editor.
Javier <invalid@invalid.invalid> writes:
There is more than that. (electric-indent-mode -1) disables some
things but not everything.
To avoid things appearing when you type 'cat<<' in sh-mode.
(add-hook 'sh-mode-hook
(lambda () (sh-electric-here-document-mode -1)))
There might be more autyping stuff which I am unaware of.
And little changes has big side effects.
For example, it destroys pasting in a terminal.
To avoid things appearing when you type 'cat<<' in sh-mode.
(add-hook 'sh-mode-hook
(lambda () (sh-electric-here-document-mode -1)))
There might be more autyping stuff which I am unaware of.
M-x apropos-command RET electric RET lists some 27 commands on
my Emacs, not all of them modes. It should be a decent starting
point for when Emacs starts adding text on its own.
Javier <invalid@invalid.invalid> writes:
To avoid things appearing when you type 'cat<<' in sh-mode.
(add-hook 'sh-mode-hook
(lambda () (sh-electric-here-document-mode -1)))
There might be more autyping stuff which I am unaware of.
M-x apropos-command RET electric RET lists some 27 commands on my
Emacs, not all of them modes. It should be a decent starting point
for when Emacs starts adding text on its own.
That doesn't tell you everything. It lists 20 commands on emacs
26.1, but sh-electric-here-document-mode is not in the list.
Looking at the NEWS files lists 44 electric things in emacs 26.1.
And then you have things that don't contain the word 'electric',
like 'indent-tabs-mode'.
AND the NEWS files say that the feature is there, but they don't say explicitly when it is switched on by default.
find /usr/share/emacs/26.1/etc/NEWS* | xargs grep -i sh-electric-here-document-mode
It is, in my 25.1.1 debian 4+deb9u1:
sh-electric-here-document-mode M-x ... RET
Make << insert a here document skeleton.
Of course, the command has to be either already loaded, or
set up for autoloading.
find /usr/share/emacs/26.1/etc/NEWS* | xargs grep -i sh-electric-here-document-mode
Curiously, is there any specific reason /not/ to use -exec?
FWIW, xargs(1) does its own "quoting issues" (unless run with -0.)
$ find /usr/share/emacs/26.1/etc/NEWS* \
-exec grep -i sh-electric-here-document-mode {} +
[...]
Emacs is no a "What You Type Is What You Get" Editor.
I agree with you. It's impossible to revert to a reliable behavior.
In any case, if your problem is pasting text to a terminal, they
fixed it with bracketed paste (enabled by default) in emacs 25 and
with recent versions of xterm. However, the pasting text problem
remains with other terminals like rxvt.
My problem is, for example, that in tcl mode it adds indentation
when I close a bracket in an expression if { }, proc { } { }, etc.
I want to decide where to put indentation and not leave emacs to do it.
Where I put space, it should be space, and where I do not put it,
it should be not. And the same for every symbol I type or do not type.
So why don't you just edit everything in fundamental mode?
If you don't want the fancy things provided by language-specific
modes, don't use them.
So why don't you just edit everything in fundamental mode?
If you don't want the fancy things provided by language-specific
modes, don't use them.
I do that for example when editing TeX.
In Tcl mode I do like syntax colouring and the possibility to
run scripts from the editing buffer.
My problem is, for example, that in tcl mode it adds indentation
when I close a bracket in an expression if { }, proc { } { }, etc.
I want to decide where to put indentation and not leave emacs to do it.
Javier <invalid@invalid.invalid> writes:
Roderick <hruodr@gmail.com> wrote:
My problem is, for example, that in tcl mode it adds indentation
when I close a bracket in an expression if { }, proc { } { }, etc.
I want to decide where to put indentation and not leave emacs to do it.
zcat /usr/share/emacs/*/lisp/progmodes/tcl.el.gz | grep electric ...
...
(define-key map "}" 'tcl-electric-brace)
(defun tcl-electric-brace (arg)
...
So you need to add a hook in tcl-mode-hook disabling it.
Or customize ‘tcl-indent-level’, ‘tcl-continued-indent-level’ if you just want to use fixed amounts of indentation.
Ralf Fassel <ralfixx@gmx.de> writes:
* Roderick <hruodr@gmail.com>
My problem is, for example, that in tcl mode it adds indentation
when I close a bracket in an expression if { }, proc { } { }, etc.
I want to decide where to put indentation and not leave emacs to do it.
Where I put space, it should be space, and where I do not put it, it
should be not. And the same for every symbol I type or do not type.
In your .emacs:
(setq tcl-mode-map (make-sparse-keymap))
disables most of the specialized keys, while keeping syntax highlight
etc. Works for me with GNU emacs 24.3.
(setq tcl-mode-map (make-sparse-keymap))
disables most of the specialized keys, while keeping syntax highlight
etc. Works for me with GNU emacs 24.3.
Unfortunately, that'd also disable the tcl-eval- and similar
bindings, which may or may not be desirable; per July's "master":
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 437 |
Nodes: | 16 (2 / 14) |
Uptime: | 186:13:06 |
Calls: | 9,135 |
Calls today: | 2 |
Files: | 13,429 |
Messages: | 6,034,843 |