]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoExtend bookmark menu with with handler type column
Matthias Meulien [Tue, 15 Feb 2022 22:39:02 +0000 (23:39 +0100)]
Extend bookmark menu with with handler type column

* lisp/bookmark.el (bookmark-bmenu--revert): Extend table entries with
handler type.
(bookmark-bmenu-mode): Add handler type column.
* lisp/doc-view.el (doc-view-bookmark-jump): Set bookmark handler type.
* lisp/help-mode.el (help-bookmark-jump): Set bookmark handler type.
* lisp/image-dired.el (image-dired-bookmark-jump): Set bookmark handler type.
* lisp/info.el (Info-bookmark-jump): Set bookmark handler type.
* lisp/net/eww.el (eww-bookmark-jump): Set bookmark handler type.
* lisp/vc/vc-dir.el (vc-dir-bookmark-jump): Set bookmark handler type.
* lisp/woman.el (woman-bookmark-jump): Set bookmark handler type.

3 years agoUpdate modus-themes to version 2.1.0
Protesilaos Stavrou [Thu, 17 Feb 2022 11:15:39 +0000 (13:15 +0200)]
Update modus-themes to version 2.1.0

* doc/misc/modus-themes.org (Customization Options): Document new user
options and relevant changes.
(Option for links, Option for box buttons)
(Option for completion framework aesthetics, Option for mail citations)
(Option for intense markup in Org and others)
(Option for diff buffer looks, Option for org-mode block styles)
(Option for Org agenda constructs)
(Option for the headings' overall style): Update user options.
(More accurate colors in terminal emulators): Add section on how to
improve the accuracy of color reproduction in terminal emulators.
(Case-by-case face specs using the themes' palette)
(Face specs at scale using the themes' palette, Override colors)
(Override colors through blending, Custom Org user faces): Improve
wording.
(Custom Org emphasis faces): Add section about bespoke faces for Org
emphasis markers.
(Backdrop for pdf-tools): Improve sample code.
(Ediff without diff color-coding): Add section about user-level
changes to the style of Ediff buffers.
(Full support for packages or face groups): Update lists of supported
packages.
(Indirectly covered packages): Update list of indirectly supported
packages.
(Note on underlines in compilation buffers): Clarify wording.
(Note on EWW and Elfeed fonts): Be more specific about 'shr' faces.
(Are these color schemes?): Answer frequently asked question.
(Acknowledgements): Update acknowledgements' section.

* etc/themes/modus-themes.el (modus-themes-operandi-colors)
(modus-themes-vivendi-colors): Update color palettes.
(modus-themes-subtle-red, modus-themes-subtle-green)
(modus-themes-subtle-yellow, modus-themes-subtle-blue)
(modus-themes-subtle-magenta, modus-themes-subtle-cyan)
(modus-themes-subtle-neutral, modus-themes-intense-red)
(modus-themes-intense-green, modus-themes-intense-yellow)
(modus-themes-intense-blue, modus-themes-intense-magenta)
(modus-themes-intense-cyan, modus-themes-intense-neutral)
(modus-themes-refine-red, modus-themes-refine-green)
(modus-themes-refine-yellow, modus-themes-refine-blue)
(modus-themes-refine-magenta, modus-themes-refine-cyan)
(modus-themes-nuanced-red, modus-themes-nuanced-green)
(modus-themes-nuanced-yellow, modus-themes-nuanced-blue)
(modus-themes-nuanced-magenta, modus-themes-nuanced-cyan)
(modus-themes-special-cold, modus-themes-special-mild)
(modus-themes-special-warm, modus-themes-special-calm)
(modus-themes-diff-added, modus-themes-diff-changed)
(modus-themes-diff-removed, modus-themes-diff-refine-added)
(modus-themes-diff-refine-changed, modus-themes-diff-refine-removed)
(modus-themes-diff-focus-added, modus-themes-diff-focus-changed)
(modus-themes-diff-focus-removed, modus-themes-diff-heading)
(modus-themes-heading-1, modus-themes-heading-2, modus-themes-heading-3)
(modus-themes-heading-4, modus-themes-heading-5, modus-themes-heading-6)
(modus-themes-heading-7, modus-themes-heading-8, modus-themes-hl-line)
(modus-themes-variable-pitch, modus-themes-lang-note)
(modus-themes-lang-warning, modus-themes-lang-error)
(modus-themes-reset-soft, modus-themes-reset-hard): Fix typo in
':group'.
(modus-themes-markup-code): Add face.
(modus-themes--headings-choice, modus-themes-headings)
(modus-themes-org-agenda): Update documentation about typographic
weights.
(modus-themes-org-blocks, modus-themes-completions): Update doc string
and add new stylistic variant.
(modus-themes-intense-markup): Deprecate old user option.  Replace it
with 'modus-themes-markup'.
(modus-themes-mail-citations): Update doc string and add another
stylistic variant.
(modus-themes-box-buttons): Add new user option.
(modus-themes--slant): Tweak how slant is applied.
(modus-themes--markup, modus-themes--prompt, modus-themes--paren)
(modus-themes--syntax-foreground, modus-themes--syntax-extra)
(modus-themes--syntax-string, modus-themes--syntax-comment)
(modus-themes--heading, modus-themes--agenda-structure)
(modus-themes--agenda-habit, modus-themes--org-block-delim)
(modus-themes--mode-line-attrs, modus-themes--standard-completions)
(modus-themes--link, modus-themes--link-color, modus-themes--region)
(modus-themes--hl-line, modus-themes--mail-cite): Tweak private
functions.
(modus-themes--button): Adjust private function.
(modus-themes--heading-weights): Deprecate it.  Replace by
'modus-themes-weights'.
(modus-themes-faces): Update faces.

* etc/themes/modus-vivendi-theme.el
* etc/themes/modus-operandi-theme.el: Bump version number.

For a detailed change log, read:
<https://protesilaos.com/codelog/2022-02-17-modus-themes-2-1-0/>.

3 years agoHave setopt check types
Lars Ingebrigtsen [Thu, 17 Feb 2022 11:31:12 +0000 (12:31 +0100)]
Have setopt check types

* doc/lispref/variables.texi (Setting Variables): Note type checking.
* lisp/cus-edit.el (setopt--set): New function to avoid having
Customize saving values, too.
(setopt): Use it.

3 years agoFix warning during dumping on MS-DOS
Po Lu [Thu, 17 Feb 2022 11:10:24 +0000 (19:10 +0800)]
Fix warning during dumping on MS-DOS

* lisp/cus-start.el (standard): Filter out
`process-error-pause-time' on MS-DOS.

3 years agoPrevent menu items leak if x-pre-popup-menu-hook signals
Po Lu [Thu, 17 Feb 2022 10:01:30 +0000 (18:01 +0800)]
Prevent menu items leak if x-pre-popup-menu-hook signals

* src/menu.c (x_popup_menu_1): Make sure menu items are
discarded if the pre popup menu hook signals.

3 years agoFix problem with "~" in Tramp
Michael Albinus [Thu, 17 Feb 2022 09:40:52 +0000 (10:40 +0100)]
Fix problem with "~" in Tramp

* lisp/net/tramp.el (tramp-handle-substitute-in-file-name):
Remove special handling of "~" in localname.  (Bug#53053)

3 years ago* src/xterm.c (x_init_master_valuators): Clear `pending_enter_reset'.
Po Lu [Thu, 17 Feb 2022 05:34:01 +0000 (13:34 +0800)]
* src/xterm.c (x_init_master_valuators): Clear `pending_enter_reset'.

3 years agoImprove handling of XI2 wheel movement
Po Lu [Thu, 17 Feb 2022 05:25:01 +0000 (13:25 +0800)]
Improve handling of XI2 wheel movement

* src/xterm.c (handle_one_xevent): Process movement in all
directions and send it as a single event.

3 years agoFix SIGFPE on some fonts when calculating their average width on Haiku
Po Lu [Thu, 17 Feb 2022 02:32:55 +0000 (02:32 +0000)]
Fix SIGFPE on some fonts when calculating their average width on Haiku

* src/haiku_font_support.cc (estimate_font_ascii): Avoid divison
by zero.

3 years ago* src/emacsgtkfixed.c (XSetWMSizeHints): Improve fix for bug#8919.
Po Lu [Thu, 17 Feb 2022 02:28:02 +0000 (10:28 +0800)]
* src/emacsgtkfixed.c (XSetWMSizeHints): Improve fix for bug#8919.

3 years agoDon't auto-lower when moving onto a menu bar on Haiku
Po Lu [Thu, 17 Feb 2022 01:26:14 +0000 (01:26 +0000)]
Don't auto-lower when moving onto a menu bar on Haiku

* src/haiku_io.c (haiku_len): Handle `MENU_BAR_LEFT'.
* src/haiku_support.cc (EmacsMenuBar::MouseMoved): New function.
* src/haiku_support.h (enum haiku_event_type): New event
`MENU_BAR_LEFT'.
(struct haiku_menu_bar_left_event): New structure.
* src/haikuterm.c (haiku_read_socket): Don't auto-lower when the
mouse exits the frame view onto the menu bar and handle
MENU_BAR_LEFT events.

3 years agoHandle `unspecified' values of symbolic font values on Haiku
Po Lu [Thu, 17 Feb 2022 01:25:24 +0000 (01:25 +0000)]
Handle `unspecified' values of symbolic font values on Haiku

* src/haikufont.c (haikufont_spec_or_entity_to_pattern): Handle
`unspecified' values of symbolic values.

3 years agoFix problem with file-modification-time in tramp-sshfs.el
Michael Albinus [Wed, 16 Feb 2022 19:22:45 +0000 (20:22 +0100)]
Fix problem with file-modification-time in tramp-sshfs.el

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-handle-file-notify-add-watch',
`tramp-handle-file-notify-rm-watch' and
`tramp-handle-file-notify-valid-p'.
(tramp-sshfs-handle-write-region): Set file modification time.
(Bug#54016)

* test/lisp/net/tramp-tests.el (tramp--test-asynchronous-processes-p):
Filter out tramp-adb on multi-byte `default-directory'.
(tramp--test-hpux-p, tramp--test-macos-p): Protect against errors.
(tramp--test-check-files): Discriminate also tramp-sshfs.el.

3 years agoFix computation of outline heading level for non-git diff
Matthias Meulien [Mon, 14 Feb 2022 21:29:49 +0000 (22:29 +0100)]
Fix computation of outline heading level for non-git diff

* lisp/vc/diff-mode.el (diff-setup-buffer-type): Compute outline heading level
using diff-hunk-header-re (bug#51809).
(diff--font-lock-prettify): Disable prettify in non-git diff.

3 years agoAdd support for Tai Tham script
Eli Zaretskii [Wed, 16 Feb 2022 15:07:58 +0000 (17:07 +0200)]
Add support for Tai Tham script

* lisp/international/fontset.el (setup-default-fontset)
(script-representative-chars): Add tai-tham.
* lisp/language/thai.el ("Northern Thai"): New language
environment.  Patch by Richard Wordingham
<richard.wordingham@ntlworld.com>.  Set
'composition-function-table' for the Tai Tham block.  Original
code by Richard Wordingham <richard.wordingham@ntlworld.com>.

* etc/HELLO: Add Northern Thai greeting.
* etc/NEWS: Announce addition of Northern Thai language environment.

3 years ago; * etc/NEWS: Fix wording of a recently added text.
Eli Zaretskii [Wed, 16 Feb 2022 13:37:57 +0000 (15:37 +0200)]
; * etc/NEWS: Fix wording of a recently added text.

3 years agoFix recent change in xwidget.c
Po Lu [Wed, 16 Feb 2022 11:54:40 +0000 (19:54 +0800)]
Fix recent change in xwidget.c

* src/xwidget.c (xwidget_init_view): Don't assume ttip_widget
is NULL if tooltips have not been initialized.

3 years agoSpeed up count_size_as_multibyte
Mattias Engdegård [Wed, 16 Feb 2022 11:27:59 +0000 (12:27 +0100)]
Speed up count_size_as_multibyte

This function is used in many places to calculate the length of
a unibyte string converted to multibyte.

* src/character.c (count_size_as_multibyte): Move the overflow test
outside the loop, which makes it much faster.  Standard compilers
will even vectorise it if asked to (-O2 in Clang, -O3 in GCC).

3 years agoAvoid emacs-module-tests failure on macOS
Mattias Engdegård [Wed, 16 Feb 2022 11:26:30 +0000 (12:26 +0100)]
Avoid emacs-module-tests failure on macOS

* test/src/emacs-module-tests.el (module/describe-function-1):
Prevent string mismatch caused by line breaks after filling;
the macOS dynamic library suffix (.dylib) is longer than on other
platforms.

3 years agoFix frame focus handling with native input
Po Lu [Wed, 16 Feb 2022 07:40:39 +0000 (15:40 +0800)]
Fix frame focus handling with native input

* lisp/term/x-win.el (x-gtk-use-native-input-watcher): Stop
passing frame parameter  to `x-internal-focus-input-context'.
* src/xfns.c (Fx_internal_focus_input_context): Focus all focus
frames from all displays.

3 years agoResolve xwidget scrolling mysteries
Po Lu [Wed, 16 Feb 2022 06:38:06 +0000 (14:38 +0800)]
Resolve xwidget scrolling mysteries

* src/xterm.c (x_any_window_to_frame): Handle xwidget views.
(handle_one_xevent): Always increment values array when handling
motion events.

3 years ago* etc/NEWS: Improve the PGTK entry.
Po Lu [Wed, 16 Feb 2022 03:28:08 +0000 (11:28 +0800)]
* etc/NEWS: Improve the PGTK entry.

3 years agoDecode keyboard input as latin-1 whenever appropriate
Po Lu [Wed, 16 Feb 2022 02:53:00 +0000 (10:53 +0800)]
Decode keyboard input as latin-1 whenever appropriate

* src/keyboard.c (kbd_buffer_get_event_1): Use `coding'
property if present.

* src/termhooks.h (enum event_kind): Document meaning of
`coding' property on text strings.

* src/xterm.c (handle_one_xevent): Set coding property on text
to latin-1 if it was obtained with XLookupString.

3 years agoDon't decode text within XIM callbacks or handle_one_xevent
Po Lu [Wed, 16 Feb 2022 02:10:13 +0000 (10:10 +0800)]
Don't decode text within XIM callbacks or handle_one_xevent

* src/keyboard.c (kbd_buffer_get_event_1):
(kbd_buffer_get_event_2): New functions.
(kbd_buffer_get_event): Accept a new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT where .arg can be a unibyte
string to be decoded in the locale coding system.

* src/termhooks.h (enum event_kind): Document new meaning of
.arg in a multibyte keystroke event.

* src/xfns.c (struct x_xim_text_conversion_data): New struct.
(x_xim_text_to_utf8_unix_1):
(x_xim_text_to_utf8_unix_2): New functions.
(x_xim_text_to_utf8_unix): Handle decode failure correctly.
(xic_preedit_draw_callback): Abort IM context if text could not
be decoded correctly.

* src/xterm.c (handle_one_xevent): Utilize new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT.

3 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Tue, 15 Feb 2022 15:16:50 +0000 (16:16 +0100)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

3 years agoSome Tramp cleanup
Michael Albinus [Tue, 15 Feb 2022 15:15:55 +0000 (16:15 +0100)]
Some Tramp cleanup

* doc/misc/tramp.texi (Remote processes): Add also tramp-sshfs.el.

* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Error-out for multi-byte `default-directory'.

* lisp/net/tramp.el (tramp-tolerate-tilde): Move it up.
(tramp-handle-abbreviate-file-name): Use it.
(tramp-read-passwd): Show literal passphrase prompt.

3 years ago; * etc/NEWS: Improve wording of savehist.el's entry.
Eli Zaretskii [Tue, 15 Feb 2022 14:33:42 +0000 (16:33 +0200)]
; * etc/NEWS: Improve wording of savehist.el's entry.

3 years agoDon't attempt to connect to a remote server during 'abbreviate-file-name'
Jim Porter [Mon, 14 Feb 2022 21:16:05 +0000 (13:16 -0800)]
Don't attempt to connect to a remote server during 'abbreviate-file-name'

* lisp/net/tramp.el (tramp-handle-abbreviate-file-name): Only use the
"home-directory" when a connection has been established.

3 years agoAllow savehist-additional-variables to truncate lists
Lars Ingebrigtsen [Tue, 15 Feb 2022 10:29:43 +0000 (11:29 +0100)]
Allow savehist-additional-variables to truncate lists

* lisp/savehist.el (savehist-save): Allow truncating values (bug#30943).

3 years agoAdjust files-test-file-size-human-readable test
Lars Ingebrigtsen [Tue, 15 Feb 2022 09:59:56 +0000 (10:59 +0100)]
Adjust files-test-file-size-human-readable test

* test/lisp/files-tests.el (files-test-file-size-human-readable):
Fix test after recent change.

3 years agoMake autoarg obsolete
Lars Ingebrigtsen [Tue, 15 Feb 2022 09:54:30 +0000 (10:54 +0100)]
Make autoarg obsolete

* lisp/obsolete/autoarg.el: Make obsolete.

3 years ago; Fix commit d6fba624e6
Arash Esbati [Tue, 15 Feb 2022 09:00:57 +0000 (10:00 +0100)]
; Fix commit d6fba624e6

* doc/misc/gnus.texi (Gravatars): Adjust vindex entries.

3 years agoFix parsing of some semibold font styles on Haiku
Po Lu [Tue, 15 Feb 2022 07:27:31 +0000 (07:27 +0000)]
Fix parsing of some semibold font styles on Haiku

* src/haiku_font_support.cc (font_style_to_flags): Accept
"Semibold" to mean SemiBold as well.  Reported by
augiedoggie <augiedoggie@users.noreply.github.com>.

3 years agoDisable auto-lowering and raising on Haiku when a popup is active
Po Lu [Tue, 15 Feb 2022 07:21:18 +0000 (07:21 +0000)]
Disable auto-lowering and raising on Haiku when a popup is active

* src/haikuterm.c (haiku_new_focus_frame):
(haiku_read_socket): Don't raise or lower if popup is activated.

3 years agoReplace use of `DefaultRootWindow' with our recorded root window
Po Lu [Tue, 15 Feb 2022 05:41:52 +0000 (13:41 +0800)]
Replace use of `DefaultRootWindow' with our recorded root window

* src/xfns.c (x_relative_mouse_position):
(x_set_parent_frame):
(Fx_mouse_absolute_pixel_position):
(Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (x_iconify_frame): Use dpyinfo->root_window
instead of DefaultRootWindow.

3 years agoImprove the help message for the pgtk configure option
Po Lu [Tue, 15 Feb 2022 04:52:30 +0000 (12:52 +0800)]
Improve the help message for the pgtk configure option

* configure.ac: Describe the purpose of PGTK better.

3 years ago; * doc/lispref/variables.texi (Setting Variables): Fix a typo.
Aleksandr Vityazev [Mon, 14 Feb 2022 20:30:58 +0000 (20:30 +0000)]
; * doc/lispref/variables.texi (Setting Variables): Fix a typo.

3 years ago* src/xterm.c (init_xterm): Use more reliable method to disable XI2.
Po Lu [Tue, 15 Feb 2022 02:23:49 +0000 (10:23 +0800)]
* src/xterm.c (init_xterm): Use more reliable method to disable XI2.

3 years agoBetter handle devices being enabled on XI2
Po Lu [Tue, 15 Feb 2022 01:19:12 +0000 (09:19 +0800)]
Better handle devices being enabled on XI2

* src/xterm.c (handle_one_xevent): Don't abort on DeviceChanged
if the device couldn't be found, instead regenerating the device
hierarchy to see if it was enabled.

3 years agoFix docstring and init of Gnus search -remove-prefix options
Eric Abrahamsen [Tue, 15 Feb 2022 00:06:14 +0000 (16:06 -0800)]
Fix docstring and init of Gnus search -remove-prefix options

* lisp/gnus/gnus-search.el (*-remove-prefix): For all engine defaults,
remove incorrect docs stating this is a regexp (it's a string). Also,
use `expand-file-name' to get the correct default value, not `concat'
and (getenv "HOME").

3 years agoFix manual documentation of Gnus tool bars
Eric Abrahamsen [Mon, 14 Feb 2022 23:11:37 +0000 (15:11 -0800)]
Fix manual documentation of Gnus tool bars

* doc/misc/gnus.texi: The options `gnus-use-toolbar',
`gnus-toolbar-thickness', and `gnus-summary-mail-toolbar' no longer
exist. Other options in this section have been renamed from "toolbar"
to "tool-bar".

3 years agoBe more explicit about the meaning of "remove prefix" in Gnus search
Eric Abrahamsen [Mon, 14 Feb 2022 23:20:06 +0000 (15:20 -0800)]
Be more explicit about the meaning of "remove prefix" in Gnus search

* doc/misc/gnus.texi (Search Engines): It's easy to get confused about
what we're removing and why.

3 years ago; * doc/lispref/variables.texi (Setting Variables): Fix markup.
Eli Zaretskii [Mon, 14 Feb 2022 17:47:44 +0000 (19:47 +0200)]
; * doc/lispref/variables.texi (Setting Variables): Fix markup.

3 years ago; Improve a recently added NEWS entry about 'command-query'.
Eli Zaretskii [Mon, 14 Feb 2022 17:38:56 +0000 (19:38 +0200)]
; Improve a recently added NEWS entry about 'command-query'.

3 years agoImprove recent addition to documentation of face remapping
Eli Zaretskii [Mon, 14 Feb 2022 17:23:28 +0000 (19:23 +0200)]
Improve recent addition to documentation of face remapping

* doc/lispref/display.texi (Basic Faces): Make the list of basic
faces more complete.
(Face Remapping): Improve wording of a recent addition; add
cross-reference to "Basic Faces".

3 years agoImprove format of values returned by 'file-size-human-readable'
Eli Zaretskii [Mon, 14 Feb 2022 16:59:38 +0000 (18:59 +0200)]
Improve format of values returned by 'file-size-human-readable'

* lisp/files.el (file-size-human-readable): Emit one digit of the
fractional part of the size only if there's just one digit before
the decimal point.

3 years agoFix typo in Face Remapping
Lars Ingebrigtsen [Mon, 14 Feb 2022 14:16:42 +0000 (15:16 +0100)]
Fix typo in Face Remapping

* doc/lispref/display.texi (Face Remapping): Fix typo.

3 years agoDon't signal errors in abbrev-table-p
Lars Ingebrigtsen [Mon, 14 Feb 2022 11:00:22 +0000 (12:00 +0100)]
Don't signal errors in abbrev-table-p

* lisp/abbrev.el (abbrev-table-p): Ignore the error.
* src/lread.c (oblookup): Signal `wrong-type-argument' instead of
`error' if it turns out that we're not really in an obarray (bug#53988).

3 years agoImprove stability of message-hide-headers
Philip Kaludercic [Mon, 14 Feb 2022 10:51:06 +0000 (11:51 +0100)]
Improve stability of message-hide-headers

* message.el (message-hide-headers): Use a pointer instead of tracking
the "end-of-headers" point manually (bug#53991).

3 years agoPremultiply background color by alpha for images
Po Lu [Mon, 14 Feb 2022 10:39:56 +0000 (18:39 +0800)]
Premultiply background color by alpha for images

* src/xterm.c (x_query_frame_background_color): Premultiply
colors as X wants them when built without Cairo.

3 years agoFix typo in previous Face Remapping doc change
Lars Ingebrigtsen [Mon, 14 Feb 2022 10:39:55 +0000 (11:39 +0100)]
Fix typo in previous Face Remapping doc change

* doc/lispref/display.texi (Face Remapping): Fix typo.

3 years agoNote caveat about remapping basic faces
Lars Ingebrigtsen [Mon, 14 Feb 2022 10:38:11 +0000 (11:38 +0100)]
Note caveat about remapping basic faces

* doc/lispref/display.texi (Face Remapping): Note caveat about
basic faces (bug#53636).

3 years agoImprove Haiku selection handling
Po Lu [Mon, 14 Feb 2022 10:17:58 +0000 (10:17 +0000)]
Improve Haiku selection handling

* lisp/select.el (gui--selection-value-internal): Use X types on
Haiku as well.

* lisp/term/haiku-win.el (haiku--selection-type-to-mime): Update
types to correspond better with X.

* src/haikuselect.c (Fhaiku_selection_data):
(Fhaiku_selection_put): Remove a great deal of ad hoc code now
handled by the regular selection machinery.

3 years agoAdd a mechanism for querying before executing a command
Lars Ingebrigtsen [Mon, 14 Feb 2022 10:20:41 +0000 (11:20 +0100)]
Add a mechanism for querying before executing a command

* doc/emacs/custom.texi (Disabling): Document it.
* doc/lispref/commands.texi (Disabling Commands): Document the
low-level stuff.

* lisp/simple.el (command-execute): Respect the `(query ...)'
value for `disabled'.
(command-execute--query): New function.
(command-query): New function.

3 years agoHandle allocation failures of fringe bitmaps on Haiku
Po Lu [Mon, 14 Feb 2022 07:12:17 +0000 (07:12 +0000)]
Handle allocation failures of fringe bitmaps on Haiku

* src/haikuterm.c (haiku_define_fringe_bitmap): Handle
allocation failures.

3 years ago* etc/TODO: Update some entires related to macOS and NS.
Po Lu [Mon, 14 Feb 2022 06:05:46 +0000 (14:05 +0800)]
* etc/TODO: Update some entires related to macOS and NS.

Xwidgets have worked on NS for a long time, "smooth scrolling"
is now available as `pixel-scroll-precision-mode' for all GUI
platforms, and some mouse gestures have been implemented on NS
and X.

3 years agoEnsure bad values don't leak into scroll valuators after DeviceChange
Po Lu [Mon, 14 Feb 2022 05:13:13 +0000 (13:13 +0800)]
Ensure bad values don't leak into scroll valuators after DeviceChange

* src/xterm.c (xi_reset_scroll_valuators_for_device_id): New
argument `pending_only'.
(handle_one_xevent): Reset pending scroll valuators on XI_Enter
and mark valuators updated via DeviceChanged events as pending.

* src/xterm.h (struct xi_scroll_valuator_t): New field
`pending_enter_reset'.

3 years agoRestore valuator values after receiving a DeviceChanged event
Po Lu [Mon, 14 Feb 2022 03:51:22 +0000 (11:51 +0800)]
Restore valuator values after receiving a DeviceChanged event

* src/xterm.c (x_init_master_valuators): Generate valuators for
both master and slave devices.
(handle_one_xevent): Find current valuator info and use that to
populate scroll valuators after a device changed.

3 years agoImprove efficency of handling DeviceChanged events
Po Lu [Mon, 14 Feb 2022 03:16:38 +0000 (11:16 +0800)]
Improve efficency of handling DeviceChanged events

* src/xterm.c (handle_one_xevent): Just update the device that
was changed on DeviceChanged and only do hierarchy recalculation
upon HierarchyChanged events.

3 years agoTry to reduce empty areas on GTK when a frame is being resized
Po Lu [Mon, 14 Feb 2022 01:52:05 +0000 (09:52 +0800)]
Try to reduce empty areas on GTK when a frame is being resized

* src/xterm.c (x_fill_rectangle):
(x_clear_rectangle, x_draw_image_glyph_string):
(x_clear_area): Don't use picture if frame background is opaque.

3 years agoFix wide fringe bitmap processing on Haiku
Po Lu [Mon, 14 Feb 2022 01:34:09 +0000 (01:34 +0000)]
Fix wide fringe bitmap processing on Haiku

* src/haiku_support.cc (BBitmap_import_mono_bits): Rewrite to
use ImportBits.
(BBitmap_import_fringe_bitmap): New function.

* src/haiku_support.h: Update prototypes.

* src/haikuterm.c (haiku_define_fringe_bitmap): Pass entire
short array to BBitmap_import_fringe_bitmap instead.

3 years agoImprove Tramp's process-file implementations
Michael Albinus [Sun, 13 Feb 2022 19:50:51 +0000 (20:50 +0100)]
Improve Tramp's process-file implementations

* lisp/net/tramp-adb.el (tramp-adb-handle-process-file)
* lisp/net/tramp-sh.el (tramp-sh-handle-process-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-process-file):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
Improve implementation.  (Bug#53854)

* test/lisp/net/tramp-tests.el (tramp-test28-process-file)
(tramp--test-check-files, tramp-test47-unload): Extend tests.

3 years ago* lisp/faces.el (read-face-name-sample-text): Add defconst (bug#53960).
Juri Linkov [Sun, 13 Feb 2022 18:44:14 +0000 (20:44 +0200)]
* lisp/faces.el (read-face-name-sample-text): Add defconst (bug#53960).

(read-face-name): Use it instead of hard-coded string.

3 years agoAdd a new macro `setopt'
Lars Ingebrigtsen [Sun, 13 Feb 2022 15:29:26 +0000 (16:29 +0100)]
Add a new macro `setopt'

* doc/emacs/custom.texi (Examining): Mention it.
(Init Syntax): Ditto.

* doc/emacs/windows.texi (Window Choice): Adjust example.

* doc/lispref/windows.texi (Choosing Window Options): Adjust examples.

* doc/lispref/variables.texi (Setting Variables): Document setopt.

* doc/misc/eudc.texi (Emacs-only Configuration): Adjust examples.

* lisp/cus-edit.el (setopt): New macro.

3 years ago; * lisp/simple.el (count-words): Doc fix.
Eli Zaretskii [Sun, 13 Feb 2022 13:05:13 +0000 (15:05 +0200)]
; * lisp/simple.el (count-words): Doc fix.

3 years ago* src/haikuterm.c (haiku_read_socket): Implement auto-lower.
Po Lu [Sun, 13 Feb 2022 12:15:21 +0000 (12:15 +0000)]
* src/haikuterm.c (haiku_read_socket): Implement auto-lower.

3 years agoOnly get rid of IC focus if focus is really gone
Po Lu [Sun, 13 Feb 2022 11:50:20 +0000 (19:50 +0800)]
Only get rid of IC focus if focus is really gone

* src/xterm.c (x_focus_changed): Only unset IC focus if the
focus state is empty.

3 years agoRemove the 'C-k' binding in ido-mode
Lars Ingebrigtsen [Sun, 13 Feb 2022 10:23:43 +0000 (11:23 +0100)]
Remove the 'C-k' binding in ido-mode

* lisp/ido.el (ido-file-completion-map): Remove the `C-k' binding,
because it's too dangerous and probably not very useful (bug#44556).

3 years agoPrevent crashes from illegal locale coding systems
Po Lu [Sun, 13 Feb 2022 10:19:51 +0000 (18:19 +0800)]
Prevent crashes from illegal locale coding systems

* src/xfns.c (xic_preedit_draw_callback):
* src/xterm.c (handle_one_xevent): Don't pass invalid coding
systems to `setup_coding_system'.

3 years agoMake `C-u M-x count-words' also give totals
Lars Ingebrigtsen [Sun, 13 Feb 2022 09:56:20 +0000 (10:56 +0100)]
Make `C-u M-x count-words' also give totals

* lisp/simple.el (count-words-region): Adjust callers.
(count-words): If given a prefix, give totals (bug#9959).
(count-words--buffer-format, count-words--format): Rename and
don't message, but return the string.

3 years agoNote meaning on nil HIST in Fread_from_minibuffer
Lars Ingebrigtsen [Sun, 13 Feb 2022 09:12:27 +0000 (10:12 +0100)]
Note meaning on nil HIST in Fread_from_minibuffer

* src/minibuf.c (Fread_from_minibuffer): Note the meaning of a nil
HIST parameter (bug#20063).

3 years agoFix mouse clicking in read-face-name
Lars Ingebrigtsen [Sun, 13 Feb 2022 08:35:55 +0000 (09:35 +0100)]
Fix mouse clicking in read-face-name

* lisp/faces.el (read-face-name): Put the data in the right
position so that clicking on completions work (bug#53960).

3 years agoFix ietf-drums-remove-whitespace unmatched " and (
Bob Rogers [Sun, 13 Feb 2022 08:32:13 +0000 (09:32 +0100)]
Fix ietf-drums-remove-whitespace unmatched " and (

* lisp/mail/ietf-drums.el:
+ (ietf-drums-skip-comment):  New helper function.
+ (ietf-drums-remove-comments):  Use ietf-drums-skip-comment.
+ (ietf-drums-remove-whitespace):  Handle unterminated quotes and
comments, as ietf-drums-remove-comments already does.
* test/lisp/mail/ietf-drums-tests.el:
+ Test unterminated quote and comment for
ietf-drums-remove-whitespace and ietf-drums-remove-comments (bug#53965).

3 years ago* src/eval.c (specpdl_unrewind): Remove empty statement.
Andreas Schwab [Sun, 13 Feb 2022 08:10:25 +0000 (09:10 +0100)]
* src/eval.c (specpdl_unrewind): Remove empty statement.

3 years agoAvoid a compilation warning in eval.c
Lars Ingebrigtsen [Sun, 13 Feb 2022 07:26:55 +0000 (08:26 +0100)]
Avoid a compilation warning in eval.c

* src/eval.c (specpdl_unrewind): Avoid a compilation warning.

3 years agoFix integer overflow with 32-bit visual
Po Lu [Sun, 13 Feb 2022 05:26:41 +0000 (13:26 +0800)]
Fix integer overflow with 32-bit visual

* src/xfns.c (x_set_border_pixel):
(x_set_border_color): Use `unsigned long' for border color.

3 years agoWork around tooltip bug on new versions of WebKitGTK
Po Lu [Sun, 13 Feb 2022 03:29:44 +0000 (11:29 +0800)]
Work around tooltip bug on new versions of WebKitGTK

* src/xwidget.c (dummy_tooltip_string): New variable.
(xw_maybe_synthesize_crossing): Call `xg_prepare_tooltip' to
disable tooltips on WebKitGTK 2.34 or later.
(syms_of_xwidget): Make dummy string.

3 years agoStop quering for Xinerama inside x_get_monitor_attributes
Po Lu [Sun, 13 Feb 2022 03:00:52 +0000 (11:00 +0800)]
Stop quering for Xinerama inside x_get_monitor_attributes

* src/xfns.c (x_get_monitor_attributes): Remove Xinerama check
and use xinerama_supported_p instead.
* src/xterm.c (x_term_init): Set `xinerama_supported_p'
* src/xterm.h (struct x_display_info): New field
`xinerama_supported_p'.

3 years ago* src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag.
Po Lu [Sun, 13 Feb 2022 02:05:30 +0000 (10:05 +0800)]
* src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag.

3 years agoUse better GC for visible bell on colormapped visuals
Po Lu [Sun, 13 Feb 2022 01:34:12 +0000 (09:34 +0800)]
Use better GC for visible bell on colormapped visuals

* src/xterm.c (XTflash): Use normal_gc if the visual is not
TrueColor.

3 years agoFix the Haiku port
Po Lu [Sun, 13 Feb 2022 00:48:55 +0000 (00:48 +0000)]
Fix the Haiku port

* src/haiku_support.h [__cplusplus]: Define `specpdl_ref' type
on C++ since that code cannot include lisp.h.

3 years agoFix last change in xterm.c
Po Lu [Sun, 13 Feb 2022 00:39:24 +0000 (08:39 +0800)]
Fix last change in xterm.c

* src/xterm.c (x_update_opaque_region): Remove check that f is
non-NULL.
(handle_one_xevent): If f is NULL and the configure event is for
any's edit widget, use that instead.

3 years ago* src/xterm.c (x_update_opaque_region): Avoid crash at startup in Lucid build
Stefan Monnier [Sat, 12 Feb 2022 22:47:21 +0000 (17:47 -0500)]
* src/xterm.c (x_update_opaque_region): Avoid crash at startup in Lucid build

3 years agoRewrite thread context switch code (bug#48990)
Stefan Monnier [Sat, 12 Feb 2022 20:25:53 +0000 (15:25 -0500)]
Rewrite thread context switch code (bug#48990)

Make the context switch code handle buffer-local variables more
correctly by reusing the code originally written for `backtrace-eval`.
This has the side benefit of making the `saved_value` field unused.

* src/lisp.h (enum specbind_tag): Remove `saved_value` field.
(rebind_for_thread_switch, unbind_for_thread_switch): Delete decls.
(specpdl_unrewind): Declare function.

* src/eval.c (specpdl_saved_value): Delete function.
(specbind): Delete the code related to `saved_value`, and consolidate
common code between the different branches.
(rebind_for_thread_switch, -unbind_for_thread_switch): Move to `thread.c`.
(specpdl_unrewind): New function, extracted from `backtrace_eval_unrewind`.
Use `SET_INTERNAL_THREAD_SWITCH`.  Skip the buffer & excursion unwinds
depending on new arg `vars_only`.
(backtrace_eval_unrewind): Use it.
(mark_specpdl): Don't mark `saved_value`.

* src/thread.c (rebind_for_thread_switch, unbind_for_thread_switch):
Move from `eval.c` and rewrite using `specpdl_unrewind`.

* test/src/thread-tests.el (threads-test-bug48990): New test.

* test/Makefile.in (test_template): Add a + as suggested by make:
"warning: jobserver unavailable: using -j1.  Add '+' to parent make rule".

3 years agoSpeed up `=` on fixnums in bytecode
Mattias Engdegård [Thu, 3 Feb 2022 09:26:27 +0000 (10:26 +0100)]
Speed up `=` on fixnums in bytecode

Now that EQ has become expensive, use BASE_EQ where possible.

* src/bytecode.c (exec_byte_code): Use cheaper operation for Beqlsign.

3 years ago; * src/xdisp.c (syms_of_xdisp): Fix formatting of last change.
Eli Zaretskii [Sat, 12 Feb 2022 18:45:06 +0000 (20:45 +0200)]
; * src/xdisp.c (syms_of_xdisp): Fix formatting of last change.

3 years agoOptionally allow point to enter composed character sequences
Eli Zaretskii [Sat, 12 Feb 2022 18:38:51 +0000 (20:38 +0200)]
Optionally allow point to enter composed character sequences

This changeset is based on code originally posted by
Kenichi Handa <handa@gnu.org> as part of discussing bug#20140,
with a few adjustments and changes, mainly to support R2L
text and provide a user option to control the feature.
* src/xdisp.c (compute_stop_pos, next_element_from_buffer)
(composition_reseat_it): Don't allow auto-composing characters
past point when 'composition-break-at-point' is non-nil.
(syms_of_xdisp) <composition-break-at-point>: New boolean variable.
(redisplay_internal, redisplay_window): Disable "just move the
cursor" optimizations when 'composition-break-at-point' is non-nil.
* src/keyboard.c (command_loop_1): Force redisplay when
'composition-break-at-point' is non-nil.

* lisp/cus-start.el (standard): Provide customization form for
'composition-break-at-point'.

* etc/NEWS: Announce the new feature.

3 years agoCount bytes, not records, in specpdl_ref
Mattias Engdegård [Wed, 2 Feb 2022 16:42:07 +0000 (17:42 +0100)]
Count bytes, not records, in specpdl_ref

SPECPDL_INDEX becomes much faster because the pointer subtraction,
expensive because of the inconveniently sized specpdl records, is now
gone.  This translates to a useful speedup on a wide variety of code.

* src/lisp.h (specpdl_ref, wrap_specpdl_ref, unwrap_specpdl_ref):
Rename member.
(specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_add, specpdl_ref_to_ptr, SPECPDL_INDEX):
Count offset in bytes rather than in records.

3 years agoTurn specpdl_ref into a type of its own
Mattias Engdegård [Wed, 2 Feb 2022 15:51:43 +0000 (16:51 +0100)]
Turn specpdl_ref into a type of its own

Wrap the specpdl_ref contents in a struct, which gives us some very
useful type checking to make sure that all code that assumed integral
specpdl refs has been converted.

We only do this on 64-bit platforms, since those tend to have modern
ABIs where small structs are optimised as scalars.  In other words,
this change should not affect the compiled code.

* src/lisp.h (specpdl_ref): Now a struct on 64-bit platforms.
(wrap_specpdl_ref, unwrap_specpdl_ref): New.
(specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_eq, specpdl_ref_lt)
(specpdl_ref_valid_p, make_invalid_specpdl_ref): Use new wrappers.

3 years agoReplace ptrdiff_t with new specpdl_ref type for specpdl references
Mattias Engdegård [Sat, 12 Feb 2022 15:05:17 +0000 (16:05 +0100)]
Replace ptrdiff_t with new specpdl_ref type for specpdl references

The specpdl_ref type is just an alias for ptrdiff_t; the compiled code
remains the same.  All operations on specpdl_ref (arithmetic,
comparison etc) now go through inline functions.

The bulk of the change is almost completely mechanical.  It is done to
prepare for a type-safe representation and subsequent performance
improvement.

* src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p)
(make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New.
(SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free)
(safe_free_unbind_to):
* src/alloc.c (run_finalizer_function, inhibit_garbage_collection)
(garbage_collect, Fgarbage_collect, which_symbols):
* src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start):
* src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay)
(Fdelete_overlay):
* src/bytecode.c (exec_byte_code):
* src/callint.c (Ffuncall_interactively, Fcall_interactively):
* src/callproc.c (Fcall_process, call_process, create_temp_file)
(Fcall_process_region):
* src/charset.c (load_charset_map_from_file):
* src/coding.c (decode_coding_gap, decode_coding_object)
(encode_coding_object, Fread_coding_system):
* src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit):
* src/composite.c (update_compositions, autocmp_chars):
* src/cygw32.c (conv_filename_to_w32_unicode)
(conv_filename_from_w32_unicode):
* src/data.c (notify_variable_watchers):
* src/decompress.c (Fzlib_decompress_region):
* src/dired.c (directory_files_internal, file_name_completion)
(file_attributes):
* src/dispnew.c (Fredisplay):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/editfns.c (Fsave_excursion, Fsave_current_buffer)
(Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction)
(styled_format):
* src/emacs-module.c (Fmodule_load, funcall_module):
* src/emacs.c (init_cmdargs, Fdump_emacs):
* src/eval.c (call_debugger, do_debug_on_call, FletX, Flet)
(Ffuncall_with_delayed_message, Funwind_protect)
(internal_lisp_condition_case, signal_or_quit)
(load_with_autoload_queue, Feval, grow_specpdl_allocation)
(record_in_backtrace, eval_sub, Ffuncall, apply_lambda)
(funcall_lambda, clear_unwind_protect, set_unwind_protect)
(set_unwind_protect_ptr, unbind_to, Fbacktrace_eval):
* src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file)
(Finsert_file_contents, write_region, Fdo_auto_save):
* src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call):
* src/fringe.c (update_window_fringes):
* src/gtkutil.c (xg_dialog_run):
* src/haiku_io.c (c_specpdl_idx_from_cxx):
* src/haiku_support.cc (be_popup_file_dialog):
* src/haiku_support.h (c_specpdl_idx_from_cxx):
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame)
(haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name):
* src/haikumenu.c (haiku_popup_dialog, set_frame_menubar):
* src/image.c (slurp_file):
* src/indent.c (line_number_display_width, Fvertical_motion):
* src/insdel.c (signal_before_change, signal_after_change)
(Fcombine_after_change_execute):
* src/intervals.c (get_local_map):
* src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert)
(Fjson_parse_string, Fjson_parse_buffer):
* src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error)
(Finternal_track_mouse, command_loop_1, read_menu_command)
(safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2)
(menu_item_eval_property, read_key_sequence, read_key_sequence_vs)
(Fsuspend_emacs):
* src/keymap.c (Fcurrent_active_maps, Fdescribe_vector)
(Fhelp__describe_vector):
* src/lread.c (Fload, save_match_data_load, readevalloop)
(Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1):
* src/macros.c (Fexecute_kbd_macro):
* src/menu.c (x_popup_menu_1):
* src/minibuf.c (read_minibuf, set_minibuffer_mode)
(read_minibuf_unwind, Fread_string, Fread_buffer):
* src/nsfns.m (Fx_create_frame, Fx_show_tip):
* src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
* src/pdumper.c (Fdump_emacs_portable):
* src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip)
(Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font):
* src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu)
(pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show)
(pgtk_popup_dialog):
* src/pgtkterm.c (pgtk_cr_export_frames):
* src/print.c (PRINTPREPARE, temp_output_buffer_setup)
(Fprin1_to_string, print_vectorlike):
* src/process.c (Fmake_process, create_process, Fmake_pipe_process)
(Fmake_serial_process, connect_network_socket, Fmake_network_process)
(network_interface_info, server_accept_connection)
(wait_reading_process_output, read_process_output, exec_sentinel):
* src/regex-emacs.c (re_match_2_internal):
* src/search.c (looking_at_1, fast_looking_at, search_buffer_re):
* src/sound.c (Fplay_sound_internal):
* src/sysdep.c (system_process_attributes):
* src/term.c (tty_menu_show):
* src/textprop.c (Fnext_single_char_property_change)
(Fprevious_single_char_property_change, add_text_properties_1)
(set_text_properties, set_text_properties_1, Fremove_text_properties)
(Fremove_list_of_text_properties):
* src/thread.c (Fmutex_lock, invoke_thread_function):
* src/undo.c (truncate_undo_list):
* src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip)
(Fx_show_tip, Fx_file_dialog):
* src/w32font.c (Fx_select_font):
* src/w32menu.c (set_frame_menubar):
* src/window.c (window_list, next_window, window_list_1)
(run_window_configuration_change_hook, Frun_window_scroll_functions)
(run_window_change_functions, set_window_buffer)
(temp_output_buffer_show, window_scroll, scroll_command)
(Fscroll_other_window, Fscroll_other_window_down):
* src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop)
(handle_single_display_spec, Fbuffer_text_pixel_size)
(message_dolog, with_echo_area_buffer, setup_echo_area_for_printing)
(display_echo_area, set_message, clear_message, echo_area_display)
(gui_consider_frame_title, prepare_menu_bars, update_menu_bar)
(update_tab_bar, update_tool_bar, redisplay_internal)
(redisplay_preserve_echo_area, run_window_scroll_functions)
(redisplay_window, extend_face_to_end_of_line)
(display_count_lines_logically, display_count_lines_visually)
(display_mode_lines, display_mode_line, Fformat_mode_line)
(decode_mode_spec):
* src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip)
(Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog):
* src/xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(x_menu_show, create_and_show_dialog, x_dialog_show)
(xw_popup_dialog):
* src/xselect.c (x_get_local_selection, x_reply_selection_request)
(x_handle_selection_request, wait_for_property_change):
* src/xterm.c (x_cr_export_frames, x_connection_closed):
Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the
corresponding functions instead of direct arithmetic.

3 years agoFix entry and exit events with XI2 grabs on X toolkit menus
Po Lu [Sat, 12 Feb 2022 12:25:00 +0000 (20:25 +0800)]
Fix entry and exit events with XI2 grabs on X toolkit menus

* src/xmenu.c (popup_get_selection): Only claim cookie if new
event will be generated.
(create_and_show_popup_menu): Ungrab XI2 device, then
immediately set core grab on the frame's edit widget window.

* src/xterm.c (handle_one_xevent): Use x_any_window_to_frame to
find exit event frame if a popup menu is active.

3 years agoClean up mode-line-* faces handling
Eli Zaretskii [Sat, 12 Feb 2022 11:43:36 +0000 (13:43 +0200)]
Clean up mode-line-* faces handling

* src/xfaces.c (realize_basic_faces):
* src/dispextern.h (enum face_id): Remove MODE_LINE_ID.

3 years agoAdd documentation on how to delete files from Trash
Lars Ingebrigtsen [Sat, 12 Feb 2022 08:04:14 +0000 (09:04 +0100)]
Add documentation on how to delete files from Trash

* doc/emacs/files.texi (Misc File Ops): Note trick to make `D'
work in Trash directories (bug#44059).

3 years agoImprove interaction between track-mouse and edebug
Lars Ingebrigtsen [Sat, 12 Feb 2022 07:40:30 +0000 (08:40 +0100)]
Improve interaction between track-mouse and edebug

* lisp/emacs-lisp/edebug.el (edebug--display-1): Work around
`track-mouse' oddity (bug#675).

3 years agoFix off-by-one file size formatting in ls-lisp
Lars Ingebrigtsen [Sat, 12 Feb 2022 07:07:42 +0000 (08:07 +0100)]
Fix off-by-one file size formatting in ls-lisp

* lisp/ls-lisp.el (ls-lisp-format, ls-lisp-format-file-size): The
human-readable file sizes can be 7 characters wide (e.g.,
"1016.1k") (bug#53937).

3 years agoCross-link message-expand-name-standard-ui-relevant doc strings
Lars Ingebrigtsen [Fri, 11 Feb 2022 06:22:52 +0000 (07:22 +0100)]
Cross-link message-expand-name-standard-ui-relevant doc strings

* lisp/gnus/message.el (message-expand-name-standard-ui): Mention
the other relevant variables in the doc string (bug#50667).

3 years agoImplement visual bell on Haiku like on X
Po Lu [Sat, 12 Feb 2022 04:42:42 +0000 (04:42 +0000)]
Implement visual bell on Haiku like on X

* src/haiku_draw_support.cc
(BView_FillRectangleForVisibleBell): Delete function.
(BView_InvertRect): New function.

* src/haiku_support.cc (class EmacsView): Delete field
`visible_bell_color' and visible bell related methods.
(EmacsView_do_visible_bell): Delete function.
* src/haiku_support.h: Update prototypes.

* src/haikuterm.c (haiku_flash): Implement using
`BView_InvertRect'.
(haiku_beep): Use `haiku_flash' instead.

3 years agoFix compatibility with ancient versions of libXi
Po Lu [Sat, 12 Feb 2022 02:33:14 +0000 (10:33 +0800)]
Fix compatibility with ancient versions of libXi

* src/xmenu.c (popup_get_selection): Don't rely on xev->display
being non-NULL.

3 years agoBe less strict about which PointerEmulated button events to ignore
Po Lu [Sat, 12 Feb 2022 02:23:51 +0000 (10:23 +0800)]
Be less strict about which PointerEmulated button events to ignore

* src/xterm.c (handle_one_xevent): Ignore all PointerEmulated
button events.

3 years agoNever set opaque region without an alpha channel
Po Lu [Sat, 12 Feb 2022 01:20:53 +0000 (09:20 +0800)]
Never set opaque region without an alpha channel

* src/xfns.c (x_set_alpha_background): Don't modify opaque
region if the visual has no alpha channel.