Commit graph

3863 commits

Author SHA1 Message Date
Arash Esbati
1d3b7474c7 Improve LaTeX symbol prettification
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist):
Support macros which used to be part of textcomp package.
2022-03-17 11:44:15 +01:00
Stefan Monnier
7d9f9d4d8e doctex-mode: Try and fix bug#35140
* lisp/textmodes/tex-mode.el (doctex-syntax-propertize-rules):
Add support for the new ^^X and consider the first ^ of ^^A to be the
closing char for the previous comment.
(doctex-font-lock-^^A): Simplify accordingly.
2022-03-15 10:12:46 -04:00
Lars Ingebrigtsen
a185f2af96 Tweak how bibtex-mark-entry places point
* lisp/textmodes/bibtex.el (bibtex-mark-entry): Make `C-M-h'
behave like in other modes (with point at the beginning of the
region) (bug#4717).
2022-03-07 03:51:55 +01:00
Lars Ingebrigtsen
15a76160bb Don't throw errors while propertizing in sgml-mode
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Don't
throw an error when propertizing (bug#54195).
2022-02-28 10:30:31 +01:00
Stefan Kangas
f4ef44a5eb Merge from origin/emacs-28
5c77aed2d6 Mention flyspell-prog-mode in flyspell-mode doc string
2022-02-25 06:30:57 +01:00
Lars Ingebrigtsen
5c77aed2d6 Mention flyspell-prog-mode in flyspell-mode doc string
* lisp/textmodes/flyspell.el (flyspell-mode): Mention
flyspell-prog-mode (bug#54131).
2022-02-24 10:10:40 +01:00
Lars Ingebrigtsen
1f6b5ea54a Make 'ispell-change-dictionary' completion work better
* lisp/textmodes/ispell.el (ispell--aspell-found-dictionaries):
New variable (bug#24050).
(ispell-find-aspell-dictionaries): Save the list of actually
identified dictionary.
(ispell-valid-dictionary-list): Use it to filter out non-installed
dictionaries.
2022-02-21 17:01:13 +01:00
Eli Zaretskii
3306e11107 Merge from origin/emacs-28
1e4b04c Improve documentation of filling and justification commands
9fd396e * lisp/progmodes/subword.el (superword-mode): Doc fix.  (Bug#...
e303cb1 Fix indexing of module functions that return complex types.
2022-02-18 10:38:53 +02:00
Eli Zaretskii
1e4b04c540 Improve documentation of filling and justification commands
* doc/lispref/text.texi (Filling):
* lisp/textmodes/fill.el (fill-region-as-paragraph)
(default-justification, set-justification, justify-current-line):
Clarify "canonicalization" of spaces and the meaning of
justification styles.  (Bug#54047)
(set-justification-left, set-justification-right)
(set-justification-full): Improve wording of doc strings.
2022-02-18 09:47:44 +02:00
Stefan Monnier
d52c929e31 (with-demoted-errors): Warn on missing format arg
The `format` arg has been mandatory for a while, but the backward
compatibility code that handled the case of a missing `format` arg
made it hard to notice when using the old calling convention.

* lisp/subr.el (with-demoted-errors): Warn on missing `format` arg.

* lisp/emacs-lisp/smie.el (smie-indent--separator-outdent): Don't abuse
`with-demoted-errors`.
(smie-indent-line, smie-auto-fill):
* test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors):
* lisp/vc/vc-hooks.el (vc-refresh-state):
* lisp/vc/vc-annotate.el (vc-annotate-background-mode):
* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk):
* lisp/textmodes/reftex-toc.el (reftex-re-enlarge):
* lisp/progmodes/sh-script.el (sh-smie-sh-rules):
* lisp/progmodes/octave.el (inferior-octave-startup):
* lisp/pcmpl-gnu.el (pcmpl-gnu-make-all-targets):
* lisp/org/org-refile.el (org-refile):
* lisp/org/org-capture.el (org-capture-store-last-position):
* lisp/nxml/nxml-mode.el (nxml-mode):
* lisp/notifications.el (notifications-notify):
* lisp/gnus/mm-view.el (mm-display-inline-fontify):
* lisp/finder.el (finder-unload-function):
* lisp/files.el (safe-local-variable-p, backup-buffer-copy
* lisp/autorevert.el (auto-revert-notify-handler):
Pass `format` arg to `with-demoted-errors`.
2022-02-04 19:39:53 -05:00
Lars Ingebrigtsen
b9239954b6 Tweak href/superscript fix in tex-mode
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Fix
superscripts in href in a better way.
2022-01-27 16:30:12 +01:00
Stefan Kangas
a8862f313b Merge from origin/emacs-28
c9524819ea Partially revert a fill-region-as-paragraph regression
6075ea0b79 Fix 'make_lispy_position' when there's an image at EOB

# Conflicts:
#	test/lisp/textmodes/fill-tests.el
2022-01-27 09:45:49 +01:00
Lars Ingebrigtsen
c9524819ea Partially revert a fill-region-as-paragraph regression
* lisp/textmodes/fill.el (fill-region-as-paragraph): Revert
e186af261 (bug#53537), because it leads to regressions.  (But
leave tests in place.)
2022-01-26 16:20:05 +01:00
Lars Ingebrigtsen
5909b27144 Fix \href{a_b} in tex-mode
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-2): Fontify
href parameters like constants so that _ aren't fontified like
subscripts.
2022-01-24 15:19:38 +01:00
Lars Ingebrigtsen
8c37b9042e Revert "Fix tex-mode handling of _ chars in href{} commands"
This reverts commit 487a0be7f7.

This will be fixed a different way.
2022-01-24 15:15:59 +01:00
Lars Ingebrigtsen
487a0be7f7 Fix tex-mode handling of _ chars in href{} commands
* lisp/textmodes/tex-mode.el (tex--current-command): New function
(bug#23102).
(tex-font-lock-suscript): Don't subscript _ chars in href.
2022-01-24 12:39:02 +01:00
Lars Ingebrigtsen
07f32fa70a Put the old label into the future history in reftex-change-label
* lisp/textmodes/reftex-global.el (reftex-change-label): Put the
old label into the future history so that it can be edited easily
(bug#53417).
2022-01-22 13:14:43 +01:00
Arash Esbati
808917b3fc Remove matching of whitespaces in LaTeX environment names
* lisp/textmodes/ispell.el (ispell-tex-skip-alists): Don't match
arbitrary number of whitespaces in LaTeX environment names.
(bug#53390)
2022-01-20 19:20:34 +01:00
Juri Linkov
2b59a42583 * lisp/textmodes/paragraphs.el (repunctuate-sentences): Use filter variable.
(repunctuate-sentences-filter)<defun>:
Reimplement without using match data.
(repunctuate-sentences-filter)<defvar>: New variable.
(repunctuate-sentences): Use new variable.
Remove regexp group from spaces as was before.
https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg00395.html
2022-01-05 20:47:20 +02:00
Eli Zaretskii
823b6b8d26 ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Juri Linkov
fb4f2aa038 * lisp/textmodes/paragraphs.el (repunctuate-sentences-filter): New function.
(repunctuate-sentences): Use it on isearch-filter-predicate
to skip unnecessary matches.  (bug#52769)
2021-12-29 21:10:04 +02:00
Juri Linkov
3fc8032a1a * lisp/textmodes/sgml-mode.el (sgml-mode): Set skeleton-end-newline to nil.
Prevent skeleton.el from adding a newline to each inserted
skeleton.  Those which do want a newline do that explicitly in
their define-skeleton form.  This is what texinfo-mode does (bug#52864).
2021-12-29 20:52:11 +02:00
Sam Steingold
18b680cfd1 Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action'
* lisp/window.el (display-comint-buffer-action): New `defcustom`,
defaults to 'display-buffer-same-window' for backward compatibility.
* lisp/cmuscheme.el (run-scheme, switch-to-scheme): Pass
'display-comint-buffer-action' to 'pop-to-buffer' instead
of using 'pop-to-buffer-same-window'.
* lisp/eshell/eshell.el (eshell): Likewise.
* lisp/shell.el (shell): Likewise.
* lisp/org/ol-eshell.el (org-eshell-open): Likewise.
* lisp/progmodes/inf-lisp.el (inferior-lisp): Likewise.
* lisp/progmodes/project.el (project-shell, project-eshell): Likewise.
* lisp/textmodes/tex-mode.el (tex-display-shell, tex-compile-default)
(tex-recenter-output-buffer): Pass 'display-comint-buffer-action'
to 'pop-to-buffer'.
2021-12-28 17:28:49 -05:00
Juri Linkov
2033f950fa * lisp/textmodes/paragraphs.el (repunctuate-sentences): Region for NO-QUERY.
Use region boundaries also for the case when NO-QUERY arg is non-nil
(bug#52769).
2021-12-28 21:51:54 +02:00
Juri Linkov
af92c52669 * lisp/textmodes/paragraphs.el (repunctuate-sentences): Support region.
Add optional args 'start' and 'end', and pass them as region boundaries
to query-replace-regexp (bug#52769).
2021-12-28 21:19:25 +02:00
Stefan Kangas
c167009400 Make some variable aliases obsolete
* lisp/progmodes/make-mode.el (makefile-query-one-target-method):
* lisp/skeleton.el (skeleton-transformation, skeleton-filter):
* lisp/textmodes/artist.el (artist-text-renderer):
* lisp/textmodes/bibtex.el (bibtex-autokey-name-case-convert):
(bibtex-autokey-titleword-case-convert):
* lisp/textmodes/ispell.el (ispell-format-word):
* lisp/textmodes/sgml-mode.el (sgml-transformation):
* lisp/vc/add-log.el (change-log-time-zone-rule): Make variable
aliases obsolete.
2021-12-20 22:16:24 +01:00
Arash Esbati
5a057f6716 Recognize starred environments
* lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin): Add
missing starred environments from sidecap and rotating packages.
2021-12-15 12:10:05 +01:00
Lars Ingebrigtsen
af1c5ec0fc Fix bibtex-biblatex-entry-alist sorting when using latex
* lisp/textmodes/bibtex.el (bibtex-biblatex-entry-alist): Sort
PhdThesis and TechReport correctly when using the latex variant
(bug#52354).
2021-12-11 04:16:06 +01:00
Stefan Kangas
176c63287f Convert etc-authors-mode-map to defvar-keymap
* lisp/textmodes/etc-authors-mode.el (etc-authors-mode-map):
Convert to defvar-keymap.
2021-12-08 01:57:45 +01:00
Stefan Kangas
13556f32ba ; * lisp/textmodes/texinfo.el: Remove stale comment.
The referenced variable was removed two decades ago.
2021-12-08 01:48:11 +01:00
Lars Ingebrigtsen
08782d58db Fix pixel-fill--fill-line infloop for certain unbreakable lines
* lisp/textmodes/pixel-fill.el (pixel-fill--fill-line): Fix
infloops for certain line widths (bug#52271).
2021-12-04 20:38:22 +01:00
Eli Zaretskii
6927841ecb Fix recent changes related to 'glyphless-display-mode'
* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Fix
spelling of "bidirectional".
* lisp/international/characters.el (char-acronym-table): Fix
acronyms for LRI and RLI: use their accepted shorthands.
(glyphless-char-display-control): Fix spelling of doc string.

* doc/lispref/display.texi (Glyphless Chars): Fix spelling and add
a cross-reference.
2021-12-02 12:32:17 +02:00
Lars Ingebrigtsen
35075267a6 Add a bidi-control target for `glyphless-char-display-control'
* doc/lispref/display.texi (Glyphless Chars): Document bidi-control.

* lisp/international/characters.el (char-acronym-table): Add the
ISOLATE characters.
(update-glyphless-char-display): Implement bidi-control, and mark
all Cf characters we don't know about as UNK.
(glyphless--bidi-control-characters): New variable.
(glyphless-char-display-control): Add a new type -- bidi-control.

* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Add a
new type -- bidi-control.
2021-12-02 08:31:37 +01:00
Lars Ingebrigtsen
cbcf8a616e Fix table-fixed-width-mode when typing fast
* lisp/textmodes/table.el (table-with-cache-buffer): Use the value
of table-fixed-width-mode in the correct buffer (bug#26701).
2021-12-01 19:49:13 +01:00
Lars Ingebrigtsen
d086d4f91d Fix fencepost error in pixel-fill--fill-line
* lisp/textmodes/pixel-fill.el (pixel-fill--fill-line): Don't add
a newline (and continuation) if we're at the end of the line.
2021-12-01 17:34:07 +01:00
Lars Ingebrigtsen
6a60bd475d Add a new minor mode `glyphless-display-mode'
* doc/emacs/display.texi (Text Display): Mention it.

* doc/lispref/display.texi (Glyphless Chars): Document it.
* lisp/textmodes/glyphless-mode.el: New minor mode (bug#27544).
2021-12-01 16:53:00 +01:00
Lars Ingebrigtsen
6348ca1a88 Make pixel-fill-region handle space regions better
* lisp/textmodes/pixel-fill.el (pixel-fill-region): Preserve the
face on the replacement spaces.
2021-12-01 15:03:24 +01:00
Lars Ingebrigtsen
9d17e346fe Preserve newlines at the end of pixel-fill-region
* lisp/textmodes/pixel-fill.el (pixel-fill-region): Preserve
newlines at the end.
2021-12-01 14:41:42 +01:00
Eli Zaretskii
7433e74571 Improve documentation of pixel-fill
* doc/lispref/text.texi (Filling): Describe the arguments of
'pixel-fill-region'.  Add index entry.

* lisp/textmodes/pixel-fill.el (pixel-fill-region): Doc fix.
2021-11-30 20:07:19 +02:00
Lars Ingebrigtsen
10d371e4fa Document pixel-fill-region
* doc/lispref/text.texi (Filling): Document pixel-fill-region.

* lisp/textmodes/pixel-fill.el (pixel-fill-width): Add new helper
function.
2021-11-30 16:46:28 +01:00
Lars Ingebrigtsen
72b7fccc15 Add new package pixel-fill.el
* lisp/net/shr.el (shr-char-breakable-p, shr-char-nospace-p)
(shr-char-kinsoku-bol-p, shr-char-kinsoku-eol-p)
(shr-find-fill-point): Moved to pixel-fill.el and renamed.
(shr-pixel-region): Made obsolete.
(shr-fill-line): Use pixel-fill-region.

* lisp/textmodes/pixel-fill.el: New package.
2021-11-30 02:07:22 +01:00
Lars Ingebrigtsen
73cf27aa45 Make Re: recognition in ispell-message less ambiguous
* lisp/textmodes/ispell.el (ispell-message): Require a "Re" as a
word, not as a word ending (bug#52104).
2021-11-29 17:08:11 +01:00
Ikumi Keita
247ed6ccbc Make fill-region-as-paragraph clear the markers it creates
* lisp/textmodes/fill.el (fill-region-as-paragraph): Clear
temporary markers (bug#52175).

Copyright-paperwork-exempt: yes
2021-11-29 15:40:19 +01:00
Juri Linkov
44923722f4 * lisp/textmodes/flyspell.el: Pop up the menu under cursor from keyboard.
* lisp/textmodes/flyspell.el (flyspell-emacs-popup):
Use popup-menu-normalize-position with point when no mouse is involved,
instead of the incorrect use of mouse-position (bug#52025).
2021-11-22 21:07:08 +02:00
Stefan Kangas
4a3ba8528b Use substitute-command-keys for literal key sequences
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-help-for-help):
* lisp/calc/calc-mode.el (calc-auto-why):
* lisp/calc/calc.el (calc-do):
* lisp/calculator.el (calculator-mode):
* lisp/dired-aux.el (dired-create-files)
(dired-do-create-files-regexp, dired-create-files-non-directory):
* lisp/dired-x.el (dired-virtual):
* lisp/dired.el (dired-mark-region, dired-unmark-all-files):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/epa-ks.el (epa-ks--display-keys):
* lisp/erc/erc.el (erc-toggle-debug-irc-protocol):
* lisp/files.el (save-some-buffers):
* lisp/gnus/gnus-dired.el (gnus-dired-find-file-mailcap)
(gnus-dired-print):
* lisp/gnus/gnus-group.el (gnus-keep-same-level):
* lisp/gnus/gnus-score.el (gnus-score-find-trace):
* lisp/gnus/gnus.el (to-list):
* lisp/gnus/message.el (message--send-mail-maybe-partially):
* lisp/mail/supercite.el (sc-set-variable):
* lisp/minibuffer.el (minibuffer-inactive-mode):
* lisp/progmodes/etags.el (select-tags-table):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode)
(idlwave-shell-char-mode-loop):
* lisp/replace.el (query-replace-help):
* lisp/simple.el (set-variable):
* lisp/subr.el (read-char-from-minibuffer):
* lisp/textmodes/ispell.el (ispell-help, ispell-message):
* lisp/textmodes/reftex-global.el (reftex-find-duplicate-labels):
* lisp/textmodes/reftex-vars.el
(reftex-toc-include-file-boundaries)
(reftex-toc-include-labels, reftex-toc-include-index-entries)
(reftex-toc-include-context, reftex-toc-follow-mode)
(reftex-index-include-context, reftex-index-follow-mode)
(reftex-enable-partial-scans)
(reftex-auto-update-selection-buffers)
(reftex-highlight-selection):
* lisp/time.el (display-time-update):
* lisp/vc/ediff-help.el (ediff-help-for-quick-help):
* lisp/vc/ediff-init.el (ediff-keep-variants):
* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map)
(ediff-patch-file-internal):
* lisp/windmove.el (windmove-delete-default-keybindings): Use
'substitute-command-keys' for literal key sequences.

* lisp/userlock.el (userlock--fontify-key): Remove function.
(ask-user-about-lock, ask-user-about-lock-help)
(ask-user-about-supersession-threat)
(ask-user-about-supersession-help): Use 'substitute-command-keys' for
literal key sequences.

* lisp/ibuffer.el (ibuffer-unmark-all): Use 'substitute-command-keys'
for command.
2021-11-22 12:04:19 +01:00
Stefan Kangas
c6d5fccc92 Merge from origin/emacs-28
02853edba7 Fix sorting of menus in `context-menu-local' (bug#50067).
14271d050a Fix flyspell-correct-word selected from context menu opene...
bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound k...
6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like ...
5eeaf85767 Improve documentation of window hooks
7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
2021-11-19 07:00:24 +01:00
Juri Linkov
14271d050a Fix flyspell-correct-word selected from context menu opened with the keyboard
* lisp/mouse.el (context-menu-open): Call interactively a command
returned by `context-menu-map' such as `flyspell-correct-word' (bug#50067).

* lisp/textmodes/flyspell.el (flyspell-correct-word): Handle the
case when it's called by a key bound to `context-menu-open'.
Then it should work the same way as `C-c $' typed on misspelled word
where the arg `event' of `flyspell-correct-word-before-point' is nil.
2021-11-18 20:23:58 +02:00
Stefan Kangas
9e79575486 Remove some references to XEmacs
* lisp/emulation/viper-cmd.el (viper-start-R-mode):
* lisp/emulation/viper-init.el (viper-window-display-p):
* lisp/emulation/viper-mous.el (viper-surrounding-word):
* lisp/mail/footnote.el (footnote-mode):
* lisp/textmodes/reftex-index.el: Remove some comments referring to
XEmacs.
2021-11-17 06:25:50 +01:00