Commit graph

154756 commits

Author SHA1 Message Date
Lars Ingebrigtsen
b6587090bf Fix clobbering of match data in executable-set-magic
* lisp/progmodes/executable.el (executable-set-magic): Switching
buffers may clobber match data, so save the match data first
(bug#54218).
2022-03-03 15:43:35 +01:00
Jim Porter
d72cd4a2b7 Allow splitting strings in Eshell expansions with "plain" strings
Since '$var[hello 0]' doesn't make sense when 'var' is a string, the
previous restriction was unnecessary.

* lisp/eshell/esh-var.el (Commentary): Update documentation.
(eshell-apply-indices): Allow "plain" strings to split strings.

* test/lisp/eshell/esh-var-test.el
(esh-var-test/interp-var-string-split-indices)
(esh-var-test/quoted-interp-var-string-split-indices): Update tests.

* doc/misc/eshell.texi (Dollars expansion): Update documentation.
2022-03-03 14:59:33 +01:00
Jim Porter
990f36fa10 Fix parsing of indices in Eshell expansions
Previously, more-complex index expansions, like '$var[":" 0]' or
'$var[$(expr) 0]' failed to parse correctly.

* lisp/eshell/esh-var.el (Commentary): Clarify indexing and length
expansions.
(eshell-parse-indices): Expand docstring and support parsing inside
double-quotes.
(eshell-eval-indices): New function.
(eshell-parse-variable): Use it.

* test/lisp/eshell/esh-var-tests.el (eshell-test-value): New defvar.
(esh-var-test/interp-var-indices,
(esh-var-test/interp-var-split-indices)
(esh-var-test/interp-var-string-split-indices)
(esh-var-test/interp-var-regexp-split-indices)
(esh-var-test/interp-var-assoc, esh-var-test/interp-var-length-list)
(esh-var-test/interp-var-length-string)
(esh-var-test/interp-var-length-alist)
(esh-var-test/quoted-interp-var-indices)
(esh-var-test/quoted-interp-var-split-indices)
(esh-var-test/quoted-interp-var-string-split-indices)
(esh-var-test/quoted-interp-var-regexp-split-indices)
(esh-var-test/quoted-interp-var-assoc)
(esh-var-test/quoted-interp-var-length-list)
(esh-var-test/quoted-interp-var-length-string)
(esh-var-test/quoted-interp-var-length-alist): New tests.

* doc/misc/eshell.texi (Dollars Expansion): Expand and reword
documentation for indexing and length expansions.
2022-03-03 14:59:33 +01:00
Jim Porter
cccee7e840 Fix Eshell dollar interpolation inside of double-quotes
For example,

  echo "${echo hi}"

previously tried to run the program named 'echo hi', instead of 'echo'
with the argument 'hi'.

* lisp/eshell/esh-arg.el (eshell-parse-inner-double-quote):
New function.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Support parsing
when wrapped in double-quiotes.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var)
(esh-var-test/interp-quoted-var)
(esh-var-test/interp-quoted-var-concat)
(esh-var-test/quoted-interp-var)
(esh-var-test/quoted-interp-quoted-var)
(esh-var-test/quoted-interp-lisp, esh-var-test/quoted-interp-cmd)
(esh-var-test/quoted-interp-temp-cmd): New tests.
2022-03-03 14:59:33 +01:00
Jim Porter
ae1acb6017 Add a new macro to simplify parsing temporary Eshell command strings
This abstracts out the somewhat-unusual "insert&delete" logic in
'eshell-parse-command' so that it can be used elsewhere, and also
ensures that the deletion occurs even if an an error occurs.

* lisp/eshell/esh-cmd.el (eshell-with-temp-command): New macro.
(eshell-parse-command): Use it.
2022-03-03 14:59:33 +01:00
Jim Porter
7c7a4c26cb Move Eshell variable interpolation tests to their own file
* test/lisp/eshell/eshell-tests.el (eshell-test/interp-cmd)
(eshell-test/interp-lisp, eshell-test/interp-temp-cmd)
(eshell-test/interp-concat, eshell-test/interp-concat-lisp)
(eshell-test/interp-concat2, eshell-test/interp-concat-lisp2)
(eshell-test/interp-cmd-external)
(eshell-test/interp-cmd-external-concat, eshell-test/window-height)
(eshell-test/window-width, eshell-test/last-result-var)
(eshell-test/last-result-var2, eshell-test/last-arg-var):
Move from here...

* test/lisp/eshell/esh-var-test.el (esh-var-test/interp-lisp)
(esh-var-test/interp-cmd, esh-var-test/interp-cmd-external)
(esh-var-test/interp-temp-cmd, esh-var-test/interp-concat-lisp)
(esh-var-test/interp-concat-lisp2, esh-var-test/interp-concat-cmd)
(esh-var-test/interp-concat-cmd2)
(esh-var-test/interp-concat-cmd-external, esh-var-test/window-height)
(esh-var-test/window-width, esh-var-test/last-result-var)
(esh-var-test/last-result-var2, esh-var-test/last-arg-var):
... to here.
2022-03-03 14:59:33 +01:00
Stefan Kangas
ca8f4ebc49 Merge from origin/emacs-28
225e0d6047 Correct etc/NEWS entry about bitmapped fonts

# Conflicts:
#	etc/NEWS
2022-03-03 06:30:34 +01:00
Dmitry Gutov
86969f9658 Cache the backend value together with the project root
* lisp/progmodes/project.el (project-try-vc):
Cache the backend value together with the root.
(project-root, project-files, project-ignores):
Update to access the new data structure.
2022-03-03 05:41:46 +02:00
Po Lu
d845ccb7cf * src/xterm.c: Fix commentary on GTK client side windows. 2022-03-03 11:39:55 +08:00
Po Lu
39aac09940 Fix Motif build without toolkit scroll bars
* src/xterm.c: Always include Xm.h on Motif.
2022-03-03 11:17:53 +08:00
Dmitry Gutov
890b08e415 * lisp/progmodes/xref.el: Bump the version. 2022-03-03 04:55:23 +02:00
Po Lu
b727d6ebeb Don't calculate any frame for extension events
* src/xterm.c (handle_one_xevent): If event is not a core event,
don't try to calculate any from event.xany.window.
2022-03-03 10:50:30 +08:00
Po Lu
5436406286 Implement `toolkit_position_hook' on PGTK
* src/pgtkterm.c (pgtk_toolkit_position): New function.
(pgtk_create_terminal): Set it as the toolkit position hook.
2022-03-03 09:05:00 +08:00
Po Lu
8c8093aa6f ; * src/termhooks.h (struct terminal): Fix typo in comment. 2022-03-02 19:16:53 +08:00
Po Lu
596d36f8cf Fix menu bar position reporting on Haiku as well
* src/haikuterm.c (haiku_toolkit_position): New function.
(haiku_create_terminal): Register new hook.
2022-03-02 11:10:00 +00:00
Po Lu
68e293c81d Fix reporting of imaginary key prefixes on toolkit tool and menu bars
* src/keyboard.c (make_lispy_position): Set imaginary prefix if
the terminal says what widget the position is on top of.
* src/termhooks.h (struct terminal): New field
`toolkit_position_hook'.
* src/xterm.c (x_toolkit_position): New function.
(x_create_terminal): Register hook.
2022-03-02 19:02:14 +08:00
Po Lu
225e0d6047 Correct etc/NEWS entry about bitmapped fonts
* etc/NEWS: Don't say that bitmap font issues are due to Pango, that's
not accurate.
2022-03-02 09:24:21 +01:00
Stefan Kangas
6d78321ce8 Merge from origin/emacs-28
9dadcbe429 ; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.
2c3d1b6bf4 Improve/correct documentation about Eshell variable expansion
9e257aecc9 Partially revert b03f74e0f2
2022-03-02 06:33:19 +01:00
Stefan Kangas
2b130bd944 ; Merge from origin/emacs-28
The following commit was skipped:

b8bc359bbf Backport: Port pre-commit hook to Git 2.35.0
2022-03-02 06:33:19 +01:00
Po Lu
67af072204 Fix some bugs with multiple terminals on Haiku
* src/haikuterm.c (haiku_mouse_position): Only clear
`mouse_moved' for Haiku frames.
2022-03-02 05:21:20 +00:00
Po Lu
ae00f07d88 Fix persistent help text on disabled menu items
* oldXMenu/Activate.c (XMenuActivate): Always deactivate help
echo upon leaving a menu item.
2022-03-02 11:12:09 +08:00
Po Lu
84695d439a * src/msdos.c (dos_rawgetc): Handle tab bar clicks correctly. 2022-03-02 10:07:59 +08:00
Po Lu
689a34e215 Dismiss help text when item becomes unactivated on oldXMenu
* oldXMenu/Activate.c (XMenuActivate): Dismiss help text when
leaving an item.
2022-03-02 09:46:44 +08:00
Po Lu
6b71b80fdc Fix odd scrolling bugs on LessTif
* src/xterm.c (handle_one_xevent): Give emulated button events
to Motif.
2022-03-02 09:38:58 +08:00
Po Lu
006a447455 Improve behavior of Motif popup menus on XI2
* src/xmenu.c (create_and_show_popup_menu): Set input focus to
menu window.
2022-03-02 09:01:48 +08:00
Paul Eggert
caae254bb4 Revert previous merge-gnulib change
* admin/merge-gnulib: Revert previous stopgap change.
It shouldn’t be needed now that Gnulib has the change
2022-03-01T18:01:59Z!eggert@cs.ucla.edu.
2022-03-01 10:06:49 -08:00
Eli Zaretskii
9dadcbe429 ; * doc/misc/eshell.texi (Dollars Expansion): Fix markup. 2022-03-01 15:08:38 +02:00
Jim Porter
2c3d1b6bf4 Improve/correct documentation about Eshell variable expansion
* lisp/eshell/esh-var.el: Correct documentation comment.
(eshell-parse-variable-ref): Correct docstring.

* doc/misc/eshell.texi (Dollars Expansion): Add documentation for
$"var"/$'var' and $<command> syntaxes.
2022-03-01 15:02:13 +02:00
Jim Porter
9e257aecc9 Partially revert b03f74e0f2
That commit regressed '$<command>' forms in Eshell, due to a
limitation/bug in how 'eshell-do-eval' works.  This fixes
bug#54190.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Quote a lambda.

* test/lisp/eshell/eshell-tests.el (eshell-test/interp-temp-cmd):
New test.
2022-03-01 15:01:16 +02:00
Po Lu
87de4ad8bc ; Add a comment in recently installed code
* faces.el (face-spec-recalc): Add a comment describing the
special treatement of the scroll-bar face.
2022-03-01 20:48:55 +08:00
Po Lu
e361d0d7e5 Add PropertyChangeMask to the standard event set
* src/xfns.c (x_window): Remove special Motif code.
* src/xterm.h (STANDARD_EVENT_SET): Add PropertyChangeMask.
2022-03-01 20:15:02 +08:00
Po Lu
f980eed4c1 Fix crashes and other bugs on LessTif
* lwlib/lwlib-Xm.c (make_menu_in_widget): XmIsRowColumn is
broken on the latest LessTif release, so avoid that here.
* src/xfns.c (x_window): Add PropertyChangeMask which LessTif
doesn't do itself.
2022-03-01 19:15:46 +08:00
Po Lu
ad0fb40ae6 Fix reporting of wheel events on top of GTK scroll bars
* src/gtkutil.c (xg_update_scrollbar_pos):
(xg_update_horizontal_scrollbar_pos): Stop ensuring the window
is native.
(xg_event_is_for_scrollbar): New variable `for_valuator'.
All callers changed.
* src/gtkutil.h: Update prototypes.
* src/xterm.c (handle_one_xevent): Drop all valuator change
events destined for scroll bars.
2022-03-01 18:38:08 +08:00
Paul Eggert
b8bc359bbf Backport: Port pre-commit hook to Git 2.35.0
* build-aux/git-hooks/pre-commit: Use LC_ALL=C grep -E instead of
sane_egrep (removed in Git 2.35.0).

(cherry picked from commit b8a96f0556)
2022-03-01 10:01:11 +01:00
Po Lu
3447f365b1 ; * src/xwidget.c: Add missing part of last change. 2022-03-01 15:49:03 +08:00
Po Lu
6654dfc83c * src/xwidget.h: Fix build with XI 2.4. 2022-03-01 15:45:50 +08:00
Po Lu
dd71222208 Make precision scrolling on top of the tool bar work
* lisp/pixel-scroll.el (pixel-scroll-precision-mode-map): Bind
some more events.

(pixel-scroll-precision):
(pixel-scroll-start-momentum): If window is a frame, use its
selected window.
2022-03-01 15:38:37 +08:00
Po Lu
54474a6db2 Avoid duplicate wheel and button events on non-toolkit scroll bars
* src/xterm.c (x_scroll_bar_create): Set appropriate input
extension event mask.
(handle_one_xevent): Move some ifdefs around and handle input
extension button events on scroll bars.
2022-03-01 14:59:32 +08:00
Po Lu
db9b9435cd Fix old X menu on builds with XI2
* oldXMenu/Activate.c (XMenuActivateSetTranslateFunction): New
function.
(XMenuActivate): Handle generic events.
* oldXMenu/XMenu.h: New prototypes.
(Translate_func): New type.
* src/xmenu.c (x_menu_wait_translate_generic_event): New
function.
(x_menu_show): Set translate function.
2022-03-01 14:44:02 +08:00
Po Lu
6b8808ab8c Disable some code that interferes with menus on Lucid
* src/xmenu.c (create_and_show_popup_menu)
(server_timestamp_predicate): Disable timestamp code on builds
using the Lucid menu bar widget.
2022-03-01 14:09:22 +08:00
Stefan Kangas
cd44d45d92 Merge from origin/emacs-28
6dbc3da205 Fix :tag for eol in tab-first-completion
2022-03-01 07:05:15 +01:00
Po Lu
6874011721 Fix C-g inside toolkit file dialogs with XI2
* src/xfns.c (Fx_file_dialog): Handle GenericEvents when looking
for quit character.
* src/xmenu.c (x_menu_wait_for_event): If data is non-nil, use
XPending.
2022-03-01 13:49:49 +08:00
Stefan Kangas
dfb52654a2 Update publicsuffix.txt from upstream
* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2022-02-28 02:58:30 UTC.
2022-03-01 06:04:06 +01:00
Po Lu
02d3eed600 Intern server time property during terminal initialization
* src/xmenu.c (create_and_show_popup_menu): Use previously
interned atom.
* src/xterm.c (x_term_init): New atom `EMACS_SERVER_TIME_PROP'.
* src/xterm.h (struct x_display_info): New field
`Xatom_EMACS_SERVER_TIME_PROP'.
2022-03-01 11:31:37 +08:00
Po Lu
17431ca1cc Fix Motif menu help text in submenus
* lwlib/lwlib-Xm.c (xm_arm_callback):
(make_menu_in_widget):
(update_one_menu_entry):
(xm_update_one_widget):
(do_call): Pass instance to arm callback and use wv as user data
instead of call data.
2022-03-01 11:30:52 +08:00
Po Lu
e05478050a * src/xterm.c: Explain frame resize synchronization. 2022-03-01 09:00:29 +08:00
Paul Eggert
d150eb438b Work around merge-gnulib glitch from fresh checkout
* admin/merge-gnulib: In a fresh checkout, run gnulib-tool
twice, instead of merely running autogen.sh twice.
2022-02-28 13:17:19 -08:00
Stefan Monnier
83b0f46a26 ecomplete: Try and avoid losing data
* lisp/ecomplete.el (ecomplete-add-item): Make sure the database is
setup, so we don't risk overwriting it with a (mostly) empty one.
(ecomplete-save): Don't save an empty database.
2022-02-28 11:59:38 -05:00
Martin Rudalics
0d123d602c ; In xterm.c add comment about frame resizing under X 2022-02-28 16:36:15 +01:00
Po Lu
cde8e5afbb Clean up input extension event handling code
* src/xterm.c (handle_one_xevent): Fix usages of event
structures of the wrong type.
2022-02-28 20:21:24 +08:00