Commit graph

2076 commits

Author SHA1 Message Date
Stefan Monnier
977630b528 * lisp/subr.el (combine-change-calls-1): Fix bug#60467
Don't stop at timestamps.
Also Don't burp about breakage just because (cdr old-bul) is nil.
2023-01-13 17:41:37 -05:00
Stefan Monnier
59c3c53efa * lisp/subr.el (combine-change-calls-1): Fix bug#60467
Don't stop at timestamps.  Strip them for now, to be on the safe side.
Don't merge into `master` where we'll use a better fix.
2023-01-13 17:38:04 -05:00
Sean Whitton
083badc9c1 * lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758). 2023-01-12 17:09:01 -07:00
Stefan Kangas
e1b2446b2e Merge from origin/emacs-29
92f753dc19 ; * etc/NEWS: Fix wording in last change.
cef875f6c5 ; * etc/NEWS: Instructions for builds without tree-sitter...
8d530ca654 ; Fix documentation of y-or-n-p/yes-or-no-p
c18878ee0a Fix bug in Tramp multi-hop
7eed8e050a * lisp/files.el (find-sibling-rules): Fix docstring.
6b5831c696 Tree-sitter doc fixes (bug#60524)
651927ac39 ; Fix function reference in comment in c-ts-mode.el (bug#...
c786afcbb9 Fontify C++ function definitions in c-ts-mode (bug#60529)

# Conflicts:
#	etc/NEWS
2023-01-05 06:30:20 +01:00
Eli Zaretskii
8d530ca654 ; Fix documentation of y-or-n-p/yes-or-no-p
* lisp/subr.el (y-or-n-p):
* src/fns.c (Fyes_or_no_p): Doc fix.
2023-01-04 19:25:47 +02:00
Mattias Engdegård
0e1b03bbb8 Styled quotes in compiler warnings
* lisp/emacs-lisp/byte-run.el (byte-run--parse-body)
(byte-run--unescaped-character-literals-warning):
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment)
(byte-compile-form, bytecomp--warn-dodgy-eq-arg):
* lisp/emacs-lisp/cconv.el (cconv--warn-unused-msg):
* lisp/emacs-lisp/cl-macs.el (cl-defstruct):
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* lisp/emacs-lisp/eieio.el (defclass):
* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda)
(macroexp--expand-all):
* lisp/emacs-lisp/pcase.el (pcase--u1):
* lisp/subr.el (when, unless, ignore-error, lsh, sit-for)
(with-demoted-errors):
Use format-message to ensure properly styled quotes in compiler
warning messages.
2023-01-03 18:39:06 +01:00
Eli Zaretskii
3c55fbd4ad Merge from origin/emacs-29
cae528457c ; Add 2023 to copyright years.
b394359261 Improve documentation of 'isearch-open-overlay-temporary'
ab3210e709 Document 'use-package' in the 2 main manuals

# Conflicts:
#	etc/refcards/ru-refcard.tex
#	lib/explicit_bzero.c
#	m4/explicit_bzero.m4
2023-01-01 05:47:47 -05:00
Eli Zaretskii
861d3db634 Merge from origin/emacs-29
72a81e2022 ; * lisp/treesit.el (treesit-simple-indent-presets): Fix t...
ddfeee3e8a Build recipe interactively in treesit-install-language-gra...
6837469780 ; Add REVISION to treesit-language-source-alist
0dc788aa01 ; Remove GRAMMAR-DIR from treesit-language-source-alist
f9aef67c36 Tweak csharp-mode font-lock-settings (bug#60376)
46362c0a3a ; * doc/lispref/tips.texi (Documentation Tips): Add indexing.
9a386b682e Revert a recent change which causes errors
9871ee8b14 ; More fixes for documentation of 'defalias'
f309651b67 ; Fix handling of 'not' by 'buffer-match-p'
9292f595a7 ; Fix typos
43c7e05a2a Fix misspelled functions in shortdoc groups
01acecc79c Simplify introduction of use-package manual
2a7e072e53 ; Fix documentation of 'defalias'
eee2aeca25 Fix python-shell-buffer-substring when retrieving a single...
bfdad6c4e5 ; Fix recent treesit-related changes
2023-01-01 05:46:24 -05:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Eli Zaretskii
9a386b682e Revert a recent change which causes errors
* lisp/subr.el (buffer-match-p): Undo last change, as it causes an
error in a timer function of show-paren-mode.
2022-12-31 18:32:54 +02:00
Philip Kaludercic
f309651b67 ; Fix handling of 'not' by 'buffer-match-p'
* lisp/subr.el (buffer-match-p): Look up the cadr instead of the cdr
for the negation in 'not'.
* doc/lispref/buffers.texi (Buffer List): Update documentation.
(Bug#58951)
2022-12-31 15:05:56 +01:00
Mattias Engdegård
7c63b632e4 Add empty-body warning for when, unless etc
Warn about code like (when SOME-CONDITION) because these may indicate
bugs.  Warnings currently apply to `when`, `unless`, `ignore-error`,
`with-suppressed-warnings` and (as before) `let` and `let*`.

* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
Update doc string.
* lisp/emacs-lisp/bytecomp.el: (byte-compile-warning-types)
(byte-compile-warnings): Add empty-body.
(byte-compile-initial-macro-environment):
Add empty-body warning for with-suppressed-warnings.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Use the empty-body category for let and let*.
* lisp/subr.el (when, unless, ignore-error): Add empty-body warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test cases.
2022-12-29 13:01:47 +01:00
Mattias Engdegård
1480865e64 Warn about ignore-error with quoted condition argument
* lisp/subr.el (ignore-error):
Clarify condition argument in doc string and add warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-warn-quoted-condition): New test.
2022-12-29 12:24:15 +01:00
Mattias Engdegård
1a88a28ace * lisp/subr.el (with-demoted-errors): Better message and location. 2022-12-29 11:03:03 +01:00
Stefan Kangas
dce6791e99 Merge from origin/emacs-29
db96b1282f * lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' wind...
489865c21e ; Improve markup of long key sequences
d42c2668cf ; * etc/NEWS: Fix wording of a recently edited entry.
7a0eaee198 * lisp/isearch.el: Small fixes.
b69bffeec0 * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace ...
9263847ab7 ; * etc/NEWS: Move the paragraph with 'C-u RET' closer to...
62fb2dc37d * doc/emacs/display.texi (Text Scale): Improve section ab...
70480d3b6b * lisp/repeat.el (repeat-echo-function): Suggest 'add-fun...
fd48201ffe * lisp/tab-line.el (tab-line-cache-key-default): More cac...
b164660260 * etc/package-keyring.gpg: Update with new key
c0be51389e ; Yet another declare-function to avoid treesit-related w...
8676bec51d ; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; w...
2ddc480f44 Warn of absent networks module in ERC
19d00fab9a Avoid "already compiled" warning in erc-compat
2d8f7b66bc ; Fix one more treesit byte-compilation warning.
2d0a921486 ; Avoid treesit-related byte-compiler warnings
8503b370be (python--treesit-settings): Remove duplicate matcher
b464e6c490 Make last change of w32 GUI dialogs conditional and rever...
eedc9d79ae Fix tree-sitter typos
248c13dcfe Update tree-sitter major modes to use the new Imenu facility
b39dc7ab27 Add tree-sitter helper functions for Imenu
ba1ddea9da Fix treesit--things-around (bug#60355)
7512b9025a ; * lisp/treesit.el (treesit-traverse-parent): Remove alias.
5326b04198 Improve treesit-node-top-level and treesit-parent-until
637f5b164f ; Add "src" to the heuristic sub-directory heuristic
8ab6df0c9f ; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' u...
2b55a48d3e * src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL ...
8b8b791567 ; Improve documentation of TAB/SPC indentation
624e382211 ; Improve doc strings of some new faces
41f12e1019 ; * lisp/elide-head.el (elide-head): Doc fix to silence c...
e3b4cd0ac1 ; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace.
1b4dc4691c Fix htmlfontify.el command injection vulnerability.
1fe4b98b4d Improve support for Scheme R6RS and R7RS libraries (bug#5...
2347f37f67 ; * test/src/treesit-tests.el: remove dead store (bytecom...
a6d961ae2f Add a new tree-sitter query predicate 'pred'
835a80dcc4 ; Fix tree-sitter defun tests
a14821d615 Improve gnutls-min-prime-bits docstring
b14bbd108e Improve handling of tab-bar height.
669160d47b ; * nt/INSTALL.W64: More fixes and updates.
26b2ec7cb8 Simplify last change (bug#60311)
082fc6e308 Fix 'json-available-p' on MS-Windows
6c86faec29 loaddefs-gen: Group results by absolute file name
d90d7d15f2 ; Fix vindexes in parsing.texi
eb26872837 Fix imenu for c-ts-mode (bug#60296)
8f68b6497e Clean up python-ts-mode font-lock features
28f26b11a1 Add comment indent and filling to other tree-sitter major...
c6b0282645 ; Remove unused function in c-ts-mode
6e52a9fcad ; * doc/lispref/modes.texi (Parser-based Font Lock): Mino...
2bcd1e9a99 ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice.
7c7950fe00 Add maintainer stub for tree-sitter files
cf32776622 ; * doc/lispref/parsing.texi (Using Parser): Remove delet...

# Conflicts:
#	etc/NEWS
#	lisp/progmodes/c-ts-mode.el
#	lisp/progmodes/typescript-ts-mode.el
#	lisp/treesit.el
2022-12-28 21:40:59 +01:00
Eli Zaretskii
26b2ec7cb8 Simplify last change (bug#60311)
* src/json.c (json_available_p): Use original code.  Always return
true for !WINDOWSNT.
(ensure_json_available): Now defined only on WINDOWSNT.
(Fjson_serialize, Fjson_insert, Fjson_parse_string)
(Fjson_parse_buffer): Call ensure_json_available only on
WINDOWSNT.

* lisp/subr.el (json-available-p): Simplify.
2022-12-26 15:26:48 +02:00
Mattias Engdegård
082fc6e308 Fix 'json-available-p' on MS-Windows
* src/json.c (json_available_p, ensure_json_available)
(Fjson__available_p): New functions.
(Fjson_serialize, Fjson_insert, Fjson_parse_string)
(Fjson_parse_buffer): Use ensure_json_available.
(syms_of_json): Defsubr json--available-p.

* lisp/subr.el (json-available-p): Rewrite.
2022-12-26 15:12:04 +02:00
Stefan Kangas
8fcedd81ab Merge from origin/emacs-29
9a3b08061f Fix ruby-mode.el local command injection vulnerability (b...
4b44a395b3 ; * etc/NEWS: Fix typos.
458e175270 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
eccb813a94 Fix "C-h k" in recursive minibuffers
6dda2106ec ; Improve documentation of "C-x @"
a0738e8ad1 ; * etc/NEWS: Announce the new behavior of 'C-h f'.  (Bug...
86b11981b0 Update Tramp version (don't merge with master)

# Conflicts:
#	etc/NEWS
2022-12-24 06:30:29 +01:00
Eli Zaretskii
eccb813a94 Fix "C-h k" in recursive minibuffers
* lisp/subr.el (event--posn-at-point): Leave POSN alone if it
doesn't have at least 6 members.  This follows more faithfully
what 'event-start' and 'event-end' did before they started using
this function, see commit c1cead89f5.  Call posn-at-point with
the minibuffer-window when in the minibuffer.  (Bug#60252)
2022-12-23 16:41:08 +02:00
Mattias Engdegård
03e75b0f5f called-interactively-p: cut broken comparison
* lisp/subr.el (called-interactively-p): Remove attempt to detect
`byte-code` frames; it wasn't done right but also does not seem
to be necessary.  Adjust comment that was out of date.
2022-12-19 17:42:33 +01:00
Eli Zaretskii
d65beb820c ; Revert "; * lisp/subr.el (internal--with-narrowing): Simplify"
This reverts commit d9add66161.

Please install on the release branch only changes that fix
incorrect behavior.  Cleanups don't belong here.
2022-12-17 09:49:43 +02:00
Philip Kaludercic
d9add66161 ; * lisp/subr.el (internal--with-narrowing): Simplify
(Bug#60130)
2022-12-17 00:41:14 +01:00
Eli Zaretskii
f93a5180a6 Update the documentation of overlays (bug#59996)
* src/buffer.c (Foverlay_recenter, Foverlay_lists): Update the doc
strings.

* lisp/subr.el (copy-overlay): Update comment.

* doc/lispref/internals.texi (Buffer Internals): Remove buffer
fields relevant to the old implementation; add the new interval
tree field.
* doc/lispref/display.texi (Overlays, Managing Overlays): Update
text to be consistent with the new implementation of overlays.
(Managing Overlays): Remove documentation of 'overlay-recenter'.

* etc/NEWS: Mention incompatible aspects of overlay
reimplementation.
2022-12-14 20:13:47 +02:00
Eli Zaretskii
2c4d92d30f ; * lisp/subr.el (posn-col-row): Revert inadvertent change. 2022-12-03 22:09:16 +02:00
Eli Zaretskii
afa4fcb95b Fix "C-h k" when clicking on another frame
* lisp/help.el (help--analyze-key): Don't barf if the key sequence
includes a switch-frame event.  (Bug#59785)
2022-12-03 21:43:36 +02:00
Stefan Kangas
a0dd9fdebe ; Add cross-reference to string-equal docstring
* lisp/subr.el (string-equal-ignore-case):
* src/fns.c (Fstring_equal): Doc fix; add cross-references.
2022-12-03 11:32:23 +01:00
Eli Zaretskii
54633fcd76 ; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#59779). 2022-12-02 19:08:08 +02:00
Gregory Heytings
849223fba1 Merge branch 'feature/improved-locked-narrowing' 2022-11-27 22:19:41 +01:00
Gregory Heytings
321d4e6155 Minor improvements for locked narrowing
* src/editfns.c (narrowing_lock_pop): Clarify comment, replace
assertion by return.
(narrowing_locks_restore): Add comments.

* lisp/subr.el (with-narrowing, internal--with-narrowing):
Simplify, use a single helper function with an optional argument.
2022-11-26 23:38:40 +01:00
Eli Zaretskii
b84408647c Improve documentation of some posn-* functions
* lisp/subr.el (posn-object-x-y): Doc fix.

* doc/lispref/commands.texi (Click Events): More accurate
documentation of what are DX and DY in POSITION.
2022-11-26 13:56:30 +02:00
Gregory Heytings
16b8b0d1e0 Save and restore narrowing locks in 'save-restriction'.
* src/editfns.c: (Fsave_restriction): Save and restore narrowing
locks.  Suggested by Stefan Monnier.
(narrowing_locks_save, narrowing_locks_restore): Helper functions.

* lisp/subr.el (with-narrowing-1): Simplify.
2022-11-26 01:33:07 +01:00
Gregory Heytings
a246524039 Generic 'with-narrowing' macro.
* lisp/subr.el (with-narrowing): New generic macro, replacing the
'with-locked-narrowing' one.  Suggested by Stefan Monnier.
(with-narrowing-1, with-narrowing-2): Helper functions.
2022-11-25 22:44:14 +01:00
Gregory Heytings
9dee6df39c Reworked locked narrowing.
* src/editfns.c: (narrowing_locks): New alist to hold the narrowing
locks and their buffers.
(narrowing_lock_get_bound, narrowing_lock_peek_tag)
(narrowing_lock_push, narrowing_lock_pop): New functions to access
and update 'narrowing_locks'.
(reset_outermost_narrowings, unwind_reset_outermost_narrowing):
Functions moved from src/xdisp.c, and rewritten with the above
functions.
(Fwiden): Use the above functions. Update docstring.
(Fnarrow_to_region, Fnarrowing_lock, Fnarrowing_unlock): Use the above
functions.
(syms_of_editfns): Remove the 'narrowing-locks' variable.

* src/lisp.h: Make 'reset_outermost_narrowings' externally visible.

* src/xdisp.c (reset_outermost_narrowings)
unwind_reset_outermost_narrowing): Functions moved to src/editfns.c.

* lisp/subr.el (with-locked-narrowing): Improved macro, with a helper
function.
2022-11-25 18:51:39 +01:00
Gregory Heytings
ba9315b164 Merge master into feature/improved-locked-narrowing. 2022-11-24 14:21:30 +01:00
Stefan Kangas
16318bfb51 ; Fix typos 2022-11-20 12:59:39 +01:00
Stefan Kangas
f7ee6609ae ; Fix typos (prefer US spelling) 2022-11-18 13:06:55 +01:00
Juanma Barranquero
d2ba4538cb ; * lisp/subr.el (match-buffers): Fix typo 2022-11-15 23:07:55 +01:00
Eli Zaretskii
23868658a2 ; * lisp/subr.el (setq-local): Fix last doc change. 2022-11-04 09:49:48 +02:00
Juanma Barranquero
116f69d741 ; * lisp/subr.el (setq-local): Doc fix. 2022-11-04 07:05:51 +01:00
Gregory Heytings
aef803d6c3 Merge master into feature/improved-locked-narrowing. 2022-10-30 17:00:35 +01:00
Eli Zaretskii
d53febbd21 ; * lisp/subr.el (keyboard-translate): Doc fix. (Bug#58805) 2022-10-27 19:57:33 +03:00
Stefan Kangas
db2ed9f333 ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
Stefan Monnier
155ddde4dd (sit-for): Add compiler-macro to warn about obsolete calling convention
* lisp/subr.el (sit-for): Add compiler-macro.
* lisp/eshell/esh-util.el (eshell-redisplay):
* lisp/play/zone.el (zone, zone-pgm-jitter, zone-pgm-whack-chars):
(zone-remove-text): Avoid obsolete calling convention.
2022-10-18 18:43:50 -04:00
Stefan Monnier
13d6e8fa54 cl-generic: Fix advertised-calling-convention declarations
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method):
Preserve the `advertised-calling-convention`, if any (bug#58563).

* lisp/subr.el (declare): Warn when we hit this.

* lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun.
* lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string):
* lisp/help-fns.el (help-fns--signature):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun.
(cl-generic-tests--advertised-calling-convention-bug58563): New test.
2022-10-16 12:01:47 -04:00
Stefan Monnier
d6831d1b0a subr.el (inhibit-point-motion-hooks): Mark it as obsolete
When Emacs-25 changed the default of `inhibit-point-motion-hooks` to t,
/etc/NEWS declared it as obsolete and so did its docstring, but
it was not marked as obsolete so as not to emit too many warnings
in code where it was impractical to remove the let-binding while
keeping backward compatibility with older Emacsen.
Those backward compatibility issues are not serious any more now that
Emacs-25 is itself considered old.

* lisp/subr.el (inhibit-point-motion-hooks): Mark it as obsolete.
* src/textprop.c (inhibit-point-motion-hooks): Don't mention it being
obsolete in the docstring any more.
* lisp/simple.el (line-move-1, line-move-finish): Silence warnings.
2022-10-07 14:15:40 -04:00
Stefan Kangas
a36ecc408a * lisp/subr.el (y-or-n-p): Use substitute-command-keys. 2022-10-04 17:39:28 +02:00
Lars Ingebrigtsen
f97993ee66 Rename to inhibit-automatic-native-compilation
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Lars Ingebrigtsen
5fec9182db Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.

* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.

* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.

* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.

* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.

* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Lars Ingebrigtsen
0e72d4793c Tweak while-let definition
* lisp/subr.el (while-let): Use if-let* since we don't need/want
the backwards compat of if-let.
2022-09-29 12:29:36 +02:00
Lars Ingebrigtsen
12f63c18f6 Add new macro 'while-let'
* doc/lispref/control.texi (Conditionals): Document
when-let/if-let/while-let.
* lisp/subr.el (while-let): New macro.
2022-09-28 13:19:08 +02:00