]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoMention the case of the result in the try-completion doc string
Lars Ingebrigtsen [Sat, 23 Apr 2022 13:16:41 +0000 (15:16 +0200)]
Mention the case of the result in the try-completion doc string

* src/minibuf.c (Ftry_completion): Mention the case of the results
(bug#39484).

2 years agoMake elisp-flymake-byte-compile clean up on failures
Lars Ingebrigtsen [Sat, 23 Apr 2022 12:52:45 +0000 (14:52 +0200)]
Make elisp-flymake-byte-compile clean up on failures

* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile): Clean
up no matter what the exit status of the process is (bug#55056).

2 years agoDon't make a header if the user hasn't specified columns in vtable
Lars Ingebrigtsen [Sat, 23 Apr 2022 12:47:55 +0000 (14:47 +0200)]
Don't make a header if the user hasn't specified columns in vtable

* lisp/emacs-lisp/vtable.el (vtable):
(make-vtable): Store whether the user has specified the columns.
(vtable-insert): Don't insert a header line or a header if the
user hasn't specified the columns (bug#55075).

2 years agoFix prompts in sql-get-login again
Filipp Gunbin [Sat, 23 Apr 2022 12:29:45 +0000 (14:29 +0200)]
Fix prompts in sql-get-login again

* lisp/progmodes/sql.el (sql-get-login-ext): Use prompt-def
everywhere.
(sql-get-login): Revert previous fix (bug#52546).

2 years agoRegenerated ldefs-boot.el
Lars Ingebrigtsen [Sat, 23 Apr 2022 12:12:57 +0000 (14:12 +0200)]
Regenerated ldefs-boot.el

2 years agoAdd new minor mode word-wrap-whitespace-mode
Lars Ingebrigtsen [Sat, 23 Apr 2022 12:12:18 +0000 (14:12 +0200)]
Add new minor mode word-wrap-whitespace-mode

* doc/emacs/display.texi (Visual Line Mode): Document it.
* lisp/textmodes/word-wrap-mode.el: New minor mode.

2 years agoFix key navigation of Lucid menus on XI2
Po Lu [Sat, 23 Apr 2022 11:34:46 +0000 (19:34 +0800)]
Fix key navigation of Lucid menus on XI2

* src/xmenu.c (popup_get_selection): Fix cookie claiming of
input extension events.
(Fx_menu_bar_open_internal): Use right timestamps on XI2.
* src/xterm.c (handle_one_xevent): Dispatch XI2 key events via
Xt when popup is active.

2 years agoAvoid unnecessary calculations when handling button events during DND
Po Lu [Sat, 23 Apr 2022 02:04:33 +0000 (10:04 +0800)]
Avoid unnecessary calculations when handling button events during DND

* src/xterm.c (handle_one_xevent): Only calculate DND grab for
button release events.

2 years agoAvoid clearing splash screen message during DND on Haiku
Po Lu [Sat, 23 Apr 2022 00:36:45 +0000 (00:36 +0000)]
Avoid clearing splash screen message during DND on Haiku

* src/haikuterm.c (haiku_read_socket): Respect any_help_event_p
when sending help events for DND.

2 years agoByte compiler: Prevent special forms' symbols being replaced by bare symbols
Alan Mackenzie [Fri, 22 Apr 2022 19:11:31 +0000 (19:11 +0000)]
Byte compiler: Prevent special forms' symbols being replaced by bare symbols

These are symbols with position from source code, which should not be replaced
by bare symbols in, e.g., optimization functions.

* lisp/Makefile.in: (BYTE_COMPILE_FLAGS, compile-first case): Set
max-specpdl-size to 5000 for the benefit of lisp/emacs-lisp/comp.el.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker)
(byte-optimize--rename-var, byte-optimize-if, byte-optimize-letX)
* lisp/emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel)
(byte-compile-lambda)
* lisp/emacs-lisp/cconv.el (cconv-convert)
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Preserve, e.g., (car
form) in the byte compiler, when this form's car is a symbol with position of
a special form, rather than replacing the symbol with a bare symbol, e.g.
'cond.

2 years agoByte compiler: correct output warning message positions (part 2)
Alan Mackenzie [Fri, 22 Apr 2022 17:16:21 +0000 (17:16 +0000)]
Byte compiler: correct output warning message positions (part 2)

A supplementary commit to that on 2022-04-18:

* lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos): Handle
vectors and records correctly.

* lisp/emacs-lisp/byte-run.el (byte-run--ssp-seen): Correct the doc string.

2 years agoFurther doc string quoting fixes
Lars Ingebrigtsen [Fri, 22 Apr 2022 15:16:42 +0000 (17:16 +0200)]
Further doc string quoting fixes

* test/lisp/progmodes/cperl-mode-tests.el (cperl--run-test-cases):
* lisp/simple.el (undo-equiv-table):
* lisp/shell.el (shell-mode):
(shell-mode):
* lisp/recentf.el (recentf-mode):
* lisp/org/ob-table.el (org-sbe):
* lisp/net/eudc.el (eudc-rfc5322-cctext-token):
* lisp/mail/ietf-drums-date.el (ietf-drums-date--slot-ranges):
* lisp/faces.el (color-luminance-dark-limit):
* lisp/erc/erc.el (erc-tls):
* lisp/emacs-lisp/pcase.el (pcase-setq): Further quoting fixes in
doc strings.

2 years agoAudit quoting the quote character in doc strings
Lars Ingebrigtsen [Fri, 22 Apr 2022 14:17:22 +0000 (16:17 +0200)]
Audit quoting the quote character in doc strings

* test/src/regex-emacs-tests.el (regex-tests-compare):
(regex-tests-compare):
(regex-tests-match):
* test/lisp/xml-tests.el (xml-parse-tests--qnames):
* test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from):
* test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset):
* test/lisp/calc/calc-tests.el (calc-tests-equal):
* lisp/window.el (get-lru-window):
(get-mru-window):
(get-largest-window):
(quit-restore-window):
(display-buffer):
* lisp/vc/vc-rcs.el (vc-rcs-consult-headers):
* lisp/url/url-auth.el (url-digest-auth-build-response):
* lisp/tutorial.el (tutorial--find-changed-keys):
* lisp/transient.el (transient-suffix-object):
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/textmodes/bibtex.el (bibtex-clean-entry):
* lisp/tab-bar.el (tab-bar--key-to-number):
(toggle-frame-tab-bar):
* lisp/ses.el (ses-recalculate-cell):
(ses-define-local-printer):
(ses-prin1):
* lisp/progmodes/xref.el (xref--find-ignores-arguments):
* lisp/progmodes/verilog-mode.el (verilog-single-declaration-end):
* lisp/progmodes/tcl.el (tcl-mode-hook):
* lisp/progmodes/gdb-mi.el (gdb-get-buffer-create):
* lisp/progmodes/elisp-mode.el (elisp--xref-make-xref):
* lisp/play/dunnet.el (dun-room-objects):
* lisp/outline.el (outline--cycle-state):
* lisp/org/ox-publish.el (org-publish-find-property):
* lisp/org/ox-html.el (org-html--unlabel-latex-environment):
* lisp/org/org-table.el (org-table-collapse-header):
* lisp/org/org-plot.el (org--plot/prime-factors):
* lisp/org/org-agenda.el (org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org/ob-lua.el (org-babel-lua-read-string):
* lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/org/ob-core.el (org-babel-default-header-args):
* lisp/obsolete/mouse-sel.el (mouse-select):
(mouse-select-secondary):
* lisp/net/tramp.el (tramp-methods):
* lisp/net/eww.el (eww-accept-content-types):
* lisp/net/dictionary-connection.el (dictionary-connection-status):
* lisp/minibuffer.el (completion-flex--make-flex-pattern):
* lisp/mh-e/mh-mime.el (mh-have-file-command):
* lisp/mh-e/mh-limit.el (mh-subject-to-sequence):
(mh-subject-to-sequence-threaded):
(mh-subject-to-sequence-unthreaded):
* lisp/mail/feedmail.el (feedmail-queue-buffer-file-name):
(feedmail-vm-mail-mode):
* lisp/ls-lisp.el (ls-lisp--sanitize-switches):
* lisp/keymap.el (key-valid-p):
* lisp/international/ccl.el (ccl-compile-branch-blocks):
* lisp/image/image-converter.el (image-convert):
* lisp/gnus/spam.el (spam-backend-check):
* lisp/gnus/nnselect.el (nnselect-generate-artlist):
* lisp/gnus/nnmairix.el (nnmairix-widget-other):
* lisp/gnus/message.el (message-mailto):
* lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article):
* lisp/gnus/gnus-search.el (gnus-search-prepare-query):
* lisp/frame.el (frame-size-history):
* lisp/eshell/esh-var.el (eshell-parse-variable-ref):
* lisp/eshell/em-dirs.el (eshell-expand-multiple-dots):
* lisp/erc/erc-backend.el (erc-bounds-of-word-at-point):
* lisp/emulation/cua-rect.el (cua--rectangle-operation):
* lisp/emacs-lisp/text-property-search.el (text-property-search-forward):
* lisp/emacs-lisp/package.el (package-desc-suffix):
* lisp/emacs-lisp/faceup.el (faceup-test-explain):
* lisp/emacs-lisp/comp.el (comp-curr-allocation-class):
(comp-alloc-class-to-container):
(comp-add-cstrs):
(comp-remove-type-hints-func):
(batch-byte+native-compile):
* lisp/emacs-lisp/cl-macs.el (cl--optimize):
* lisp/elec-pair.el (electric-pair--syntax-ppss):
* lisp/doc-view.el (doc-view-doc-type):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-alist):
(semantic-symref-hit-to-tag-via-db):
(semantic-symref-hit-to-tag-via-buffer):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay):
* lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map):
* lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function):
* lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions):
* lisp/cedet/semantic.el (semantic-working-type):
* lisp/cedet/ede/files.el (ede-flush-directory-hash):
* lisp/calc/calc.el (calc--header-line):
* lisp/auth-source.el (auth-source-pick-first-password):
(auth-source--decode-octal-string):
* etc/themes/modus-themes.el (modus-themes--paren):
(modus-themes--agenda-habit):
* admin/cus-test.el (cus-test-vars-with-changed-state): Fix
quoting in doc strings.  In code examples, the ' character is
quoted with \\=, and regularize 'foo to `foo', and quote strings
like "foo" instead of 'foo'.

2 years agoFix map-into doc string example
Lars Ingebrigtsen [Fri, 22 Apr 2022 13:17:15 +0000 (15:17 +0200)]
Fix map-into doc string example

* lisp/emacs-lisp/map.el (map-into): Fix quote quoting in example.

2 years agoMake `C-u C-x =' be more verbose about invisible characters
Lars Ingebrigtsen [Fri, 22 Apr 2022 12:58:59 +0000 (14:58 +0200)]
Make `C-u C-x =' be more verbose about invisible characters

* lisp/descr-text.el (describe-text-properties-1): Note confusing
bits about invisible characters (bug#3400).

2 years agoAllow completion-ignore-case to be buffer-local
Lars Ingebrigtsen [Fri, 22 Apr 2022 12:34:50 +0000 (14:34 +0200)]
Allow completion-ignore-case to be buffer-local

* lisp/minibuffer.el (completing-read-default): Use the value of
completion-ignore-case from the current buffer (bug#12615).

2 years agoFix problem with (narrow-to-page 1) with point at point-max
Lars Ingebrigtsen [Fri, 22 Apr 2022 12:04:43 +0000 (14:04 +0200)]
Fix problem with (narrow-to-page 1) with point at point-max

* lisp/textmodes/page.el (forward-page): Make this work more
consistently if point is on bol (bug#20663).

2 years ago; Improve comments for a recently installed bugfix
Eli Zaretskii [Fri, 22 Apr 2022 12:18:56 +0000 (15:18 +0300)]
; Improve comments for a recently installed bugfix

* lisp/startup.el (command-line): Remove references to a wrong bug
number and improve comments for delaying the 'user-emacs-directory'
warning.  (Bug#25163)

2 years agoDon't transfer window attributes trying to find the XM drag window
Po Lu [Fri, 22 Apr 2022 11:43:42 +0000 (19:43 +0800)]
Don't transfer window attributes trying to find the XM drag window

* src/xterm.c (xm_get_drag_window): Select for impossible event
mask instead of asking for the window attributes.

2 years agoFix default frame name on Haiku
Po Lu [Fri, 22 Apr 2022 05:42:09 +0000 (05:42 +0000)]
Fix default frame name on Haiku

* src/haikufns.c (haiku_set_background_color)
(haiku_set_cursor_color, haiku_get_pixel, haiku_put_pixel)
(haiku_set_internal_border_width)
(haiku_set_inhibit_double_buffering)
(Fhaiku_mouse_absolute_pixel_position, Fxw_color_defined_p)
(Fxw_color_values, Fx_double_buffered_p)
(Fx_display_backing_store): Clean up coding style.
(haiku_set_name): Use correct default name and don't cons extra
string all the time.

* src/haikuterm.c (haiku_read_socket): Remove unused variable.
(haiku_term_init): Set default name.
(mark_haiku_display): Mark new field.

* src/haikuterm.h (struct haiku_display_info): New field
`default_name'.

2 years agoAdd an option to disable XI2 for debugging purposes
Po Lu [Fri, 22 Apr 2022 01:06:44 +0000 (09:06 +0800)]
Add an option to disable XI2 for debugging purposes

* src/xterm.c (handle_one_xevent): Accept resource
`disableInputExtension', which means to skip setting up the X
input extension.

2 years agoEUDC: Handle nil BOB button label
Thomas Fitzsimmons [Thu, 21 Apr 2022 21:24:29 +0000 (17:24 -0400)]
EUDC: Handle nil BOB button label

* lisp/net/eudc-bob.el (eudc-bob-make-button): Do not throw error
when label is nil.

2 years agoNew electric forward slash Eshell module
Sean Whitton [Sat, 16 Apr 2022 15:23:14 +0000 (08:23 -0700)]
New electric forward slash Eshell module

* lisp/eshell/em-elecslash.el: New file.
* etc/NEWS:
* doc/misc/eshell.texi (Electric forward slash): Document the module.
(Make / electric): Retitle to "Make / more electric", update, add
"@noindent", and standardize terminology.

2 years agoBind 'imenu' to 'M-g i' globally
Sean Whitton [Thu, 14 Apr 2022 14:12:41 +0000 (07:12 -0700)]
Bind 'imenu' to 'M-g i' globally

Another candidate was 'M-s i'.  Discussion on emacs-devel has led me
to conclude that most people will find 'M-g i' more intuitive and thus
easier to memorize.

* lisp/bindings.el (goto-map): Bind 'imenu' to 'M-g i' globally.
* etc/NEWS: Document the change.
* doc/emacs/programs.texi (Imenu):
* lisp/progmodes/cperl-mode.el: Replace 'M-x imenu' with 'M-g i'.

2 years agoRespect user-emacs-directory-warning in startup
Tino Calancha [Thu, 21 Apr 2022 15:27:50 +0000 (17:27 +0200)]
Respect user-emacs-directory-warning in startup

* lisp/startup.el (command-line): If user-emacs-directory is not
accessible, delay to show a warning until all command line args
are processed (bug#25163).

2 years agoAllow searching for regexps with a prefix
Lars Ingebrigtsen [Thu, 21 Apr 2022 15:05:23 +0000 (17:05 +0200)]
Allow searching for regexps with a prefix

* doc/misc/info.texi (Search Index): Mention it.

* lisp/info.el (Info-find-node): Allow not signalling errors.
(Info-apropos-matches): Allow taking a regexp.
(info-apropos): Prefix now means looking for a regexp.

2 years agoFix indentation in copy-region-as-kill
Lars Ingebrigtsen [Thu, 21 Apr 2022 14:23:02 +0000 (16:23 +0200)]
Fix indentation in copy-region-as-kill

* lisp/simple.el (copy-region-as-kill): Fix indendation.

2 years agoClarify cl-incf/decf doc strings
Lars Ingebrigtsen [Thu, 21 Apr 2022 13:11:25 +0000 (15:11 +0200)]
Clarify cl-incf/decf doc strings

* lisp/emacs-lisp/cl-lib.el (cl-incf):
(cl-decf): Clarify that nil isn't a valid value for X (bug#31715).

2 years ago* src/haiku_support.cc (gui_abort): Get rid of extern "C" declarations.
Po Lu [Thu, 21 Apr 2022 12:41:09 +0000 (12:41 +0000)]
* src/haiku_support.cc (gui_abort): Get rid of extern "C" declarations.

2 years agoLink dired-do-find-regexp-and-replace to query-replace
Lars Ingebrigtsen [Thu, 21 Apr 2022 11:48:16 +0000 (13:48 +0200)]
Link dired-do-find-regexp-and-replace to query-replace

* lisp/dired-aux.el (dired-do-find-regexp-and-replace): Link to
`query-replace' (bug#55050).

2 years agoUnbreak build with MinGW64.
Eli Zaretskii [Thu, 21 Apr 2022 10:53:57 +0000 (13:53 +0300)]
Unbreak build with MinGW64.

* src/w32.c (CONSOLE_FONT_INFO): Define only when _WIN32_WINNT is
less than _WIN32_WINNT_WINXP, i.e. for building with mingw.org's
MinGW.

2 years agognus: fix %a in topic line
Andreas Schwab [Wed, 20 Apr 2022 15:05:32 +0000 (17:05 +0200)]
gnus: fix %a in topic line

* lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line): Also
bind `entries'.

2 years agoClean up PGTK code some more
Po Lu [Thu, 21 Apr 2022 08:30:03 +0000 (16:30 +0800)]
Clean up PGTK code some more

* src/pgtkterm.c (x_alloc_lighter_color): Simplify.  Do not try
to "allocate" colors, remove unused flag and impossible return
value.
(pgtk_clear_frame): Remove unused code from NS port and remove
incorrect workaround for now-fixed double buffering.
(pgtk_make_frame_visible_wait_for_map_event_cb)
(x_clear_glyph_string_rect, x_draw_glyph_string_background)
(x_draw_glyph_string_foreground)
(x_draw_composite_glyph_string_foreground)
(x_draw_glyphless_glyph_string_foreground)
(x_fill_trapezoid_for_relief, x_erase_corners_for_relief)
(pgtk_setup_relief_color, x_draw_relief_rect, x_draw_box_rect)
(x_draw_glyph_string_box, x_get_scale_factor)
(x_draw_horizontal_wave, pgtk_draw_horizontal_wave)
(x_draw_underwave, x_draw_image_relief)
(x_draw_glyph_string_bg_rect, x_cr_draw_image)
(x_draw_image_foreground, x_draw_image_glyph_string)
(x_draw_stretch_glyph_string, pgtk_draw_glyph_string)
(x_draw_hollow_cursor, x_draw_bar_cursor, pgtk_draw_window_cursor)
(pgtk_cr_draw_image, pgtk_draw_fringe_bitmap, hourglass_cb)
(pgtk_show_hourglass, pgtk_redraw_scroll_bars, pgtk_flash)
(x_create_toolkit_scroll_bar)
(x_create_horizontal_toolkit_scroll_bar, x_scroll_bar_create)
(x_scroll_bar_remove, pgtk_set_vertical_scroll_bar)
(pgtk_set_horizontal_scroll_bar, pgtk_judge_scroll_bars)
(x_new_focus_frame, x_focus_changed, enter_notify_event)
(leave_notify_event, focus_in_event, focus_out_event)
(pgtk_cr_accumulate_data): Clean up coding style, rename
functions copied over from X and modified, and remove duplicate
definition of at least one function.

2 years agoDon't leave xm drag initiator info around
Po Lu [Thu, 21 Apr 2022 05:52:50 +0000 (13:52 +0800)]
Don't leave xm drag initiator info around

* src/xterm.c (x_cleanup_drag_and_drop)
(x_begin_drag_and_drop): Don't confuse GTK+ 2.x by leaving drag
initiator info around after DND completes.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Thu, 21 Apr 2022 04:30:28 +0000 (06:30 +0200)]
Merge from origin/emacs-28

dbb2dd6939 ; Fix wording of "File Notifications" in the ELisp manual

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Thu, 21 Apr 2022 04:30:28 +0000 (06:30 +0200)]
; Merge from origin/emacs-28

The following commits were skipped:

e6c2a2497d Update from gnulib
91d4898d5c Revert prompting changes in viper-cmd

2 years agoUse a cache on Haiku to avoid constantly reading fonts during font lookup
Po Lu [Thu, 21 Apr 2022 03:09:22 +0000 (03:09 +0000)]
Use a cache on Haiku to avoid constantly reading fonts during font lookup

* src/haiku_font_support.cc (struct font_object_cache_bucket):
New struct.
(language_code_points): Make `int'.
(hash_string): New function.
(cache_font_object_data, lookup_font_object_data)
(font_object_has_chars): New functions.
(font_check_wanted_chars, font_check_one_of)
(font_check_language): Lookup in cached font object instead.
(be_init_font_data, be_evict_font_cache): New functions.

* src/haiku_support.h (struct haiku_font_pattern): Make
`uint32_t's ints instead.
* src/haikufont.c (haikufont_apply_registry, syms_of_haikufont):
Adjust for those changes.

* src/haikuterm.c (haiku_frame_up_to_date): Clear font lookup
cache every 50 updates.

2 years agoMake some frame params work on Haiku tooltip frames
Po Lu [Thu, 21 Apr 2022 00:37:07 +0000 (00:37 +0000)]
Make some frame params work on Haiku tooltip frames

* src/haiku_support.cc (RecomputeFeel): Handle tooltips.
(BWindow_set_tooltip_decoration): Use RecomputeFeel instead of
setting window feel by hand.

2 years agoMore encode-time pitfall doc fixes
Paul Eggert [Wed, 20 Apr 2022 19:03:19 +0000 (12:03 -0700)]
More encode-time pitfall doc fixes

* doc/lispref/os.texi (Time Conversion): Improve discussion of
encode-time pitfalls based on comments by Max Nikulin (Bug#54764#63).

2 years ago; Fix wording of "File Notifications" in the ELisp manual
Eli Zaretskii [Wed, 20 Apr 2022 17:00:15 +0000 (20:00 +0300)]
; Fix wording of "File Notifications" in the ELisp manual

* doc/lispref/os.texi (File Notifications): Fix typos,
punctuation, and wording.

2 years agoImprove documentation of 'scheme-indent-function' property
Eli Zaretskii [Wed, 20 Apr 2022 16:36:59 +0000 (19:36 +0300)]
Improve documentation of 'scheme-indent-function' property

* lisp/progmodes/scheme.el: Extend and clarify the commentary
regarding the 'scheme-indent-function' property of special forms.

2 years agoDefine indentation behavior for a few more special Scheme forms
Jean Abou Samra [Tue, 19 Apr 2022 21:40:29 +0000 (23:40 +0200)]
Define indentation behavior for a few more special Scheme forms

* lisp/progmodes/scheme.el: Define 'scheme-indent-function'
property for 'and-let*', 'with-syntax', 'eval-when;, and
pattern matching macros.  (Bug#55033)

Copyright-paperwork-exempt: yes

2 years agoUpdate from gnulib
Paul Eggert [Wed, 20 Apr 2022 02:16:29 +0000 (19:16 -0700)]
Update from gnulib

(cherry picked from commit 992cf3cb675e074079341cc54c3b16d37a8b9ca8)

This is a partial backport from master: it only includes the changes below.

* lib/mini-gmp.c (gmp_assert_nocarry): Avoid many Clang
unused-variable warnings when building with optimisation.
* lib/verify.h (_GL_HAVE__STATIC_ASSERT): Modify condition for using
_Static_assert to cope with older Apple builds of Clang exposing
misleading compiler version numbers.  See discussion starting at
https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg00779.html

2 years agoImplement `below' z-group on Haiku
Po Lu [Wed, 20 Apr 2022 11:47:10 +0000 (11:47 +0000)]
Implement `below' z-group on Haiku

* src/haiku_support.cc (BWindow_set_z_group): Handle
Z_GROUP_BELOW by setting the B_AVOID_FRONT flag.

2 years agoEnsure forward progress in bibtex-map-entries
Lars Ingebrigtsen [Wed, 20 Apr 2022 11:07:34 +0000 (13:07 +0200)]
Ensure forward progress in bibtex-map-entries

* lisp/textmodes/bibtex.el (bibtex-map-entries): Ensure forward
progress (bug#55036).

2 years agoFix the outline level in the Emacs NEWS modes
Lars Ingebrigtsen [Wed, 20 Apr 2022 10:48:55 +0000 (12:48 +0200)]
Fix the outline level in the Emacs NEWS modes

* lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix
the outline level (bug#54993).

2 years agoRevert prompting changes in viper-cmd
Lars Ingebrigtsen [Tue, 19 Apr 2022 11:48:06 +0000 (13:48 +0200)]
Revert prompting changes in viper-cmd

* lisp/emulation/viper-cmd.el (viper-quote-region)
(viper-read-string-with-history, viper-query-replace): Revert
prompting changes done in 50512e3 -- the way viper prompts in
command mode is special (bug#55007).

Do not merge to master.

2 years ago; Fix repeated lambda argnames in files-tests.el.
Basil L. Contovounesios [Wed, 20 Apr 2022 10:20:57 +0000 (13:20 +0300)]
; Fix repeated lambda argnames in files-tests.el.

2 years agoFix build for --enable-checking=structs
Basil L. Contovounesios [Wed, 20 Apr 2022 09:52:22 +0000 (12:52 +0300)]
Fix build for --enable-checking=structs

* src/pdumper.c (dump_subr): Update Lisp_Subr hash after last change
of 2022-04-18 "Port struct Lisp_Subr to C99".

2 years agoReset Motif DND protocol numbers when writing targets table
Po Lu [Wed, 20 Apr 2022 08:06:06 +0000 (16:06 +0800)]
Reset Motif DND protocol numbers when writing targets table

* src/xterm.c (xm_setup_dnd_targets): Set header.protocol to 0
when writing table.

2 years agoImplement `above' z-group on Haiku
Po Lu [Wed, 20 Apr 2022 07:37:19 +0000 (07:37 +0000)]
Implement `above' z-group on Haiku

* src/haiku_support.cc (class EmacsWindow): New field `z_group'.
(RecomputeFeel): New function.
(ParentTo, BWindow_set_override_redirect): Use that instead
instead of manually juggling the window feel around.
(BWindow_set_z_group): New function.

* src/haiku_support.h (enum haiku_z_group): New enum.
* src/haikufns.c (haiku_set_parent_frame): Clean up coding
style.
(haiku_set_z_group): New function.
(haiku_create_frame): Always set z group after window creation,
like on X.
(haiku_frame_parm_handlers): Add `haiku_set_z_group'.

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Wed, 20 Apr 2022 04:30:27 +0000 (06:30 +0200)]
; Merge from origin/emacs-28

The following commit was skipped:

1030cc1897 Fix regression with multiple mode: entries in the prop line

2 years agoFix enabling menu bar multiple times on Haiku
Po Lu [Wed, 20 Apr 2022 03:06:58 +0000 (03:06 +0000)]
Fix enabling menu bar multiple times on Haiku

* src/haiku_support.cc (FrameResized): Adjust width and height
appropriately when sending menu bar resize event.
* src/haikufns.c (haiku_set_menu_bar_lines): Don't always reset
FRAME_MENU_BAR_LINES and FRAME_MENU_BAR_HEIGHT.
* src/haikumenu.c (free_frame_menubar): Clear Haiku menu bar.
(set_frame_menubar): Fix coding style.
* src/haikuterm.c (haiku_read_socket): Don't adjust height here
anymore.

2 years agoUpdate from gnulib
Paul Eggert [Wed, 20 Apr 2022 02:16:29 +0000 (19:16 -0700)]
Update from gnulib

2 years agoPacify gcc -std=c99 with printf %p
Paul Eggert [Wed, 20 Apr 2022 02:02:05 +0000 (19:02 -0700)]
Pacify gcc -std=c99 with printf %p

* src/print.c (print_vectorlike): Assign pointer-to-function
to void * before printing it with %p, as the C standard
doesn’t bless printing function pointers with %p.

2 years agoPacify gcc -std=c99
Paul Eggert [Wed, 20 Apr 2022 02:00:22 +0000 (19:00 -0700)]
Pacify gcc -std=c99

* src/sysdep.c (system_process_attributes): Use %llu instead of
%Lu for sscanf, as %llu is standard and %Lu is not, and the latter
can provoke warnings if gcc is used pedantically.

2 years agoCheck for integer overflow when writing Motif targets tables
Po Lu [Wed, 20 Apr 2022 01:10:48 +0000 (09:10 +0800)]
Check for integer overflow when writing Motif targets tables

* src/xterm.c (xm_setup_dnd_targets): Check for integer overflow
when adding list to target table.

2 years agoFix previous description of fallback order
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:36:04 +0000 (18:36 +0200)]
Fix previous description of fallback order

* doc/emacs/custom.texi (Specifying File Variables): Document
fallback mode order.

2 years agoDocument how to specify fallback modes
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:21:21 +0000 (18:21 +0200)]
Document how to specify fallback modes

* doc/emacs/custom.texi (Specifying File Variables): Document
fallback mode order.

2 years agoFix regression with multiple mode: entries in the prop line
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:08:20 +0000 (18:08 +0200)]
Fix regression with multiple mode: entries in the prop line

* lisp/files.el (hack-local-variables): Fix regression with multiple
mode: entries in the prop line.

Do not merge to master.

2 years agoFix regression with multiple mode: entries in the prop line
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:06:31 +0000 (18:06 +0200)]
Fix regression with multiple mode: entries in the prop line

* lisp/files.el (hack-local-variables--find-variables): Use the
final mode: line (which is the same as having several mode: bits
in the header line.

2 years agoAllow several mode: elements in the local variable section
Lars Ingebrigtsen [Tue, 19 Apr 2022 14:22:37 +0000 (16:22 +0200)]
Allow several mode: elements in the local variable section

* etc/NEWS (mode): Fall back on outline-mode in older Emacsen.
* lisp/files.el (hack-local-variables--find-variables): Use the
final mode: line (which is the same as having several mode: bits
in the header line.

2 years agoFix GCC warnings when CHECK_LISP_OBJECT_TYPE
Stefan Monnier [Tue, 19 Apr 2022 12:25:19 +0000 (08:25 -0400)]
Fix GCC warnings when CHECK_LISP_OBJECT_TYPE

* src/lisp.h (lisp_h_Qni): New macro.
(DEFUN): Use it.
* src/alloc.c (syms_of_alloc): Use it.

* src/bytecode.c (Fbyte_code): Fix Lisp_Object/int mixup.

2 years agoRevert prompting changes in viper-cmd
Lars Ingebrigtsen [Tue, 19 Apr 2022 11:48:06 +0000 (13:48 +0200)]
Revert prompting changes in viper-cmd

* lisp/emulation/viper-cmd.el (viper-quote-region)
(viper-read-string-with-history, viper-query-replace): Revert
prompting changes done in 50512e3 -- the way viper prompts in
command mode is special (bug#55007).

2 years agoBe more resilient against invalid headers in mml-generate-mime
Lars Ingebrigtsen [Tue, 19 Apr 2022 11:42:17 +0000 (13:42 +0200)]
Be more resilient against invalid headers in mml-generate-mime

* lisp/gnus/mml.el (mml-generate-mime): Don't bug out when called
with invalid headers (bug#55014).

2 years agoFix handling of intspecs as string by rcirc-define-command
Philip Kaludercic [Tue, 19 Apr 2022 11:16:51 +0000 (13:16 +0200)]
Fix handling of intspecs as string by rcirc-define-command

* rcirc.el (rcirc-define-command): Check if an interactive
  specification is a string, in which case it was to be wrapped in a
  list so that the result of its interpretation is passed as the first
  argument of the command resulting from the macro expansion.

2 years agoFix `x-mouse-click-focus-ignore-position' for odd coincidences across displays
Po Lu [Tue, 19 Apr 2022 10:51:28 +0000 (18:51 +0800)]
Fix `x-mouse-click-focus-ignore-position' for odd coincidences across displays

* src/xterm.c (handle_one_xevent): Save the display alongside
the next mouse click timeout.
(x_delete_display): Clear that display here if applicable.
(x_initialize): Likewise.

2 years agoFix dimensions of console window of restarted Emacs on MS-Windows
Eli Zaretskii [Tue, 19 Apr 2022 09:50:01 +0000 (12:50 +0300)]
Fix dimensions of console window of restarted Emacs on MS-Windows

* src/w32.c (get_console_font_size): New function.
(w32_reexec_emacs): Call 'get_console_font_size' to set up the
dimensions of the restarted Emacs's console window to the same
values as that of the original Emacs.

2 years agoDeal with Motif drag window related races
Po Lu [Tue, 19 Apr 2022 07:47:34 +0000 (15:47 +0800)]
Deal with Motif drag window related races

* src/xterm.c (xm_drag_window_error_handler): New function.
(xm_get_drag_window): If a drag window was created and we have
the temp display grabbed, use that instead.

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Tue, 19 Apr 2022 04:51:47 +0000 (06:51 +0200)]
; Merge from origin/emacs-28

The following commits were skipped:

1b77362771 Avoid hangs in python-mode with debug-on-error set
4684b8e62f Fix major-mode setting regression when there's a mode: cookie

2 years agoMinor cleanups to Haiku menu code
Po Lu [Tue, 19 Apr 2022 04:39:37 +0000 (04:39 +0000)]
Minor cleanups to Haiku menu code

* src/haiku_draw_support.cc (BView_SetHighColorForVisibleBell):
Delete function.
* src/haiku_font_support.cc (BFont_dat): Rename to
`BFont_metrics'.
* src/haiku_support.cc (DrawContent): Use correct UI color for
control text.
* src/haiku_support.h (HAIKU_MODIFIER_ALT): Turn into enum.
(enum haiku_modifier_specification): New enum.
* src/haikufont.c (haikufont_open, haikufont_close): Fix coding
style.

2 years agoFix last change for GTK 2
Po Lu [Tue, 19 Apr 2022 03:18:25 +0000 (11:18 +0800)]
Fix last change for GTK 2

* src/xfns.c (x_set_alpha_background):
* src/xterm.c (x_update_opaque_region): Move some ifdefs around.

2 years agoFix opaque region treatment on GTK 3
Po Lu [Tue, 19 Apr 2022 03:13:11 +0000 (11:13 +0800)]
Fix opaque region treatment on GTK 3

* src/xfns.c (x_set_alpha_background):
* src/xterm.c (x_update_opaque_region): Update opaque region for
tooltip frames the correct way on GTK.

2 years agoPort struct Lisp_Subr to C99
Paul Eggert [Tue, 19 Apr 2022 02:44:03 +0000 (19:44 -0700)]
Port struct Lisp_Subr to C99

* src/lisp.h (struct Lisp_Subr): Don’t use an anonymous union,
a feature missing from C99 and not supported by older OS X.
All uses changed.

2 years agoPort module_bignum_count_max to strict C
Paul Eggert [Tue, 19 Apr 2022 02:29:49 +0000 (04:29 +0200)]
Port module_bignum_count_max to strict C

* src/emacs-module.c (module_bignum_count_max): Make
this a macro, not an enum, since it might not fit into
int as C99 requires.

2 years agoTell those using exclusively X not to use the PGTK port
Sean Whitton [Tue, 19 Apr 2022 02:43:32 +0000 (19:43 -0700)]
Tell those using exclusively X not to use the PGTK port

* INSTALL (Alternative window systems): Tell those using exclusively X
not to use the PGTK port.

2 years agoFix display of glyphless characters on Haiku
Po Lu [Tue, 19 Apr 2022 01:15:33 +0000 (01:15 +0000)]
Fix display of glyphless characters on Haiku

* src/haikuterm.c (haiku_draw_glyph_string_foreground): Fix pen
size when drawing composite string w/o font.
(haiku_draw_glyphless_glyph_string_foreground): Correctly
display glyphless character rectangle.

2 years agoUse "@code{nil}" in documentation
Paul Eggert [Mon, 18 Apr 2022 20:08:26 +0000 (13:08 -0700)]
Use "@code{nil}" in documentation

2 years agoRemove obsolete footnote
Paul Eggert [Mon, 18 Apr 2022 19:57:40 +0000 (12:57 -0700)]
Remove obsolete footnote

Emacs no longer warns about timestamps like (1 . 1000).

2 years agoFix glyphless glyph display on NS (bug#54970)
Alan Third [Sun, 17 Apr 2022 20:15:05 +0000 (21:15 +0100)]
Fix glyphless glyph display on NS (bug#54970)

* src/nsterm.m (ns_draw_glyphless_glyph_string_foreground): New
function.
(ns_draw_glyph_string): Use the new function.
* src/nsfont.m (nsfont_draw): Fix the location the glyphs are drawn,
and also which glyphs are drawn.
(ns_glyph_metrics): Reverse ascent and descent.

2 years ago; * doc/emacs/mini.texi (Completion Commands): Remove duplicate @findex.
Juri Linkov [Mon, 18 Apr 2022 19:16:17 +0000 (22:16 +0300)]
; * doc/emacs/mini.texi (Completion Commands): Remove duplicate @findex.

2 years agoMinor improvements in 'restart-emacs' on MS-Windows
Eli Zaretskii [Mon, 18 Apr 2022 18:04:57 +0000 (21:04 +0300)]
Minor improvements in 'restart-emacs' on MS-Windows

* src/w32.c (w32_reexec_emacs): Explicitly request a new console
for the restarted Emacs -nw, and specify its dimensions.  Specify
NULL instead of security attributes, per examples on the Internet.
* src/w32console.c (initialize_w32_display): Check errors in call
to GetConsoleCursorInfo.

2 years agoByte compiler: correct output warning message positions
Alan Mackenzie [Mon, 18 Apr 2022 15:16:54 +0000 (15:16 +0000)]
Byte compiler: correct output warning message positions

Correct the algorithm for determining the warning position to get the first
symbol-with-position in byte-compile--form-stack.

* lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos): Function
renamed and amended from byte-compile--first-symbol.
(byte-compile--warning-source-offset): Call the new function above rather than
the old one.

2 years agoMake isearch-lax-whitespace a user option
Lars Ingebrigtsen [Mon, 18 Apr 2022 11:36:05 +0000 (13:36 +0200)]
Make isearch-lax-whitespace a user option

* lisp/isearch.el (isearch-lax-whitespace): Make into a defcustom
(bug#20351).

2 years agoAvoid hangs in python-mode with debug-on-error set
Lars Ingebrigtsen [Mon, 18 Apr 2022 11:17:32 +0000 (13:17 +0200)]
Avoid hangs in python-mode with debug-on-error set

* lisp/progmodes/python.el (python-nav-end-of-statement): Avoid
using cl-assert here, because this is called from the font-lock
machinery, and if debug-on-error is set here, we'll hang Emacs
(bug#54996).

Do not merge to master.

2 years agoAvoid hangs in python-mode with debug-on-error set
Lars Ingebrigtsen [Mon, 18 Apr 2022 11:17:32 +0000 (13:17 +0200)]
Avoid hangs in python-mode with debug-on-error set

* lisp/progmodes/python.el (python-nav-end-of-statement): Avoid
using cl-assert here, because this is called from the font-lock
machinery, and if debug-on-error is set here, we'll hang Emacs
(bug#54996).

2 years agoMake it easier to use Emacs as a script interpreter
Lars Ingebrigtsen [Mon, 18 Apr 2022 10:58:54 +0000 (12:58 +0200)]
Make it easier to use Emacs as a script interpreter

* doc/emacs/cmdargs.texi (Initial Options): Document -x.
* lisp/startup.el (command-line-1): Add new -scripteval.
(command-line--eval-script): New function.

* src/emacs.c (main): Transform -x to -scripteval.
(standard_args): Add -x (bug#20682).

2 years agoAdd missing Motif atoms
Po Lu [Mon, 18 Apr 2022 10:38:35 +0000 (18:38 +0800)]
Add missing Motif atoms

* src/xselect.c (symbol_to_x_atom):
(x_atom_to_symbol):
(syms_of_xselect): Optimize for XmTRANSFER_SUCCESS and
XmTRANSFER_FAILURE as well.

2 years agoByte compiler: remove symbol positions from byte-switch tables
Alan Mackenzie [Mon, 18 Apr 2022 10:19:54 +0000 (10:19 +0000)]
Byte compiler: remove symbol positions from byte-switch tables

This fixes bug #54990.

* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): Remove positions from
symbols with positions in byte-switch tables, by temporarily removing the
entries from the table, and reinserting them amended.

2 years agoClean up view-emacs-news code
Lars Ingebrigtsen [Mon, 18 Apr 2022 09:53:59 +0000 (11:53 +0200)]
Clean up view-emacs-news code

* lisp/help.el (view-emacs-news): Remove workaround after fixing
mode: cookie error.

2 years agoUnify local variable initialisation in url-http
Nacho Barrientos [Mon, 18 Apr 2022 09:36:52 +0000 (11:36 +0200)]
Unify local variable initialisation in url-http

* lisp/url/url-http.el (url-http-chunked-last-crlf-missing): Treat
url-http-chunked-last-crlf-missing as any other buffer variable by
declaring and initialising it the same way as the other related
ones (bug#54989).

Copyright-paperwork-exempt: yes

2 years agoMake `restart-emacs' work when Emacs is started with --chdir
Lars Ingebrigtsen [Mon, 18 Apr 2022 09:31:28 +0000 (11:31 +0200)]
Make `restart-emacs' work when Emacs is started with --chdir

* src/emacs.c (find_emacs_executable): Rename from
load_pdump_find_executable and always define.
(load_pdump): Return the executable.
(main): Store the executable.
(Fkill_emacs): Use the stored executable so that --chdir works
with relative executable names, and so that we attempt to restart
the same executable and not some other Emacs from PATH.

2 years agoImprove `restart-emacs' error reporting
Lars Ingebrigtsen [Mon, 18 Apr 2022 09:02:55 +0000 (11:02 +0200)]
Improve `restart-emacs' error reporting

* src/emacs.c (Fkill_emacs): Do better error reporting on restarting.

2 years agoMake "restart" erroring slightly more reliable
Lars Ingebrigtsen [Mon, 18 Apr 2022 08:50:45 +0000 (10:50 +0200)]
Make "restart" erroring slightly more reliable

* src/emacs.c (Fkill_emacs): Use emacs_perror for the "restart"
errors -- we've already shut down Emacs at this point, so the
normal erroring machinery isn't reliable.

2 years agoFix major-mode setting regression when there's a mode: cookie
Lars Ingebrigtsen [Mon, 18 Apr 2022 08:37:14 +0000 (10:37 +0200)]
Fix major-mode setting regression when there's a mode: cookie

* lisp/files.el (hack-local-variables): Fix regression in setting
the major mode when there are mode: cookies in the file (bug#54993).

Do not merge to master.

2 years agoFix major-mode setting regression when there's a mode: cookie
Lars Ingebrigtsen [Mon, 18 Apr 2022 08:36:32 +0000 (10:36 +0200)]
Fix major-mode setting regression when there's a mode: cookie

* lisp/files.el (hack-local-variables): Fix regression in setting
the major mode when there are mode: cookies in the file (bug#54993).

2 years agoStop skipping ShapeNotify events during DND on GTK+
Po Lu [Mon, 18 Apr 2022 08:08:19 +0000 (16:08 +0800)]
Stop skipping ShapeNotify events during DND on GTK+

* src/xterm.c (handle_one_xevent): Don't skip ShapeNotify events
because we can't send these events back to GDK manually.

2 years agoClarify computation of header line vpos
Po Lu [Mon, 18 Apr 2022 07:55:40 +0000 (15:55 +0800)]
Clarify computation of header line vpos

* src/dispnew.c (update_text_area): Test vpos is more than 1
only if is both a tab and header line.  Reported by Eli
Zaretskii <eliz@gnu.org>.

2 years agoFix 'restart-emacs' in -nw mode on MS-Windows
Eli Zaretskii [Mon, 18 Apr 2022 07:05:15 +0000 (10:05 +0300)]
Fix 'restart-emacs' in -nw mode on MS-Windows

* src/w32.c (openat): #ifdef away: not used.
(w32_reexec_emacs): Kludgey solution for restarting Emacs in the
"-nw" mode.

2 years agoFix glyph skipping optimization when a tab line is enabled
Po Lu [Mon, 18 Apr 2022 05:23:23 +0000 (13:23 +0800)]
Fix glyph skipping optimization when a tab line is enabled

* src/dispnew.c (update_text_area): Compute vpos of header line
correctly when window has tab line.