]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years ago* src/fns.c (mapcar1): Test types in rough order of likelyhood.
Mattias Engdegård [Thu, 16 Jun 2022 14:04:48 +0000 (16:04 +0200)]
* src/fns.c (mapcar1): Test types in rough order of likelyhood.

2 years agoUse BASE_EQ instead of EQ where obviously safe
Mattias Engdegård [Thu, 16 Jun 2022 12:11:03 +0000 (14:11 +0200)]
Use BASE_EQ instead of EQ where obviously safe

* src/alloc.c (deadp):
* src/buffer.c (reset_buffer_local_variables, candidate_buffer)
(Fkill_buffer, Fbuffer_swap_text, Fmake_overlay, Fmove_overlay):
* src/callint.c (Fcall_interactively):
* src/coding.c (decode_coding_object, encode_coding_object)
(code_convert_region, Ffind_operation_coding_system):
* src/comp.c (Fcomp_el_to_eln_rel_filename):
* src/conf_post.h (RE_TRANSLATE_P):
* src/data.c (Fkill_local_variable, Fash, expt_integer):
* src/dired.c (file_name_completion):
* src/dispnew.c (set_window_cursor_after_update, update_frame_1)
(Fframe_or_buffer_changed_p):
* src/doc.c (Fdocumentation, Fdocumentation_property)
(default_to_grave_quoting_style):
* src/editfns.c (Fconstrain_to_field, save_excursion_save)
(save_excursion_restore, Fngettext):
* src/eval.c (Fautoload, un_autoload, specbind):
* src/fileio.c (Fmake_temp_file_internal):
* src/fns.c (string_char_to_byte, string_byte_to_char)
(Fnthcdr, Fnreverse):
* src/indent.c (vmotion):
* src/inotify.c (add_watch):
* src/keyboard.c (command_loop_1, read_char)
(read_char_minibuf_menu_prompt):
* src/lread.c (oblookup):
* src/macfont.m (macfont_descriptor_entity, macfont_open):
* src/minibuf.c (Finnermost_minibuffer_p, Ftry_completion)
(Ftest_completion):
* src/nsfns.m (ns_set_icon_name):
* src/pdumper.c (dump_queue_dequeue):
* src/pgtkfns.c (pgtk_set_icon_type, pgtk_set_icon_name):
* src/process.c (Faccept_process_output):
* src/textprop.c (set_text_properties):
* src/w32fns.c (w32_set_icon_type, w32_set_icon_name):
* src/w32select.c (validate_coding_system):
* src/window.c (decode_next_window_args, window_loop)
(save_window_save):
* src/xdisp.c (wset_redisplay):
* src/xfaces.c (Fx_family_fonts, resolve_face_name)
(gui_supports_face_attributes_p):
* src/xfns.c (x_set_icon_type, x_set_icon_name):
* src/xselect.c (clean_local_selection_data):
Use BASE_EQ instead of EQ where it is obvious that neither argument
can be a symbol with properties or at least one argument is a
non-symbol.

2 years agoMake package-recompile delete all .elc files first
Lars Ingebrigtsen [Thu, 16 Jun 2022 12:25:47 +0000 (14:25 +0200)]
Make package-recompile delete all .elc files first

* lisp/emacs-lisp/package.el (package-recompile): Delete all .elc
files under the package directory.

2 years agoAdd new package.el commands for recompilation
Lars Ingebrigtsen [Thu, 16 Jun 2022 11:49:02 +0000 (13:49 +0200)]
Add new package.el commands for recompilation

* doc/emacs/package.texi (Package Installation): Document them.

* lisp/emacs-lisp/package.el (package-recompile):
(package-recompile-all): New commands (bug#27253).

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 16 Jun 2022 08:09:19 +0000 (11:09 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years agoSpeed up Org to Texinfo generation
Eli Zaretskii [Thu, 16 Jun 2022 08:06:29 +0000 (11:06 +0300)]
Speed up Org to Texinfo generation

* doc/misc/Makefile.in ($(1:.org=.texi)): Use a higher GC
threshold, to speed up .org=.texi conversion.  Patch by Ihor
Radchenko <yantar92@gmail.com>.

2 years agoMake artist-version variable obsolete
Stefan Kangas [Thu, 16 Jun 2022 07:48:18 +0000 (09:48 +0200)]
Make artist-version variable obsolete

* lisp/textmodes/artist.el (artist-version): Make obsolete.  This has
not been updated in nearly two decades; use the Emacs version instead.
(artist-submit-bug-report): Don't use above obsolete variable.

2 years agoPrefer defvar-keymap for artist-mode-map
Stefan Kangas [Thu, 16 Jun 2022 07:47:47 +0000 (09:47 +0200)]
Prefer defvar-keymap for artist-mode-map

* lisp/textmodes/artist.el (artist-mode-map): Prefer
defvar-keymap.

2 years agoorg-cite-list-citations: Cache footnote-definition searches
Ihor Radchenko [Thu, 16 Jun 2022 02:43:29 +0000 (10:43 +0800)]
org-cite-list-citations: Cache footnote-definition searches

* lisp/org/oc.el (org-cite-list-citations): Avoid quadratic complexity.
Pre-calculate list of all footnote definitions and cache the footnote
label search hits.  Do not make `org-element-map' accumulate unused
result.

2 years agoorg-element-map: Avoid repetitive `plist-get' call
Ihor Radchenko [Thu, 16 Jun 2022 01:28:27 +0000 (09:28 +0800)]
org-element-map: Avoid repetitive `plist-get' call

* lisp/org/org-element.el (org-element-map): Do not call `(plist-get info
:ignore-list)' on every iteration.

2 years agoorg-export-data: Concatenate strings in temporary buffer for performance
Ihor Radchenko [Wed, 15 Jun 2022 17:01:53 +0000 (01:01 +0800)]
org-export-data: Concatenate strings in temporary buffer for performance

* lisp/org/ox.el (org-export-data): Use temporary buffer to collect export
data instead of `mapconcat'.  Using buffer puts less load on garbage
collector.

2 years agoorg-export-as: Do not update buffer settings when not modified
Ihor Radchenko [Wed, 15 Jun 2022 17:03:18 +0000 (01:03 +0800)]
org-export-as: Do not update buffer settings when not modified

* lisp/org/ox.el (org-export-as): Use `buffer-chars-modified-tick' and
avoid extra invocations of `org-set-regexps-and-options' and
`org-update-radio-target-regexp' when the buffer is not changed.
Also, disable folding checks.  Folding is irrelevant inside export
buffer.

2 years agoorg-export-resolve-id-link: Pre-cache all the ids in the parse tree
Ihor Radchenko [Sun, 12 Jun 2022 05:32:35 +0000 (13:32 +0800)]
org-export-resolve-id-link: Pre-cache all the ids in the parse tree

* lisp/org/ox.el (org-export-resolve-id-link): Pre-cache all the ids in
the parse tree for faster lookup.

2 years agoFix Motif drag-and-drop timestamps
Po Lu [Thu, 16 Jun 2022 07:51:56 +0000 (15:51 +0800)]
Fix Motif drag-and-drop timestamps

* lisp/x-dnd.el (x-dnd-handle-motif): Pass timestamp when
retrieving DND selection value.  Bug found on Solaris 2.6.

2 years agoorg-export-resolve-fuzyy-link: Pre-cache all possible search cells
Ihor Radchenko [Sun, 12 Jun 2022 05:06:47 +0000 (13:06 +0800)]
org-export-resolve-fuzyy-link: Pre-cache all possible search cells

* lisp/org/ox.el (org-export-resolve-fuzzy-link): Before matching LINK,
pre-process and cache all the non-nil search cells in the parse tree.
When matching, use the pre-processed info.  Fix the :test function for
the cache hash table.

2 years agoorg-export-get-footnote-definition: Pre-cache references in parse tree
Ihor Radchenko [Sun, 12 Jun 2022 05:05:16 +0000 (13:05 +0800)]
org-export-get-footnote-definition: Pre-cache references in parse tree

* lisp/org/ox.el (org-export-get-footnote-definition): Pre-process parse
tree once to filter out all non-footnote elements.  This speeds up
subsequent footnote definition searches.

2 years agoFix check for window system with toolkit scrollbars
Robert Pluim [Thu, 16 Jun 2022 07:34:28 +0000 (09:34 +0200)]
Fix check for window system with toolkit scrollbars

* configure.ac (USE_TOOLKIT_SCROLL_BARS): Add missing 'test' to
condition.  (Bug#55970)

2 years agoFix byte-swapping of Motif DND tables
Po Lu [Thu, 16 Jun 2022 07:26:55 +0000 (15:26 +0800)]
Fix byte-swapping of Motif DND tables

* src/xterm.c (xm_read_targets_table_rec): Swap nitems first
before checking the length.

2 years ago; Fix last change in documentation of 'strz' bindat type
Eli Zaretskii [Thu, 16 Jun 2022 07:08:10 +0000 (10:08 +0300)]
; Fix last change in documentation of 'strz' bindat type

* doc/lispref/processes.texi (Bindat Types): Fix wording and
clarify the description of 'strz'.  (Bug#55952)

2 years agobindat (strz): Write null terminator after variable length string
Richard Hansen [Fri, 10 Jun 2022 00:41:50 +0000 (20:41 -0400)]
bindat (strz): Write null terminator after variable length string

* lisp/emacs-lisp/bindat.el (bindat--pack-strz): Explicitly write a
null byte after packing a variable-length string to ensure proper
termination when packing to a pre-allocated string.
* doc/lispref/processes.texi (Bindat Types): Update documentation.
* test/lisp/emacs-lisp/bindat-tests.el (bindat-test--str-strz-prealloc):
Update tests.

2 years agoFix defcustom in last change
Po Lu [Thu, 16 Jun 2022 06:41:21 +0000 (14:41 +0800)]
Fix defcustom in last change

* lisp/x-dnd.el (x-dnd-use-offix-drop): Fix defcustom.

2 years agoImprove handling of fallback drop protocols
Po Lu [Thu, 16 Jun 2022 06:33:30 +0000 (14:33 +0800)]
Improve handling of fallback drop protocols

* lisp/x-dnd.el (x-dnd-use-offix-drop): New value `files', which
means to only drop files using the OffiX protocol.  Make it the
default.
(x-dnd-handle-old-kde): Handle other data types correctly.
(x-dnd-offix-old-kde-to-name): New variable.
(x-dnd-offix-id-to-name): Fix typo in doc string.
(x-dnd-handle-unsupported-drop): Implement new value.

2 years agoFix Motif DND after atom ownership is lost due to frame destruction
Po Lu [Thu, 16 Jun 2022 05:58:39 +0000 (13:58 +0800)]
Fix Motif DND after atom ownership is lost due to frame destruction

* src/xterm.c (xm_get_drag_atom_1): Record owner.
(x_free_frame_resources): Clear drag atom if owner was freed.
* src/xterm.h (struct x_display_info): New field
`motif_drag_atom_owner'.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Thu, 16 Jun 2022 04:52:01 +0000 (06:52 +0200)]
Merge from origin/emacs-28

4d7a936ac2 ; * src/fileio.c (Fset_file_modes): Improve previous change
32cff740e2 Describe 'set-file-modes' argument prompting

2 years agoImprove drag atom computation
Po Lu [Thu, 16 Jun 2022 04:49:07 +0000 (12:49 +0800)]
Improve drag atom computation

* src/xterm.c (xm_get_drag_window): Avoid leak if error occured
creating drag window.  Also use StructureNotifyMask instead of
ButtonPressMask.
(xm_get_drag_atom_1): Update.  Make EMACS_DRAG_ATOM a list of
atoms and use the first one that isn't currently owned.
(xm_get_drag_atom): Stop owning selection here.
(xm_setup_drag_info): Record chosen atom.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent, x_connection_closed):
Use chosen atom.
* src/xterm.h (struct x_display_info): New field
`motif_drag_atom_time'.

2 years agoStreamline time decoding and conversion
Paul Eggert [Thu, 16 Jun 2022 04:08:03 +0000 (23:08 -0500)]
Streamline time decoding and conversion

* src/lisp.h (lisp_h_BASE2_EQ, BASE2_EQ): New macros and functions.
* src/timefns.c (tzlookup, Fdecode_time): Use them.
(Ftime_convert): Convert to symbol once, instead of many times.

2 years agoDon’t test time functions for NaNs, INF
Paul Eggert [Thu, 16 Jun 2022 04:08:03 +0000 (23:08 -0500)]
Don’t test time functions for NaNs, INF

* test/src/timefns-tests.el (decode-then-encode-time)
(time-equal-p-NaN-NaN, time-arith-tests):
Don’t test time functions with infinities and NaNs,
which are not Lisp time values.

2 years agoPrefer BASE_EQ in time-sensitive ops
Paul Eggert [Thu, 16 Jun 2022 04:08:03 +0000 (23:08 -0500)]
Prefer BASE_EQ in time-sensitive ops

* src/timefns.c (tzlookup, lisp_time_hz_ticks)
(decode_time_components, lisp_to_timespec, lispint_arith)
(time_arith, time_cmp, Fdecode_time, Fencode_time)
(Ftime_convert): Prefer BASE_EQ to EQ where either will do.

2 years agoicalendar-tests no longer assumes TZ = wall
Paul Eggert [Thu, 16 Jun 2022 04:05:22 +0000 (23:05 -0500)]
icalendar-tests no longer assumes TZ = wall

Do not assume that the TZ environment variable is either unset or
agrees with /etc/localtime.  I ran into this test bug while
running ‘TZ=America/Chicago make check’ on a platform where
/etc/localtime was America/Los_Angeles.
* test/lisp/calendar/icalendar-tests.el:
(icalendar-tests--decode-isodatetime): Don’t use
set-time-zone-rule, whose doc string says “Instead of calling this
function, you typically want something else” for a reason.
Instead, pass the zone arg to icalendar-test--format.

2 years agoHandle OffiX drop of multiple files
Po Lu [Thu, 16 Jun 2022 02:39:01 +0000 (10:39 +0800)]
Handle OffiX drop of multiple files

* lisp/x-dnd.el (x-dnd-types-alist): Register DndTypeFiles.
(x-dnd-offix-id-to-name): Fix typo.
(x-dnd-handle-offix-files): New function.
(x-dnd-convert-to-offix): Fix conversion to DndTypeFiles.

2 years agoComply with the Motif requirement for unique drag atoms
Po Lu [Thu, 16 Jun 2022 02:08:12 +0000 (10:08 +0800)]
Comply with the Motif requirement for unique drag atoms

* src/xselect.c (x_handle_selection_request)
(Fx_get_selection_internal, syms_of_xselect): New variable
`x-selection-alias-alist'.  Respect that alist of aliases.

* src/xterm.c (x_atom_refs): Intern _EMACS_DRAG_ATOM.
(xm_get_drag_atom_1, xm_get_drag_atom): New functions.
(xm_setup_drag_info, x_dnd_cleanup_drag_and_drop)
(x_dnd_begin_drag_and_drop, x_dnd_update_state, handle_one_xevent)
(x_connection_closed, x_intern_cached_atom): Alias the drag atom
to XdndSelection.  Use it instead of XdndSelection to set the
Motif index atom.
(x_get_atom_name): Handle new atoms.
(syms_of_xterm): New defsym.
* src/xterm.h (struct x_display_info): New fields for new atoms
and their names.

2 years ago* .dir-locals.el: Set emacs-lisp-docstring-fill-column.
Sean Whitton [Wed, 15 Jun 2022 21:42:40 +0000 (14:42 -0700)]
* .dir-locals.el: Set emacs-lisp-docstring-fill-column.

2 years ago; * etc/NEWS: Add entry for recent minibuffer abbrev table changes.
Sean Whitton [Wed, 15 Jun 2022 21:41:17 +0000 (14:41 -0700)]
; * etc/NEWS: Add entry for recent minibuffer abbrev table changes.

2 years agoAdjust ibuffer test
Lars Ingebrigtsen [Wed, 15 Jun 2022 16:36:58 +0000 (18:36 +0200)]
Adjust ibuffer test

* test/lisp/ibuffer-tests.el (ibuffer-format-qualifier): Adjust
test after recent formatting changes.

2 years agoAllow completing tags, parameters and values in html-mode
Lars Ingebrigtsen [Wed, 15 Jun 2022 16:29:42 +0000 (18:29 +0200)]
Allow completing tags, parameters and values in html-mode

* lisp/textmodes/sgml-mode.el (html-mode--complete-at-point):
Allow completing tags, parameters and values (bug#29057).

2 years agoDo not display 'nil for 0-ary filter qualifier in ibuf
Manuel Giraud [Wed, 15 Jun 2022 15:52:38 +0000 (17:52 +0200)]
Do not display 'nil for 0-ary filter qualifier in ibuf

* lisp/ibuf-ext.el (ibuffer-format-qualifier-1): Do not display
nil in header for 0-ary filter qualifier.
* lisp/ibuf-macs.el (define-ibuffer-filter): Also fix the message.

2 years agoPrefer defvar-keymap in ibuffer.el
Stefan Kangas [Wed, 15 Jun 2022 14:43:22 +0000 (16:43 +0200)]
Prefer defvar-keymap in ibuffer.el

* lisp/ibuffer.el (ibuffer--filter-map, ibuffer-name-map)
(ibuffer-filename/process-header-map, ibuffer-mode-name-map)
(ibuffer-name-header-map, ibuffer-size-header-map)
(ibuffer-mode-header-map, ibuffer-mode-filter-group-map): Prefer
defvar-keymap.

2 years ago; * src/fileio.c (Fset_file_modes): Improve previous change
Robert Pluim [Wed, 15 Jun 2022 13:16:47 +0000 (15:16 +0200)]
; * src/fileio.c (Fset_file_modes): Improve previous change

2 years agoImplement using the OffiX protocol for dropping
Po Lu [Wed, 15 Jun 2022 13:00:55 +0000 (21:00 +0800)]
Implement using the OffiX protocol for dropping

* lisp/x-dnd.el (x-dnd-use-offix-drop): New user option.
(x-dnd-handle-unsupported-drop): Return t if the OffiX protocol
was used.
(x-treat-local-requests-remotely): New defvar.
(x-dnd-convert-to-offix, x-dnd-do-offix-drop): New functions.

* src/xterm.c: Update commentary.
(x_term_init): Extend number of DND atoms allocated by default.

2 years agoDescribe 'set-file-modes' argument prompting
Robert Pluim [Wed, 15 Jun 2022 12:25:17 +0000 (14:25 +0200)]
Describe 'set-file-modes' argument prompting

* src/fileio.c (Fset_file_modes): Document that FILENAME is prompted
for.  (Bug#55984)

2 years agowhitespace.el: New whitespace style `lines-char'
Miha Rihtaršič [Wed, 15 Jun 2022 12:24:24 +0000 (14:24 +0200)]
whitespace.el: New whitespace style `lines-char'

* lisp/whitespace.el (whitespace-style):
(whitespace-style-value-list):
(whitespace-toggle-option-alist):
(global-whitespace-toggle-options):
(whitespace-help-text):
(whitespace-interactive-char):
(whitespace-style-face-p):
(whitespace-color-on):
(whitespace-lines-regexp): New whitespace style `lines-char', which
highlights only the first character over the whitespace-line-column
limit (bug#55980).

2 years agoHandle receiving new OffiX protocol during drag-and-drop
Po Lu [Wed, 15 Jun 2022 12:08:51 +0000 (20:08 +0800)]
Handle receiving new OffiX protocol during drag-and-drop

* lisp/x-dnd.el (x-dnd-types-alist, x-dnd-known-types): Add
DndTypeFile and DndTypeText.
(x-dnd-init-frame): Add _DND_PROTOCOL.
(x-dnd-handle-drag-n-drop-event): Handle _DND_PROTOCOL events.
(x-dnd-handle-old-kde): Drop event if proto is too new.
(x-dnd-offix-id-to-name): New list.
(x-dnd-handle-offix-file, x-dnd-handle-offix): New functions.

2 years agoFix ;;;###autoload scanning from (some) packages
Lars Ingebrigtsen [Wed, 15 Jun 2022 12:05:07 +0000 (14:05 +0200)]
Fix ;;;###autoload scanning from (some) packages

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Fix autoloads scanning from packages.

2 years agoFix file name quoting in tramp-smb.el
Michael Albinus [Wed, 15 Jun 2022 10:43:17 +0000 (12:43 +0200)]
Fix file name quoting in tramp-smb.el

* lisp/net/tramp-smb.el (tramp-smb-shell-quote-localname): New defun.
(tramp-smb-handle-add-name-to-file, tramp-smb-handle-copy-file)
(tramp-smb-handle-delete-directory)
(tramp-smb-handle-delete-file)
(tramp-smb-do-file-attributes-with-stat)
(tramp-smb-handle-file-local-copy)
(tramp-smb-handle-file-system-info)
(tramp-smb-handle-make-directory-internal)
(tramp-smb-handle-make-symbolic-link)
(tramp-smb-handle-process-file, tramp-smb-handle-rename-file)
(tramp-smb-handle-set-file-modes)
(tramp-smb-handle-start-file-process)
(tramp-smb-handle-write-region, tramp-smb-get-file-entries)
(tramp-smb-get-stat-capability): Use it.
(tramp-smb-get-localname): Remove superfluous test.  (Bug#55855)

2 years agoImprove Tramp debugging
Michael Albinus [Wed, 15 Jun 2022 08:57:56 +0000 (10:57 +0200)]
Improve Tramp debugging

* lisp/net/tramp-cache.el (tramp-list-connections): Fix docstring.

* lisp/net/tramp.el (tramp-backtrace): New optional arg FORCE.

2 years agoUpdate args of isearch-search-fun-in-text-property (bug#14013)
Juri Linkov [Wed, 15 Jun 2022 07:32:09 +0000 (10:32 +0300)]
Update args of isearch-search-fun-in-text-property (bug#14013)

* lisp/isearch.el (isearch-search-fun-in-text-property): Swap signature args.
* lisp/dired-aux.el (dired-isearch-search-filenames): Update the call.

2 years agorepeat-mode: Don't echo unset keys in help message
Visuwesh [Tue, 14 Jun 2022 17:29:47 +0000 (22:59 +0530)]
repeat-mode: Don't echo unset keys in help message

* repeat.el (repeat-echo-message-string): Check if the key is set.
(bug#55977)

2 years agoHandle coordinates for the old KDE drop protocol
Po Lu [Wed, 15 Jun 2022 06:46:21 +0000 (14:46 +0800)]
Handle coordinates for the old KDE drop protocol

* src/xterm.c (x_atom_refs): Add DndProtocol and _DND_PROTOCOL.
(x_coords_from_dnd_message): Handle the old KDE protocol.
* src/xterm.h (struct x_display_info): New atoms.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Wed, 15 Jun 2022 04:32:14 +0000 (06:32 +0200)]
Merge from origin/emacs-28

850050ca5c Revert "Clarify what a Calc registeri in in calc-insert-re...

2 years agoFix link action handling with Motif DND
Po Lu [Wed, 15 Jun 2022 03:37:39 +0000 (11:37 +0800)]
Fix link action handling with Motif DND

* src/xterm.c (enum xm_drag_operation): New alternate
definition.
(XM_DRAG_OPERATION_IS_LINK): New macro.
(handle_one_xevent): Use it instead.

2 years agoHandle coordinates from XM_DRAG_REASON_DRAG_MOTION replies
Po Lu [Wed, 15 Jun 2022 01:26:46 +0000 (09:26 +0800)]
Handle coordinates from XM_DRAG_REASON_DRAG_MOTION replies

* src/xterm.c (struct xm_drag_motion_reply): New struct.
(xm_read_drag_motion_reply): New function.
(x_coords_from_dnd_message): Handle those messages as well.

2 years agoAdd abbrev tables for minibuffer-mode and minibuffer-inactive-mode
Sean Whitton [Mon, 13 Jun 2022 17:24:17 +0000 (12:24 -0500)]
Add abbrev tables for minibuffer-mode and minibuffer-inactive-mode

* lisp/minibuffer.el (minibuffer-mode, minibuffer-inactive-mode): Add
an abbrev table for each of these modes (bug#55946).

2 years agoSimplify byte-compiler assuming cconv normalisations
Mattias Engdegård [Mon, 6 Jun 2022 09:10:05 +0000 (11:10 +0200)]
Simplify byte-compiler assuming cconv normalisations

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker)
(byte-optimize-let-form, byte-optimize-letX):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unwind-protect):
Simplify source optimisation and codegen code that can now rely on
normalised let/let* and unwind-protect forms.

2 years agoRun cconv for dynbound code as well
Mattias Engdegård [Tue, 14 Jun 2022 17:09:20 +0000 (19:09 +0200)]
Run cconv for dynbound code as well

Make cconv work for dynamically bound code and always run it.
This allows later stages to benefit from transformations and
normalisations in cconv.

* lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): Always run
cconv.
* lisp/emacs-lisp/cconv.el (cconv--analyze-function)
(cconv-analyze-form): In dynbound code, treat all variable bindings
as dynamic (lambda, let, let* and condition-case).

2 years agoNormalise setq during macro-expansion
Mattias Engdegård [Fri, 3 Jun 2022 18:31:10 +0000 (20:31 +0200)]
Normalise setq during macro-expansion

Early normalisation of setq during macroexpand-all allows later
stages, cconv, byte-opt and codegen, to be simplified and duplicated
checks to be eliminated.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Normalise all setq forms to a sequence of (setq VAR EXPR).
Emit warnings if necessary.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq):
Simplify.
* test/lisp/emacs-lisp/bytecomp-tests.el: Adapt and add tests.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el;
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el:
New files.

2 years ago* lisp/replace.el (read-regexp): Use minibuffer-message in the minibuffer.
Juri Linkov [Tue, 14 Jun 2022 16:35:02 +0000 (19:35 +0300)]
* lisp/replace.el (read-regexp): Use minibuffer-message in the minibuffer.

2 years agoAdd more characters with macron in C-x 8 map and latin input methods
Robert Pluim [Wed, 8 Jun 2022 12:51:31 +0000 (14:51 +0200)]
Add more characters with macron in C-x 8 map and latin input methods

* lisp/international/iso-transl.el (iso-transl-char-map): Add
sequences for {AE,ae,G,g} with macron.
* lisp/leim/quail/latin-post.el ("latin-postfix"): Add missing entries
for {AE,ae,G,g} with macron.
* lisp/leim/quail/latin-pre.el ("latin-prefix"): Add entries for
'letter with macron' for {A,a,E,e,AE,ae,I,I,O,o,U,u,Y,y} with macron.

(Bug#55668)

2 years agoFix errors when aligning text in find-dired
Stephen Berman [Tue, 14 Jun 2022 13:37:53 +0000 (15:37 +0200)]
Fix errors when aligning text in find-dired

* lisp/find-dired.el (find-dired-filter): Don't error out while
trying to align the text (by just removing that code) (bug#46218).

2 years agoMake flymake-proc--delete-temp-directory slightly safer
Lars Ingebrigtsen [Tue, 14 Jun 2022 13:24:19 +0000 (15:24 +0200)]
Make flymake-proc--delete-temp-directory slightly safer

* lisp/progmodes/flymake-proc.el
(flymake-proc--delete-temp-directory): Temp dir name may be
abbreviatated, so expand it first (bug#46203).

2 years agoFix .dir-local.el caching for symlinks
Lars Ingebrigtsen [Tue, 14 Jun 2022 13:01:44 +0000 (15:01 +0200)]
Fix .dir-local.el caching for symlinks

* lisp/files.el (dir-locals-read-from-dir): We want the time stamp
of the actual file, not the time stamp of the symlink (if
.dir-locals.el is a symlink) (bug#46122).

2 years agoLeave the contents on the *Backtrace* buffer on `q'
Lars Ingebrigtsen [Tue, 14 Jun 2022 12:38:05 +0000 (14:38 +0200)]
Leave the contents on the *Backtrace* buffer on `q'

* lisp/emacs-lisp/debug.el (debug): Don't clear the contents of
the buffer on `q' (bug#55863).

2 years agoFix gud parsing of empty jdb classpaths
Lars Ingebrigtsen [Tue, 14 Jun 2022 12:26:58 +0000 (14:26 +0200)]
Fix gud parsing of empty jdb classpaths

* lisp/progmodes/gud.el (gud-jdb-marker-filter): Parse empty
classpaths (like classpath: []) correctly (bug#55957).

2 years agoBind Cmd-t to menu-set-font on macOS
Daniel Martín [Tue, 14 Jun 2022 12:23:06 +0000 (14:23 +0200)]
Bind Cmd-t to menu-set-font on macOS

* lisp/term/ns-win.el (global-map): set-frame-font asks for a font
using the minibuffer, but the former ns-popup-font-panel always showed
the graphical font panel on macOS.  To preserve the same behavior,
bind it to menu-set-font, which is also called by Options, Set Default
Font (bug#55967).

2 years agoAllow using alists in ido completion and hitting TAB
Lars Ingebrigtsen [Tue, 14 Jun 2022 12:16:55 +0000 (14:16 +0200)]
Allow using alists in ido completion and hitting TAB

* lisp/ido.el (ido-completion-help): Allow using an alist
COMPLETIONS (bug#46091).

2 years agoRevert "Clarify what a Calc registeri in in calc-insert-register"
Lars Ingebrigtsen [Tue, 14 Jun 2022 11:56:07 +0000 (13:56 +0200)]
Revert "Clarify what a Calc registeri in in calc-insert-register"

This reverts commit 73400e4002ce8fca060093548e6791b3a784eeaa.

This has been fixed in Emacs 29 by making it possible to use regular registers in calc.

2 years agoMention how to only get syntactic font locking in the manual
Lars Ingebrigtsen [Mon, 13 Jun 2022 18:57:25 +0000 (20:57 +0200)]
Mention how to only get syntactic font locking in the manual

* doc/lispref/modes.texi (Syntactic Font Lock): Note how to only
get syntactic font locking (bug#46039).

2 years ago; Improve doc of `x-dnd-native-test-function'
Po Lu [Tue, 14 Jun 2022 11:49:58 +0000 (19:49 +0800)]
; Improve doc of `x-dnd-native-test-function'

* src/xterm.c (syms_of_xterm): Improve doc.  Suggested by Eli
Zaretskii <eliz@gnu.org>.

2 years agoFix Tramp problem with non-essential
Michael Albinus [Tue, 14 Jun 2022 11:04:34 +0000 (13:04 +0200)]
Fix Tramp problem with non-essential

* lisp/net/tramp.el (tramp-run-real-handler):
Handle also functions which use a `tramp-file-name' for the file
name handler.  (Bug#55832)
(tramp-get-home-directory, tramp-get-remote-uid)
(tramp-get-remote-gid): VEC can also be nil.

2 years ago; * lisp/emacs-lisp/cconv.el: Fix outdated comments.
Mattias Engdegård [Tue, 14 Jun 2022 10:08:15 +0000 (12:08 +0200)]
; * lisp/emacs-lisp/cconv.el: Fix outdated comments.

2 years agoFix mishandling of dnd-scroll-margin with scroll bar motion
Po Lu [Tue, 14 Jun 2022 09:43:08 +0000 (17:43 +0800)]
Fix mishandling of dnd-scroll-margin with scroll bar motion

* lisp/dnd.el (dnd-handle-movement): Ignore posns inside scroll
bars for now.

2 years ago* lisp/minibuffer.el (minibuffer-complete-history): New command.
Juri Linkov [Tue, 14 Jun 2022 07:14:52 +0000 (10:14 +0300)]
* lisp/minibuffer.el (minibuffer-complete-history): New command.

(minibuffer-complete-defaults): New command.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00498.html

2 years ago* lisp/simple.el (completion-auto-wrap): Rename from completion-wrap-movement.
Juri Linkov [Tue, 14 Jun 2022 07:04:56 +0000 (10:04 +0300)]
* lisp/simple.el (completion-auto-wrap): Rename from completion-wrap-movement.

(next-completion): Use completion-auto-wrap.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00139.html

2 years agoFix out of date parts in NS doc and keyboard bindings
Po Lu [Tue, 14 Jun 2022 06:06:59 +0000 (14:06 +0800)]
Fix out of date parts in NS doc and keyboard bindings

* doc/emacs/macos.texi (Mac / GNUstep Events): Remove
`ns-drag-n-drop' which doesn't exist anymore.  Add events to
concept index and document `ns-show-prefs'.  (bug#55940)
* lisp/term/ns-win.el (global-map): Remove ns-popup-font-panel.

2 years agoHandle coordinates of Motif drop start messages
Po Lu [Tue, 14 Jun 2022 05:52:38 +0000 (13:52 +0800)]
Handle coordinates of Motif drop start messages

* src/xterm.c (xm_read_drop_start_message): New function.
(xm_read_drag_motion_message): Check that the originator is
correct.
(x_coords_from_dnd_message): Read drop start messages as well.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 14 Jun 2022 04:30:43 +0000 (06:30 +0200)]
Merge from origin/emacs-28

73400e4002 Clarify what a Calc registeri in in calc-insert-register

2 years agoHandle coordinate extraction for more event types
Po Lu [Tue, 14 Jun 2022 02:12:48 +0000 (10:12 +0800)]
Handle coordinate extraction for more event types

* src/xterm.c (xm_read_drag_motion_message): New function.
(x_coords_from_dnd_message): Handle XM_DRAG_REASON_DRAG_MOTION.

2 years agoUse coordinates provided by DND messages if available
Po Lu [Tue, 14 Jun 2022 01:41:59 +0000 (09:41 +0800)]
Use coordinates provided by DND messages if available

This avoids an extra sync, which matters when dropping onto
Emacs running over a slow connection.

* src/xselect.c (x_handle_dnd_message): New args
`root_window_coords', `root_x' and `root_y'.
* src/xterm.c (x_coords_from_dnd_message): New function.
(handle_one_xevent): Pass root window coordinates to
x_handle_dnd_message.
* src/xterm.h: Update prototypes.

2 years agoproject--git-submodules: Parse more strictly
Dmitry Gutov [Tue, 14 Jun 2022 01:00:22 +0000 (04:00 +0300)]
project--git-submodules: Parse more strictly

* lisp/progmodes/project.el (project--git-submodules):
Don't mistake 'load-path' for 'path' (bug#55396).

2 years agoDefault decoded-time dst slot to -1
Paul Eggert [Mon, 13 Jun 2022 21:25:58 +0000 (14:25 -0700)]
Default decoded-time dst slot to -1

* lisp/simple.el (decoded-time): Default dst slot to -1.
Improve related doc strings.

2 years agoPacify GCC 12.1.1 -Wanalyzer-use-of-uninitialized-value
Paul Eggert [Mon, 13 Jun 2022 20:37:37 +0000 (13:37 -0700)]
Pacify GCC 12.1.1 -Wanalyzer-use-of-uninitialized-value

* src/xfont.c (xfont_list_pattern): Initialize a local.
Although I’m not sure this is needed, it doesn’t change
behavior (except possibly to make undefined behavior defined).

2 years agoPacify GCC 12.1.1 in default developer build
Paul Eggert [Mon, 13 Jun 2022 20:21:18 +0000 (13:21 -0700)]
Pacify GCC 12.1.1 in default developer build

* src/pdumper.c (pdumper_load): Use explicit memset to work around
GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105961>.

2 years ago* lisp/progmodes/grep.el (grep-read-files): Combine files with aliases.
Juri Linkov [Mon, 13 Jun 2022 17:19:32 +0000 (20:19 +0300)]
* lisp/progmodes/grep.el (grep-read-files): Combine files with aliases.

Use completion-table-merge to combine completions of files from
read-file-name-internal with a list of defaults from grep-files-aliases
(bug#55800).

2 years agoMention \`M-x ...' in the lispref manual
Lars Ingebrigtsen [Mon, 13 Jun 2022 15:30:36 +0000 (17:30 +0200)]
Mention \`M-x ...' in the lispref manual

* doc/lispref/help.texi (Keys in Documentation): Note \`M-x ...'
syntax.

2 years agoClarify what a Calc registeri in in calc-insert-register
Lars Ingebrigtsen [Mon, 13 Jun 2022 15:14:08 +0000 (17:14 +0200)]
Clarify what a Calc registeri in in calc-insert-register

* lisp/calc/calc-yank.el (calc-insert-register): Note that these
aren't normal registers (bug#55943).

2 years agoAllow saying \\=`M-x ...' in a doc string
Lars Ingebrigtsen [Mon, 13 Jun 2022 15:02:55 +0000 (17:02 +0200)]
Allow saying \\=`M-x ...' in a doc string

* lisp/help.el (substitute-command-keys): Allow saying \\=`M-x
foo' in doc strings (and have it be fontified as a key binding).

2 years agoMassage In-Reply-To data in message-mail
Lars Ingebrigtsen [Mon, 13 Jun 2022 14:46:14 +0000 (16:46 +0200)]
Massage In-Reply-To data in message-mail

* lisp/gnus/message.el (message-mail): Fix up Message-IDs from
Firefox (bug#55926).

2 years agoMatch complete words in dns-mode
Lassi Kortela [Mon, 13 Jun 2022 14:32:45 +0000 (16:32 +0200)]
Match complete words in dns-mode

* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords): Match
complete words like SOA and not all words that contain the string
SOA (bug#55944).

Copyright-paperwork-exempt: yes

2 years agoAllow `query-replace' to do exact replacement of the current item
Lars Ingebrigtsen [Mon, 13 Jun 2022 14:17:40 +0000 (16:17 +0200)]
Allow `query-replace' to do exact replacement of the current item

* doc/emacs/search.texi (Query Replace): Document it.

* lisp/replace.el (query-replace-help): Amend help text.
(query-replace-map): Bind `E' to the exact case replacement.
(perform-replace): Allow editing a replacement with exact case
(bug#8504).

2 years agoAdd to mode cedilla characters to iso-transl-char-map
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:57:26 +0000 (15:57 +0200)]
Add to mode cedilla characters to iso-transl-char-map

* lisp/international/iso-transl.el (iso-transl-char-map): Add some
more cedilla characters.

2 years agoAdd support for the Meetei Mayek script
समीर सिंह Sameer Singh [Sat, 11 Jun 2022 13:23:43 +0000 (18:53 +0530)]
Add support for the Meetei Mayek script

* lisp/language/indian.el ("Meetei Mayek"): New language environment.
Add composition rules for Meetei Mayek. Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Meetei Mayek.
* lisp/leim/quail/indian.el ("meetei-mayek"): New input method.

* etc/HELLO: Add a Meetei Mayek greeting.
* etc/NEWS: Announce the new language environment.

2 years agoMake the ediff control panel mode line prettier
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:49:56 +0000 (15:49 +0200)]
Make the ediff control panel mode line prettier

* lisp/vc/ediff-wind.el (ediff-refresh-mode-lines): Don't include
"Quick Help" in the mode line in the plain version (bug#12840).
(ediff-make-wide-control-buffer-id): Make the informative part of
the mode line bold.  (Code from Michael Heerdegen.)

2 years ago; * etc/NEWS: Fix wording.
Eli Zaretskii [Mon, 13 Jun 2022 13:46:45 +0000 (16:46 +0300)]
; * etc/NEWS: Fix wording.

2 years ago; * doc/lispref/minibuf.texi (Text from Minibuffer): Fix indexing.
Eli Zaretskii [Mon, 13 Jun 2022 13:45:05 +0000 (16:45 +0300)]
; * doc/lispref/minibuf.texi (Text from Minibuffer): Fix indexing.

2 years agoAllow rgrep users to indicate case folding easier
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:32:57 +0000 (15:32 +0200)]
Allow rgrep users to indicate case folding easier

* lisp/progmodes/grep.el (rgrep): Allow the user to toggle case
sensitivity interactively (bug#16913).

2 years agoAdd a `M-c' command to `read-regexp'
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:31:25 +0000 (15:31 +0200)]
Add a `M-c' command to `read-regexp'

* doc/lispref/minibuf.texi (Text from Minibuffer): Document it.

* lisp/replace.el (read-regexp): Add a `M-c' command to indicate
case folding (bug#16913).

2 years agobindat (strz): Error on null byte if packing variable-length string
Richard Hansen [Mon, 13 Jun 2022 12:32:01 +0000 (14:32 +0200)]
bindat (strz): Error on null byte if packing variable-length string

* lisp/emacs-lisp/bindat.el (strz): Signal an error if a null byte is
encountered while packing a string to a variable-length strz field.
* test/lisp/emacs-lisp/bindat-tests.el (strz): Add tests (bug#55938).

2 years ago* files.el (auto-mode-alist): Add entry to `.eld` files
Stefan Monnier [Mon, 13 Jun 2022 12:58:09 +0000 (08:58 -0400)]
* files.el (auto-mode-alist): Add entry to `.eld` files

2 years agoMake `/ a' in *Package* filter by name
Lars Ingebrigtsen [Mon, 13 Jun 2022 12:20:22 +0000 (14:20 +0200)]
Make `/ a' in *Package* filter by name

* lisp/emacs-lisp/package.el (package-menu-filter-by-archive):
Filter by package name instead of by regexp, so that if the user
types "gnu", they won't get "nongnu", too (bug#55919).

2 years ago* lisp/find-dired.el (find-dired): Make directory clickable.
Visuwesh [Sun, 12 Jun 2022 10:35:08 +0000 (12:35 +0200)]
* lisp/find-dired.el (find-dired): Make directory clickable.

* lisp/find-dired.el (find-dired): Make the directory line
clickable (bug#55906).

2 years agoRespect test function when performing local drag-and-drop
Po Lu [Mon, 13 Jun 2022 07:01:06 +0000 (15:01 +0800)]
Respect test function when performing local drag-and-drop

* lisp/x-dnd.el (x-dnd-test-function): Fix doc string to
describe what is actually accepted.
(x-dnd-known-types, x-dnd-targets-list): Fix coding style.
(x-dnd-handle-native-drop): New function.

* src/xselect.c (x_atom_to_symbol): Export.

* src/xterm.c (x_dnd_note_self_drop): Call new variable to
determine what action to return.
(x_clear_dnd_action): New function.
(x_dnd_begin_drag_and_drop): Respect new variable.
(syms_of_xterm): New defvar `x-dnd-native-test-function'.
* src/xterm.h: Update prototypes.