Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
20b1d079
Commit
20b1d079
authored
Oct 07, 2000
by
Stefan Monnier
Browse files
(tab-always-indent): New var.
(indent-for-tab-command): Use it.
parent
9ee45b2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
lisp/ChangeLog
lisp/ChangeLog
+4
-1
lisp/indent.el
lisp/indent.el
+14
-3
No files found.
lisp/ChangeLog
View file @
20b1d079
2000-10-06 Stefan Monnier <monnier@cs.yale.edu>
2000-10-07 Stefan Monnier <monnier@cs.yale.edu>
* indent.el (tab-always-indent): New var.
(indent-for-tab-command): Use it.
* files.el (set-auto-mode): Ignore unknown -*- mode -*- rather than
raise an error. This way it can still defaults to a sane value.
...
...
lisp/indent.el
View file @
20b1d079
...
...
@@ -40,19 +40,30 @@
(
defvar
indent-line-function
'indent-to-left-margin
"Function to indent current line."
)
(
defcustom
tab-always-indent
t
"*Controls the operation of the TAB key.
If t, hitting TAB always just indents the current line.
If nil, hitting TAB indents the current line if point is at the left margin
or in the line's indentation, otherwise it insert a `real' tab character."
:group
'indent
:type
'boolean
)
(
defun
indent-according-to-mode
()
"Indent line in proper way for current major mode."
(
interactive
)
(
funcall
indent-line-function
))
(
defun
indent-for-tab-command
(
&optional
prefix-arg
)
"Indent line in proper way for current major mode.
"Indent line in proper way for current major mode or insert a tab.
Depending on `tab-always-indent', either insert a tab or indent.
If initial point was within line's indentation, position after
the indentation. Else stay at same point in text.
The function actually called is determined by the value of
The function actually called
to indent
is determined by the value of
`indent-line-function'."
(
interactive
"P"
)
(
if
(
eq
indent-line-function
'indent-to-left-margin
)
(
if
(
or
(
eq
indent-line-function
'indent-to-left-margin
)
(
and
(
not
tab-always-indent
)
(
>
(
current-column
)
(
current-indentation
))))
(
insert-tab
prefix-arg
)
(
if
prefix-arg
(
funcall
indent-line-function
prefix-arg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment