1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00
Commit graph

160105 commits

Author SHA1 Message Date
Stefan Monnier
ea8daec9bb itree.[ch]: Add sanity checks, comments, and minor tweaks
* src/alloc.c (mark_overlay): Add sanity check.

* src/buffer.c (next_overlay_change, previous_overlay_change):
Tweak code to keep the same vars for the bounds.

* src/itree.c (interval_tree_clear, interval_tree_insert)
(interval_tree_remove, interval_tree_insert_fix, interval_tree_remove_fix):
Adjust to the `color` -> `red` change.
(interval_tree_clear): Prefer `true/false` for booleans.
(interval_generator_create): Use an actual `interval_tree_order` value
rather than 0.
(interval_generator_next): Simplify a tiny bit.  Add comment.
(interval_generator_narrow): Add sanity check.

* src/itree.h (struct interval_node): Replace `color` field with
boolean `red` field.
(enum interval_tree_order): Remove unused `ITREE_DEFLT_ORDER` value.

* src/pdumper.c (dump_interval_node): Adjust to the
`color` -> `red` change.
2022-09-28 19:05:16 -04:00
Stefan Monnier
800ecd4767 Merge remote-tracking branch 'origin/scratch/noverlay-wip' into noverlay 2022-09-28 11:57:16 -04:00
Gerd Möllmann
17ba7ac5d9 Avoid nested iteration over intervals (bug#58144)
* src/xdisp.c (strings_with_newlines): Call
buffer_overlay_iter_finish.
2022-09-28 16:38:04 +02:00
Gerd Möllmann
498d331b07 Add debugging help for nested iterators (nug#58144)
When starting an iteration, store __FILE__ and __LINE__ where this
happens in the interval_tree structure.

* src/buffer.h (buffer_overlay_iter_start): New macro adding __FILE
and __LINE__.
(buffer_overlay_iter_start1): Renamed from ..._start.
* src/itree.h (struct interval_tree): Add file and line info.
* src/itree.c: (interval_tree_contains, interval_tree_nodes,
interval_tree_insert_gap): Pass __FILE__ and __LINE__ to iter_start.
(interval_tree_iter_start): Record file and line info in tree.
2022-09-28 16:30:34 +02:00
Gerd Möllmann
8173a292e7 Fix last change 2022-09-28 12:10:30 +02:00
Gerd Möllmann
409327ff68 Fix macOS build (bug#58108)
* src/itree.h (struct interval_tree): Rename member nil to null.
* src/itree.c: Use null instead of nil
* src/pdumper.c (dump_buffer): Use null instead of nil.
* src/itree.c: Fix copyright.
* src/itree.h: Fix copyright.
2022-09-27 12:55:49 +02:00
Stefan Monnier
1a77f09f3c * src/buffer.c (overlays_in): Fix confusion Z-vs-ZV
This fixes test failures in `test-overlays-in-2` and `test-remove-overlays`.
2022-09-25 22:24:35 -04:00
Stefan Monnier
650c20f1ca Merge 'master' into noverlay 2022-09-25 16:15:16 -04:00
Stefan Monnier
4b85ae6a24 Merge remote-tracking branch 'refs/remotes/origin/master' 2022-09-24 11:09:25 -04:00
kobarity
2084f4ada3 hideshow.el: Improve hs-toggle-hiding behavior
* lisp/progmodes/hideshow.el
(hs-find-block-beginning-match): New function to be used in
`hs-already-hidden-p'.
(hs-already-hidden-p): Add check if beginning of line is inside a
block.
(hs-toggle-hiding): Don't change to selected-window's buffer when
event arg is absent.

* test/lisp/progmodes/hideshow-tests.el
(hideshow-tests-with-temp-buffer-selected): New helper macro.
(hideshow-tests-make-event-at): New helper function.
(hideshow-already-hidden-p-1): New test.
(hideshow-toggle-hiding-1): New test.
(hideshow-mouse-toggle-hiding-1): New test (bug#52092).
2022-09-24 11:08:29 -04:00
Lars Ingebrigtsen
0df73dabc1 Regenerated ldefs-boot.el 2022-09-24 16:51:53 +02:00
Lars Ingebrigtsen
b7fb82bc41 Remove "manual" package--builtin-versions updates
* lisp/emacs-lisp/nadvice.el:
* lisp/emacs-lisp/cl-generic.el: Don't push to
package--builtin-versions "manually", because loaddefs-gen does
this correctly now.
2022-09-24 16:51:53 +02:00
Brian Cully
152c7322c1 * lisp/net/tramp-docker.el: New file. 2022-09-24 16:48:01 +02:00
Stefan Monnier
c1cead89f5 (event-start/end): Fix part of bug#52092
When synthesizing a posn for keyboard events, make sure the `posn-point`
i the same as `point`.

* lisp/subr.el (event--posn-at-point): New function.
(event-start, event-end): Use it.
2022-09-24 10:38:09 -04:00
Stefan Monnier
0cc107ac09 Merge branch 'emacs-28' 2022-09-24 10:32:39 -04:00
Stefan Monnier
583ebfa414 * lisp/progmodes/hideshow.el (hs-toggle-hiding): Fix interactive form
This fixes the first part of bug#52092, which is a regression
introduced by commit d0e9113de9.
2022-09-24 10:24:54 -04:00
Lars Ingebrigtsen
2bacd9115f Make dired-do-rename refuse to rename . and ..
* lisp/dired-aux.el (dired-do-rename): Refuse to rename . and ..
(bug#52004).  This used to error out after renaming.
2022-09-24 15:27:50 +02:00
Lars Ingebrigtsen
8dacd8cd91 Add a new command vc-pull-and-push
* lisp/vc/vc-svn.el (vc-exec-after):
* lisp/vc/vc-hg.el (vc-exec-after):
* lisp/vc/vc-git.el (vc-exec-after):
* lisp/vc/vc-cvs.el (vc-exec-after):
* lisp/vc/vc-bzr.el (vc-exec-after):
* lisp/org/org-macro.el (vc-exec-after):
* lisp/obsolete/vc-mtn.el (vc-exec-after):
* lisp/obsolete/vc-arch.el (vc-exec-after): Update declaration.
* lisp/vc/vc-dispatcher.el (vc--process-sentinel): Allow running
code only on success.
(vc-exec-after): Ditto.
(vc--inhibit-change-window-start): New variable.
(vc-do-async-command): Use it to allow chaining commands without
moving window point.  Return the process instead of the buffer,
since the process may have exited already, and then we can't get
at the process.

* lisp/vc/vc-git.el (vc-git--pushpull): Return the process object.
(vc-git-pull-and-push): New function.

* lisp/vc/vc.el (vc-pull-and-push): New command (bug#51964).
2022-09-24 15:19:03 +02:00
Lars Ingebrigtsen
3ce322efef Tweak binding of `+' in vc-dir
* lisp/vc/vc-dir.el (vc-dir-mode-map): Point to the actual
function instead of the alias.  This makes *Help* more helpful.
2022-09-24 15:19:03 +02:00
Alan Mackenzie
e4b1445f43 CC Mode. Make AWK Mode work with electric-pair-mode
Also fix some minor anomalies with other CC Mode modes in electric-pair-mode.
This fixes bug #53446.

* lisp/progmodes/cc-mode.el (c-open-string-opener): New buffer local
variable.
(c-after-change-mark-abnormal-strings): Set c-open-string-opener when an
unbalanced string is detected.
(c-before-change): Initilize c-open-string-opener to nil, each buffer change.
(c-electric-pair-inhibit-predicate): Use the value of c-open-string-opener to
flag an unbalaced string rather than trying to calculate it again.

* lisp/progmodes/cc-awk.el (c-awk-syntax-tablify-string): Set
c-open-string-opener when an unbalanced string is detected.
2022-09-24 12:23:32 +00:00
Visuwesh
1556b43764 docview: Use svg images when using mupdf for conversion
* lisp/doc-view.el (doc-view-mupdf-use-svg, doc-view-svg-background)
(doc-view-svg-foreground): New user options.
(doc-view-insert-image): Add :background and :foreground image
attributes when display svg images.
(doc-view-set-up-single-converter): Produce svg images when using
mupdf (bug#58041).
2022-09-24 14:10:24 +02:00
Stefan Kangas
5be35812ac image-dired: Prefer command remapping
* lisp/image/image-dired.el (image-dired-thumbnail-mode-map):
Prefer command remapping to binding keys directly.
2022-09-24 14:07:57 +02:00
Stefan Kangas
0bca1b4d03 image-dired: Fix C-a/C-e in thumbnail buffer
* lisp/image/image-dired.el
(image-dired--movement-ensure-point-pos): New function, and...
(image-dired--movement-command): ...new macros broken out from...
(image-dired-next-line, image-dired-previous-line)
(image-dired-beginning-of-buffer, image-dired-end-of-buffer):
...here.
(image-dired-move-beginning-of-line)
(image-dired-move-end-of-line): New commands.
(image-dired-thumbnail-mode-map): Remap 'move-beginning-of-line'
and 'move-beginning-of-line' to above new commands.
2022-09-24 14:07:57 +02:00
Stefan Kangas
32e736d903 Make thumbs.el obsolete
* lisp/obsolete/thumbs.el: Add Obsolete-since.
* etc/NEWS: Announce obsoletion of thumbs.el.  (Bug#57779)
2022-09-24 14:07:57 +02:00
Stefan Kangas
4b537dd99f Move thumbs.el to lisp/obsolete
* lisp/thumbs.el:
* test/lisp/thumbs-tests.el: Move from here...
* lisp/obsolete/thumbs.el:
* test/lisp/obsolete/thumbs-tests.el: ...to here.  (Bug#57779)
2022-09-24 14:07:57 +02:00
Stefan Kangas
95d4f5d691 image-dired: Regenerate old thumbnails when needed
* lisp/image/image-dired.el
(image-dired--get-create-thumbnail-file): Rename from
'image-dired-get-thumbnail-image'.  Update callers and make old
name into an obsolete alias.
(image-dired-display-thumbs): Use above function to simplify and
regenerate the thumbnail if it's outdated.
2022-09-24 14:07:57 +02:00
Stefan Kangas
16681ba91c image-dired: Improve performance of marking commands
* lisp/image/image-dired.el (image-dired-thumbnail-storage): Mark
(image-dired--thumb-update-mark-at-point): New function.
(image-dired--thumb-update-marks):
(image-dired--do-mark-command):  Use it.
(image-dired--thumb-update-marks): Rename from
'image-dired-thumb-update-marks'.  Update all callers and make the
old name into an obsolete alias.
2022-09-24 14:07:57 +02:00
Stefan Kangas
3d75bab0e5 image-dired: Mark 'per-directory' as :safe
* lisp/image/image-dired.el (image-dired-thumbnail-storage): Mark
'per-directory' value as :safe.
2022-09-24 14:07:57 +02:00
Stefan Kangas
61b877237b Add new macro image-dired--with-dired-buffer
* lisp/image/image-dired-util.el
(image-dired--with-dired-buffer): New macro.
* lisp/image/image-dired.el (image-dired-track-original-file)
(image-dired--on-file-in-dired-buffer)
(image-dired--do-mark-command)
(image-dired--on-file-in-dired-buffer)
(image-dired-jump-original-dired-buffer)
(image-dired-thumb-file-marked-p, image-dired-delete-marked):
Use above new macro to simplify and improve error handling.
(image-dired-show-all-from-dir): Simplify removing Dired marks.
(image-dired-thumb-update-marks): Avoid triggering above new error
handling.
2022-09-24 14:07:57 +02:00
Lars Ingebrigtsen
06de788529 Tweak how :override advice is formatted in *Help*
* lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Format
:overrides specially (bug#57974).
(advice--make-docstring): Put overrides at the front.
2022-09-24 14:06:26 +02:00
Lars Ingebrigtsen
bbd7059da4 Rename file-name-directory
* lisp/emacs-lisp/shortdoc.el (file-name):
* doc/lispref/files.texi (Directory Names): Adjust.
* lisp/files.el (file-name-parent-directory): Rename from
`file-name-directory' (bug#58039).
2022-09-24 12:44:44 +02:00
Lars Ingebrigtsen
6403ede201 Ensure that cus-load doesn't add things twice
* lisp/cus-dep.el (custom-make-dependencies): Use it.

* lisp/custom.el (custom--add-custom-loads): New function.
2022-09-24 12:15:58 +02:00
Lars Ingebrigtsen
126d5b23cf `append' doc string clarification
* src/fns.c (Fappend): Clarify whether arguments are copied.
2022-09-24 11:43:04 +02:00
Lars Ingebrigtsen
90d2813f42 Clarify message-newline-and-reformat doc string
* lisp/gnus/message.el (message-newline-and-reformat): Clarify the
DWIM-ness in the doc string (bug#57986).
2022-09-24 11:39:53 +02:00
Stefan Kangas
7b1c0c3442 ; * lisp/image/image-dired.el: Improve sectioning. 2022-09-24 11:26:06 +02:00
Stefan Kangas
143f23e8c0 ; Make 'M-x image-dired' prompt even clearer
* lisp/image/image-dired.el (image-dired-show-all-from-dir):
Make prompt even clearer.
Suggested by Eli Zaretskii <eliz@gnu.org>.
2022-09-24 11:26:06 +02:00
Stefan Kangas
09711d396a Improve image-dired-thumbnail-display-external
* lisp/image/image-dired.el: (image-dired-external-viewer): Add more
image viewers and slightly re-arrange.
(image-dired-thumbnail-display-external): Correctly handle
external viewers with spaces or flags.
2022-09-24 11:26:06 +02:00
Stefan Kangas
8a224e5124 * lisp/emacs-lisp/shortdoc.el (file-name): Improve examples. 2022-09-24 11:26:06 +02:00
Stefan Kangas
7bac1d0b60 image-dired: Use command substitution for tags bindings
* lisp/image/image-dired-tags.el
(image-dired-dired-edit-comment-and-tags): Use substitute-command-keys
2022-09-24 11:26:06 +02:00
Stefan Kangas
b74ee91122 image-dired: Various code clean ups
* lisp/image/image-dired.el
(image-dired--display-thumb-properties-fun): Delete function.
(image-dired-forward-image): Immediately update header line.  Improve
docstring.
(image-dired-backward-image, image-dired-next-line)
(image-dired-previous-line, image-dired-beginning-of-buffer)
(image-dired-end-of-buffer, image-dired-display-image): Improve
docstring.
(image-dired-comment-thumbnail): Fix interactive declaration.
2022-09-24 11:26:06 +02:00
Po Lu
54876bf498 Reduce complexity of scroll bar window protection code
It turns out my previous theories of why ClientMessages were
generated were wrong, and they are just generated so we can set
finish to X_EVENT_GOTO_OUT to have them delivered immediately.

This allows for the code to be simplified greatly, by not
unpacking pointers to the raw window into the client messages.

* src/xterm.c (x_unprotect_window_for_callback): Return the
window removed from the queue, or nil if none.
(x_scroll_bar_to_input_event)
(x_horizontal_scroll_bar_to_input_event): Use window provided by
x_unprotect_window_for_callback.
(handle_one_xevent): Pass dpyinfo to functions that need it.
(x_free_frame_resources): Remove "first scroll bar request"
code.

* src/xterm.h (struct x_display_info): Likewise.
2022-09-24 16:30:37 +08:00
Augusto Stoffel
767a10cc63
New Flymake backend using the shellcheck program
See bug#57884.

* lisp/progmodes/sh-script.el: Require let-alist and subr-x when
compiling.
(sh--json-read): Helper function to deal with possible absence of
json-parse-buffer.
(sh-shellcheck-program, sh--shellcheck-process,
sh-shellcheck-flymake): Variables and function defining a Flymake
backend.
(sh-mode): Add it to 'flymake-diagnostic-functions'.
2022-09-24 09:59:51 +02:00
Eli Zaretskii
597c59078e ; * src/keyboard.c (Fposn_at_point): Doc fix. (Bug#52092) 2022-09-24 09:22:45 +03:00
Sean Whitton
77fb8a1612 vc-git--pushpull: Restore handling of vc-git-program
* lisp/vc/vc-git.el (vc-git--pushpull): Restore handling of
vc-git-program before recent change: respect a buffer-local value of
vc-git-program, and don't ignore user edits to the git program name
when PROMPT.
2022-09-23 14:55:02 -07:00
Stefan Monnier
40bc027bf4 * lisp/emacs-lisp/eieio.el (defclass): Fix bug#51068
Accept (defclass <class> <superclasses> (.. <slotname> ..)) without
having to wrap the slot name within parentheses.
2022-09-23 17:42:55 -04:00
Stefan Kangas
759d1145e2 image-dired: Rewrite and extend slideshow feature
* lisp/image/image-dired.el
(image-dired--slideshow-start-timer)
(image-dired--slideshow-stop-timer)
(image-dired--slideshow-show-message): New functions.
(image-dired--slideshow-current-delay): New variable.
(image-dired--slideshow-initial): Delete variable.
(image-dired-slideshow-start): Simplify and ensure we display the
image at start.
* lisp/image/image-dired.el (image-dired--slideshow-stop): Add support
for pausing, and going backwards and forwards during slideshow.
2022-09-23 23:14:14 +02:00
Stefan Kangas
e6f1ad6474 image-dired: Mark two slideshow defuns as internal
* lisp/image/image-dired.el (image-dired--slideshow-step)
(image-dired--slideshow-stop): Rename from
'image-dired--slideshow-step' and 'image-dired--slideshow-stop'.
Update callers and make old names into obsolete aliases.
2022-09-23 23:12:24 +02:00
Stefan Monnier
c244d4af57 cconv.el: Fix interactive closure bug#51695
Make cconv.el detect when a closure's interactive form needs to
capture variables from the context and tweak the code accordingly
if so.

* lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var.
(cconv-convert): Handle the case where the interactive form captures
vars from the surrounding context.  Remove left over handling of
`declare` which was already removed from the cconv-analyze` phase.
(cconv-analyze-form): Adjust analysis of interactive forms accordingly.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and
function.
* lisp/simple.el (function-documentation, oclosure-interactive-form):
Add methods for it.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): New test.
2022-09-23 16:36:16 -04:00
Visuwesh
41d39ffc32 Make Gnus respect mode-line-buffer-identification-keymap
* lisp/gnus/gnus-group.el (gnus-group-set-mode-line): Use
'propertized-buffer-identification' to buttonise and fontify the
buffer name.
* lisp/gnus/gnus-sum.el (gnus-set-mode-line):
* lisp/gnus/gnus.el (gnus-mode-line-buffer-identification): Adjust
calls to above.
* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Add missing
'gnus-modeline-buffer-identification' call (bug#57977).
2022-09-23 18:21:55 +02:00
Visuwesh
cf27fe0238 Make bounding box of 'image-crop' more noticeable
* lisp/image/image-crop.el (image-crop--crop-image-1): Darken the
selected region to make the bounding-box more noticable in images
which are mostly white (bug#58004).
2022-09-23 18:11:25 +02:00