1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00
Commit Graph

154 Commits

Author SHA1 Message Date
Miha Rihtaršič
f596f0db82 Don't ignore restriction in indent-region-line-by-line
* lisp/indent.el (indent-according-to-mode): Don't widen if the new
optional argument is non-nil.
(indent-region): Explicitly widen before calling
indent-region-line-by-line.
(indent-region-line-by-line): Don't widen (bug#51892).

Emacs convention is that low-level functions should respect restriction
so that their callers can set restriction according to their needs. For
example, 'c-indent-region' is a lower-level function which respects the
current restriction and 'indent-region' is a higher-level user command
which sets the restriction for lower-level functions, it calls
"(widen)".

'indent-region-line-by-line' is a low-level function on a similar level
as 'c-indent-region'. This patch makes it respect the current
restriction instead of having it call "(widen)".
2021-11-18 08:11:26 +01:00
Stefan Kangas
aebba085cb ; More minor stylistic fixes found by checkdoc 2021-09-22 20:26:40 +02:00
Eli Zaretskii
aecf4518a0 ; * lisp/indent.el (tab-first-completion): Fix :version tag. 2021-09-05 21:24:22 +03:00
Eli Zaretskii
a4c922d84f Clarify indent-line-function doc string
* lisp/indent.el (indent-line-function): Clarify by avoiding
specifics (bug#20846).
2021-05-30 06:11:02 +02:00
Stefan Monnier
cfb91b5bca * lisp/indent.el (beginning-of-line-text): Mark it as a movement command
So that combining it with `shift` selects the text, as usual, in case
you have it bound for example to `C-a` in a mode like `enriched-mode`.
2021-02-08 09:18:41 -05:00
Glenn Morris
c0d504eb7e Merge from origin/emacs-27
8ad48a0bdd (origin/emacs-27) Improve doc string of 'text-scale-adjust'
7a25ff767d Clarify the indent-rigidly doc string
6c5ddf0e0b Fix two small tab bar issues
c71e08eba9 Fix last change in syntax.texi

# Conflicts:
#	lisp/indent.el
2021-02-06 08:10:38 -08:00
Lars Ingebrigtsen
7a25ff767d Clarify the indent-rigidly doc string
* lisp/indent.el (indent-rigidly): Clarify exiting the transient
mode (bug#46296).
2021-02-06 11:46:58 +01:00
Lars Ingebrigtsen
a14811fc96 Don't hard-code ignored functions in `indent-according-to-mode'
* lisp/indent.el (indent-line-ignored-functions): New variable
(bug#26945).
(indent-according-to-mode): Use it.
2021-02-05 13:36:06 +01:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Paul Eggert
8c1fe1e5ef Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2021-01-01 00:32:32 -08:00
Lars Ingebrigtsen
c41c1ac410 indent-rigidly doc string clarification
* lisp/indent.el (indent-rigidly): Note that the command
deactivates the mark (bug#42842).
2020-10-16 17:52:56 +02:00
Alex Branham
64c8511664 Add a new variable tab-first-completion
* doc/emacs/indent.texi (Indent Convenience): Mention it.

* doc/lispref/text.texi (Mode-Specific Indent): Document it.

* lisp/indent.el (tab-first-completion): New variable (bug#34787).
(indent-for-tab-command): Use it.
2020-10-14 07:26:58 +02:00
Lars Ingebrigtsen
65565a16cf Revert "Explain in the tab-always-indent doc how to make TAB insert a TAB"
This reverts commit 4b23716311.

overriding-terminal-local-map should apparently not be used for minor stuff like this.
2020-09-08 12:34:42 +02:00
Lars Ingebrigtsen
4b23716311 Explain in the tab-always-indent doc how to make TAB insert a TAB
* lisp/indent.el (tab-always-indent): Mention how to make TAB
insert a TAB character always (bug#37183).
2020-09-05 16:40:58 +02:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Paul Eggert
f744797af1 Go back to "Maintainer: emacs-devel@gnu.org"
Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is
no special maintainer for a file.  Although this wasn't documented
it was common practice and removing the lines didn't have consensus.
2019-05-25 14:25:18 -07:00
Paul Eggert
bef1be8730 Fixes for "Maintainer:" and related lines
Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines,
which are not that useful.  It also cleans up and regularizes a
few similar lines.
2019-05-19 21:34:27 -07:00
Alex Branham
10cd65878c
Update documentation for indent-relative functions
* lisp/indent.el (indent-relative): Document what happens when there
  is no previous nonblank line.
* doc/lispref/text.texi (Relative Indent): Document
  indent-relative-first-indent-point instead of obsolete
  indent-relative-maybe. Fix documentation of which argument from
  'indent-relative' is used.

Bug#34858
2019-04-05 19:48:21 -05:00
Basil L. Contovounesios
0e468a6204 Avoid using obsolete indent-relative-maybe
* lisp/electric.el (electric-indent-functions-without-reindent):
* lisp/indent.el (indent-according-to-mode): Check for
indent-relative-first-indent-point in addition to its obsolete alias
indent-relative-maybe.
* lisp/obsolete/vi.el (vi-com-map): Use
indent-relative-first-indent-point in place of its obsolete alias
indent-relative-maybe.
2019-04-03 17:55:40 +01:00
Paul Eggert
ba809612c0 Merge from origin/emacs-26
2fcf2df Fix copyright years by hand
26bed8b Update copyright year to 2019
2814292 Fix value of default frame height.  (Bug#33921)
2018-12-31 17:57:29 -08:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
Noam Postavsky
8217998b0d Preserve nonblank whitespace when indenting (Bug#32200)
* lisp/indent.el (indent-line-to): Remove only spaces and tabs, not
any whitespace syntax characters.
2018-07-22 10:52:48 -04:00
Noam Postavsky
c249e17324 * lisp/indent.el (indent-line-to): Fix dedenting of tabs. 2018-07-10 12:07:01 -04:00
Noam Postavsky
e4ad2d1a8f Respect field boundaries in indent-line-to (Bug#32014)
* lisp/indent.el (indent-line-to): Use the back-to-indentation point
as the end-point of whitespace removal, rather than
backward-to-indentation which doesn't respect field boundaries.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Don't expect to fail.
2018-07-09 20:08:13 -04:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Dmitry Gutov
b9fbc03b86 Widen in indent-for-tab-command in the normal case, too
Fixing this obvious omission.
* lisp/indent.el (indent--funcall-widened): New function.
(indent-for-tab-command): Use it.
2017-12-20 01:42:49 +02:00
Dmitry Gutov
7e9eef0ffd Consolidate 'widen' calls
* lisp/progmodes/prog-mode.el (prog-indentation-context):
Un-document all elements but the first.
(prog-widen): Remove.
(http://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00321.html)

* doc/lispref/text.texi (Mode-Specific Indent): Update.

* lisp/progmodes/ruby-mode.el (ruby-calculate-indent):
Don't call widen.

* lisp/progmodes/python.el
(python-indent-guess-indent-offset)
(python-info-current-defun): Replace prog-widen with widen;
these functions are not called during indentation.
(python-indent-context)
(python-indent--calculate-indentation)
(python-info-dedenter-opening-block-message)
(python-info-line-ends-backslash-p)
(python-info-beginning-of-backslash)
(python-info-continuation-line-p)
(python-info-current-defun): Remove 'widen' calls.

* lisp/indent.el (indent-according-to-mode)
(indent-for-tab-command, indent-region): Move them here.

* lisp/textmodes/mhtml-mode.el (mhtml-indent-line):
Bind prog-indentation-context to one-element list.
2017-12-14 11:18:51 +02:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Noam Postavsky
4635016869 Make `indent-line-to' respect field boundaries (Bug#26891)
* lisp/indent.el (indent-line-to): Use `back-to-indentation' instead
of `backward-to-indentation'.
2017-05-15 22:58:24 -04:00
Stefan Monnier
499780daef * lisp/indent.el (indent-region-line-by-line): New function.
Extracted from indent-region.
(indent-region, indent-region-function): Use it.
2017-01-30 13:06:07 -05:00
Paul Eggert
bcf244ef9b Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
2017-01-01 01:10:47 -08:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Alex
a9973a3c16 Extend 'indent-relative' when its arg is non-nil
* lisp/indent.el (indent-relative-maybe): New obsolete alias.
(indent-relative-first-indent-point): Renamed from
'indent-relative-maybe'.
(indent-relative): Now accepts an additional optional argument.
The first argument was renamed to FIRST-ONLY.  Doc fix.  Support
the additional arg.  (Bug#24766)
2016-11-18 11:02:55 +02:00
Noam Postavsky
9ae89c2c99 Don't delete selection after indent-rigidly
* lisp/indent.el (indent-rigidly): Pass `deactivate-mark' as the ON-EXIT
function to `set-transient-map', this prevents `delete-selection-mode'
from deleting the text that was just indented (Bug #20408).
2016-08-06 16:16:02 -04:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Paul Eggert
ac16149ba4 Fix docstring quoting problems with ‘ '’
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes.  The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.
2015-11-17 15:29:35 -08:00
Stefan Monnier
f54e5ccfdb * lisp/indent.el (indent--default-inside-comment): New function
(indent-for-tab-command): Use it for `noindent' indentation.
2015-10-06 22:56:24 -04:00
Stefan Monnier
14eea09858 * lisp/indent.el (indent-region): Don't deactivate the mark
Fixes: debbugs:20357
2015-04-17 10:30:50 -04:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Leo Liu
83d208a5dd Fix a few packages to work with nil tab-stop-list
* indent.el (indent-accumulate-tab-stops): New function.

* textmodes/picture.el (picture-set-tab-stops):
* ruler-mode.el (ruler-mode-mouse-add-tab-stop)
(ruler-mode-ruler): Fix to work with nil tab-stop-list.

* progmodes/asm-mode.el (asm-calculate-indentation): Use
indent-next-tab-stop.
2014-06-26 07:53:37 +08:00
Leo Liu
96559792e1 * align.el (align-adjust-col-for-rule): Unbreak due to defaulting
tab-stop-list to nil. 

* indent.el (indent-next-tab-stop): Rename from indent--next-tab-stop.
(indent-rigidly-left-to-tab-stop)
(indent-rigidly-right-to-tab-stop, tab-to-tab-stop)
(move-to-tab-stop): Change callers.

Fixes: debbugs:16381
2014-06-24 07:09:20 +08:00
Glenn Morris
34dc21db6e Replace "Maintainer: FSF" with the emacs-devel mailing address 2014-02-09 17:34:22 -08:00
Glenn Morris
e3bd7eed8c Some doc related to tab-stops
* doc/lispref/text.texi (Indent Tabs): Update related to tab-stops.

* lisp/indent.el (tab-stop-list): Doc fix.  Add :version.
2014-01-27 20:49:02 -05:00
Juri Linkov
3c5a4839a1 * lisp/indent.el (indent-line-to): Use backward-to-indentation
instead of back-to-indentation.

Fixes: debbugs:16461
2014-01-20 10:45:56 +02:00
Juri Linkov
ccc6b208d5 * lisp/indent.el (indent-rigidly): Set deactivate-mark to nil
in transient indentation mode.

Fixes: debbugs:16438
2014-01-15 10:22:41 +02:00
Stefan Monnier
6ae948d87e * lisp/indent.el (indent-according-to-mode): Flush to column 0 in text-mode
after an empty line.
2014-01-13 00:03:31 -05:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Chong Yidong
7510b0219c * indent.el (indent-rigidly): Use substitute-command-keys. 2013-12-23 12:07:01 +08:00
Chong Yidong
8cd22a0818 Rename set-temporary-overlay-map -> set-transient-map
* lisp/subr.el (set-transient-map): Rename from
set-temporary-overlay-map.  Doc fix.

* lisp/face-remap.el (text-scale-adjust):
* lisp/indent.el (indent-rigidly):
* lisp/kmacro.el (kmacro-call-macro):
* lisp/minibuffer.el (minibuffer-force-complete):
* lisp/repeat.el (repeat):
* lisp/simple.el (universal-argument--mode):
* lisp/calendar/todo-mode.el (todo-insert-item--next-param):
* lisp/progmodes/f90.el (f90-abbrev-start): Callers changed.

* lisp/org/org.el (orgstruct-make-binding): Call set-transient-map
instead of old name set-temporary-overlay-map.

* doc/lispref/keymaps.texi (Controlling Active Maps): Renamed
set-temporary-overlay-map to set-transient map.  Doc fixes.
(Searching Keymaps): The transient keymap takes precedence.
2013-12-23 11:59:10 +08:00
Chong Yidong
77221051a2 Tweak C-x TAB behavior changes, and update docs.
* lisp/indent.el (indent-rigidly-map): Add docstring, and move commands
into named functions.
(indent-rigidly-left, indent-rigidly-right)
(indent-rigidly-left-to-tab-stop)
(indent-rigidly-right-to-tab-stop): New functions.  Decide on
indentation direction based on bidi direction, and accumulate
sequential commands in a single undo boundary.
(indent-rigidly--pop-undo): New utility function.

* doc/emacs/indent.texi (Indentation Commands): Document C-x TAB changes.

* doc/lispref/text.texi (Region Indent): Note the new interactive
behavior of indent-rigidly.
2013-12-21 16:37:08 +08:00