]> git.eshelyaron.com Git - emacs.git/log
emacs.git
13 months agoMark treesit--things-around obsolete
Yuan Fu [Fri, 10 Nov 2023 05:19:12 +0000 (21:19 -0800)]
Mark treesit--things-around obsolete

* lisp/treesit.el (treesit--things-around): Mark obsolete.

13 months agoReplace treesit--things-around with new functions (bug#66989)
Yuan Fu [Fri, 10 Nov 2023 05:09:48 +0000 (21:09 -0800)]
Replace treesit--things-around with new functions (bug#66989)

* lisp/treesit.el (treesit-forward-sexp):
Replace things-around with thing-at.
(treesit--navigate-thing): Replace things-around with
thing-prev/next/at.  Also this should fix the problem described in
bug#66989.
(treesit-thing-at-point): Replace things-around with thing-at.

13 months agoAdd treesit thing-at-point functions
Yuan Fu [Fri, 10 Nov 2023 04:50:44 +0000 (20:50 -0800)]
Add treesit thing-at-point functions

* lisp/treesit.el (treesit--thing-sibling):
(treesit--thing-prev):
(treesit--thing-next):
(treesit--thing-at): New functions.

13 months agoAdd treesit-node-enclosed-p
Yuan Fu [Fri, 10 Nov 2023 04:49:30 +0000 (20:49 -0800)]
Add treesit-node-enclosed-p

* doc/lispref/parsing.texi (Accessing Node Information):
Add manual entry.
* lisp/treesit.el (treesit-node-enclosed-p): New function.
(treesit): Add shortdoc entry.
* test/src/treesit-tests.el (treesit-node-api): Add tests.

13 months agoAdd shortdoc for treesit-node-get
Yuan Fu [Fri, 10 Nov 2023 04:09:06 +0000 (20:09 -0800)]
Add shortdoc for treesit-node-get

13 months agoClean-up warnings for non native builds (this time for real)
Andrea Corallo [Thu, 9 Nov 2023 18:12:14 +0000 (19:12 +0100)]
Clean-up warnings for non native builds (this time for real)

* lisp/emacs-lisp/comp.el (comp-native-version-dir)
(comp-subr-arities-h, native-comp-eln-load-path)
(native-comp-enable-subr-trampolines): Remove warning.
(comp--compile-ctxt-to-file, comp--init-ctxt, comp--release-ctxt)
(comp-el-to-eln-filename)
(comp-el-to-eln-rel-filename, native-elisp-load): Declare.
* lisp/emacs-lisp/comp-run.el (comp--no-native-compile)
(comp-deferred-pending-h, comp-installed-trampolines-h)
(native-comp-enable-subr-trampolines): Remove warning.
(comp--install-trampoline, comp-el-to-eln-filename)
(native-elisp-load): Declare.
* lisp/emacs-lisp/comp-common.el: Update.

13 months ago* lisp/minibuffer.el (minibuffer-choose-completion-or-exit): Improve.
Juri Linkov [Thu, 9 Nov 2023 16:24:48 +0000 (18:24 +0200)]
* lisp/minibuffer.el (minibuffer-choose-completion-or-exit): Improve.

Use minibuffer-complete-and-exit instead of exit-minibuffer
since this is what it's used in the completion minibuffer.

13 months agoImprove 'next-line-completion' and add more tests
Juri Linkov [Thu, 9 Nov 2023 16:20:14 +0000 (18:20 +0200)]
Improve 'next-line-completion' and add more tests

* lisp/simple.el (next-line-completion): Improve (bug#59486).
Better handle the case when completion-auto-wrap is nil.

* test/lisp/minibuffer-tests.el (completion-auto-wrap-test)
(completions-header-format-test)
(completions-affixation-navigation-test): Add calls to
'next-line-completion' and 'previous-line-completion'.
(completions-group-navigation-test): New test.

13 months agoClean-up warnings for non native builds
Andrea Corallo [Thu, 9 Nov 2023 16:00:22 +0000 (17:00 +0100)]
Clean-up warnings for non native builds

* lisp/emacs-lisp/comp-common.el (native-comp-enable-subr-trampolines)
(comp-installed-trampolines-h, comp-subr-arities-h)
(native-comp-eln-load-path, comp-native-version-dir)
(comp-deferred-pending-h, comp--no-native-compile): Silence
warning.
(comp-el-to-eln-rel-filename, native-elisp-load)
(comp--release-ctxt, comp--init-ctxt)
(comp--compile-ctxt-to-file, comp-el-to-eln-filename)
(comp--install-trampoline): Declare function.
* lisp/emacs-lisp/comp.el : Update.

13 months agocomp: Don't load.el comp when C-h f
Andrea Corallo [Wed, 8 Nov 2023 15:36:24 +0000 (16:36 +0100)]
comp: Don't load.el comp when C-h f

* lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers)
(comp-function-type-spec): Move here.

13 months agocomp: Add comp-common.el
Andrea Corallo [Wed, 8 Nov 2023 15:19:18 +0000 (16:19 +0100)]
comp: Add comp-common.el

* lisp/emacs-lisp/comp-common.el: New file.
(comp-common): New group.
(native-comp-verbose, native-comp-never-optimize-functions)
(native-comp-async-env-modifier-form, comp-limple-calls)
(comp-limple-sets, comp-limple-assignments)
(comp-limple-branches, comp-limple-ops)
(comp-limple-lock-keywords, comp-log-buffer-name, comp-log)
(native-comp-limple-mode, comp-log-to-buffer)
(comp-ensure-native-compiler, comp-trampoline-filename)
(comp-eln-load-path-eff): Move here
* lisp/emacs-lisp/comp-run.el (comp-common): Require.
* lisp/emacs-lisp/comp.el (comp-common): Require.
* admin/MAINTAINERS: Add comp-common.el
* lisp/Makefile.in (COMPILE_FIRST): Likewise.
* src/Makefile.in (elnlisp): Likewise.

13 months agoDon't load comp when installing an existing trampoline
Andrea Corallo [Tue, 7 Nov 2023 10:28:32 +0000 (11:28 +0100)]
Don't load comp when installing an existing trampoline

* lisp/emacs-lisp/nadvice.el (advice--add-function): Update.
(comp-subr-trampoline-install): Update src file.
* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Autoload.
* lisp/emacs-lisp/comp-run.el (comp-log-buffer-name)
(native--compile-async, comp-warn-primitives)
(comp-trampoline-filename, comp-eln-load-path-eff)
(comp-trampoline-search, comp-trampoline-compile): Move here.
* lisp/emacs-lisp/advice.el (comp-subr-trampoline-install): Update
src file.

13 months agocomp: don't require 'warnings' in comp-run
Andrea Corallo [Wed, 25 Oct 2023 21:50:39 +0000 (23:50 +0200)]
comp: don't require 'warnings' in comp-run

* lisp/emacs-lisp/comp-run.el (warnings): Don't require.
(warning-suppress-types): Wave warning.
* lisp/emacs-lisp/warnings.el (warning-suppress-types): Autoload it.

13 months agocomp: make comp-run don't require cl-lib at runtime
Andrea Corallo [Wed, 25 Oct 2023 15:58:43 +0000 (17:58 +0200)]
comp: make comp-run don't require cl-lib at runtime

* lisp/emacs-lisp/comp-run.el (cl-lib): Require it only at compile
time.
(native-compile-async-skip-p): Use 'seq-some'.
(native--compile-async): Don't use 'cl-substitute'.

13 months agocomp: split code in comp-run.el
Andrea Corallo [Thu, 19 Oct 2023 16:10:25 +0000 (18:10 +0200)]
comp: split code in comp-run.el

* lisp/emacs-lisp/comp-run.el : New file.
(comp-run)
(native-comp-jit-compilation-deny-list)
(native-comp-async-jobs-number)
(native-comp-async-report-warnings-errors)
(native-comp-always-compile)
(native-comp-async-cu-done-functions)
(native-comp-async-all-done-hook)
(native-comp-async-env-modifier-form)
(native-comp-async-query-on-exit, native-comp-verbose)
(comp-log-buffer-name, comp-async-buffer-name, comp-no-spawn)
(comp-async-compilations, native-comp-limple-mode)
(comp-ensure-native-compiler, native-compile-async-skip-p)
(comp-files-queue, comp-async-compilations, comp-async-runnings)
(comp-num-cpus, comp-effective-async-max-jobs)
(comp-last-scanned-async-output)
(comp-accept-and-process-async-output, comp-valid-source-re)
(comp-run-async-workers, native--compile-async)
(native-compile-async): Move these definitions here.
* lisp/Makefile.in (COMPILE_FIRST): Update.
* src/Makefile.in (elnlisp): Likewise.
* admin/MAINTAINERS: Likewise.

13 months agoPromptly disable 'completion-in-region-mode' (bug#67001)
Eshel Yaron [Wed, 8 Nov 2023 17:27:03 +0000 (18:27 +0100)]
Promptly disable 'completion-in-region-mode' (bug#67001)

Avoid keeping 'completion-in-region-mode' on when exiting
'completion--in-region-1' if the *Completions* buffer isn't shown.
Otherwise, the bindings from 'completion-in-region-mode-map' linger,
notable shadowing other bindings for TAB.

* lisp/minibuffer.el (completion--in-region-1): Disable
'completion-in-region-mode' if the *Completions* buffer isn't visible.

13 months ago* lisp/progmodes/elisp-mode.el (elisp--local-variables): Remove `debug'.
Juri Linkov [Thu, 9 Nov 2023 07:32:39 +0000 (09:32 +0200)]
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Remove `debug'.

Remove symbol `debug' from the condition-case handler of `error'
that was added in commit f931cebce76d911dfc61274e0a8c1de3627b9179
since it interferes on completing in an incomplete elisp form (bug#66979).

13 months agoGuarantee files are auto-saved when Emacs is terminated by Android
Po Lu [Thu, 9 Nov 2023 02:12:24 +0000 (10:12 +0800)]
Guarantee files are auto-saved when Emacs is terminated by Android

* java/org/gnu/emacs/EmacsNative.java (shutDownEmacs):

* java/org/gnu/emacs/EmacsService.java (onDestroy): New
function.  When invoked, call shut_down_emacs and await its
completion.

* src/android.c (android_shut_down_emacs, shutDownEmacs): New
functions.

13 months agoWith `native-compile', compile lambdas in a defun or lambda too
Alan Mackenzie [Wed, 8 Nov 2023 20:49:48 +0000 (20:49 +0000)]
With `native-compile', compile lambdas in a defun or lambda too

This fixes bug#64646.  Also refactor two functions to reduce
code duplication.

* lisp/emacs-lisp/comp.el (comp-spill-lap-function/symbol)
(comp-spill-lap-function/list): Add all functions found by the
byte compiler (including lambdas) to the native compiler's
context, thus making them be native compiled.  Refactor to use
comp-intern-func-in-ctxt.  Make comp-spill-lap-function/list
also compile closures.

* test/src/comp-resources/comp-test-funcs.el
(comp-tests-lambda-return-f2): New function

* test/src/comp-tests.el (comp-test-lambda-return2)
(comp-tests-free-fun-f2): New functions to test that internal
lambdas get native compiled.

13 months agoSimplify 'project-remember-projects-under' master
Philip Kaludercic [Wed, 1 Nov 2023 21:34:28 +0000 (22:34 +0100)]
Simplify 'project-remember-projects-under'

* lisp/progmodes/project.el (project-remember-projects-under): Instead
of traversing the directories manually, re-use
`directory-files-recursively' to reduce complexity.  (Bug#66649)

13 months ago* lisp/minibuffer.el (minibuffer-choose-completion-or-exit): New command.
Juri Linkov [Wed, 8 Nov 2023 07:38:35 +0000 (09:38 +0200)]
* lisp/minibuffer.el (minibuffer-choose-completion-or-exit): New command.

(minibuffer-visible-completions-map): Bind it to "RET".
https://lists.gnu.org/archive/html/emacs-devel/2023-11/msg00246.html

13 months agoDon't leave point amid text conversion edits if auto-fill transpires
Po Lu [Wed, 8 Nov 2023 03:03:57 +0000 (11:03 +0800)]
Don't leave point amid text conversion edits if auto-fill transpires

* lisp/simple.el (analyze-text-conversion): Save point in
old-point after auto-fill completes, so that point-moved is not
set if point remains intact subsequent to the execution of both
hooks.

13 months agoEglot: Demote errors to warnings in eglot-ensure
João Távora [Tue, 7 Nov 2023 15:09:30 +0000 (09:09 -0600)]
Eglot: Demote errors to warnings in eglot-ensure

Github-reference: https://github.com/joaotavora/eglot/discussions/1318

* doc/misc/eglot.texi (Quick Start): Reword.
(Starting Eglot): Reword.

* lisp/progmodes/eglot.el (eglot-ensure): Demote errors to warnings.

13 months ago; * lisp/minibuffer.el (completion-lazy-hilit-fn): Fix last change.
Eli Zaretskii [Tue, 7 Nov 2023 14:31:40 +0000 (16:31 +0200)]
; * lisp/minibuffer.el (completion-lazy-hilit-fn): Fix last change.

13 months ago; Minor documentation fixes
Eli Zaretskii [Tue, 7 Nov 2023 14:29:06 +0000 (16:29 +0200)]
; Minor documentation fixes

* etc/NEWS:
* lisp/minibuffer.el (completion-lazy-hilit)
(completion-lazy-hilit-fn, completion-lazy-hilit): Fix recently
added documentation.

13 months ago* lisp/simple.el (next-line-completion): Improve (bug#59486).
Juri Linkov [Mon, 6 Nov 2023 17:43:06 +0000 (19:43 +0200)]
* lisp/simple.el (next-line-completion): Improve (bug#59486).

Handle the case when lines with completion candidates are
interspersed with lines that contain group headings.

13 months agoAllow completion frontends to fontify candidates just-in-time
João Távora [Wed, 25 Oct 2023 12:45:01 +0000 (13:45 +0100)]
Allow completion frontends to fontify candidates just-in-time

bug#48841, bug#47711

The variable may be bound by the frontend to a non-nil around
completion-producing calls like completion-all-completions.  See
completion-lazy-hilit docstring for more info.

* lisp/icomplete.el (icomplete-minibuffer-setup): Set completion-lazy-hilit.
(icomplete--render-vertical): Call completion-lazy-hilit.
(icomplete-completions): Call completion-lazy-hilit.

* lisp/minibuffer.el (completion-lazy-hilit): New variable.
(completion-lazy-hilit): New function.
(completion-lazy-hilit-fn): New variable.
(completion-pcm--regexp)
(completion--flex-score-last-md): New helper variables.
(completion--flex-score-1): New helper.
(completion-pcm--hilit-commonality): Use completion-lazy-hilit.
(completion--flex-adjust-metadata): Rework sorting code.

* etc/NEWS: Mention completion-lazy-hilit

13 months ago; * lisp/emacs-lisp/cl-macs.el: Axe useless `gethash` inline decl
Mattias Engdegård [Mon, 6 Nov 2023 11:06:40 +0000 (12:06 +0100)]
; * lisp/emacs-lisp/cl-macs.el: Axe useless `gethash` inline decl

13 months agoSilence warning when requiring ruby-ts-mode
Stefan Kangas [Mon, 6 Nov 2023 07:51:59 +0000 (08:51 +0100)]
Silence warning when requiring ruby-ts-mode

* lisp/progmodes/ruby-ts-mode.el: Silence warning when requiring
file without a treesitter grammar.

13 months ago* lisp/vc/vc-git.el (vc-git-revision-table): Reverse the table (bug#64656).
Juri Linkov [Mon, 6 Nov 2023 07:27:48 +0000 (09:27 +0200)]
* lisp/vc/vc-git.el (vc-git-revision-table): Reverse the table (bug#64656).

13 months agoEmulate secondary selections on Android
Po Lu [Mon, 6 Nov 2023 02:14:09 +0000 (10:14 +0800)]
Emulate secondary selections on Android

* doc/lispref/frames.texi (Other Selections): Revise
documentation to match.

* lisp/term/android-win.el (android-secondary-selection): New
variable.
(android-primary-selection, android-get-clipboard-1)
(android-get-primary, gui-backend-get-selection)
(gui-backend-selection-exists-p, gui-backend-selection-owner-p)
(gui-backend-set-selection): Update doc strings and code as is
proper.

13 months ago* lisp/emacs-lisp/cl-extra.el (cl-remprop): Update names to match docstring
Jeremy Bryant [Sat, 4 Nov 2023 23:29:10 +0000 (23:29 +0000)]
* lisp/emacs-lisp/cl-extra.el (cl-remprop): Update names to match docstring

13 months agoNew option to use arrows in the minibuffer to select completions (bug#59486)
Juri Linkov [Sun, 5 Nov 2023 17:52:33 +0000 (19:52 +0200)]
New option to use arrows in the minibuffer to select completions (bug#59486)

* lisp/minibuffer.el (minibuffer-visible-completions): New defcustom.
(minibuffer-visible-completions-bind): New function.
(minibuffer-visible-completions-map): New defvar-keymap.
(minibuffer-mode): Set buffer-local minibuffer-completion-auto-choose
to nil for minibuffer-visible-completions.
(completing-read-default, completion-in-region-mode):
Use minibuffer-visible-completions to compose keymap
with minibuffer-visible-completions-map.
(minibuffer-next-completion): Add new arg VERTICAL,
and use next-line-completion.
(minibuffer-next-line-completion)
(minibuffer-previous-line-completion): New commands.

13 months agoDeclare calc-eval-error in calc.el
Stefan Kangas [Sun, 5 Nov 2023 16:36:21 +0000 (17:36 +0100)]
Declare calc-eval-error in calc.el

* lisp/calc/calc.el (calc-eval-error): Declare.  (Bug#58801)

13 months agoFurther improve test coverage of time-stamp-pattern parsing
Stephen Gildea [Sun, 5 Nov 2023 04:46:27 +0000 (21:46 -0700)]
Further improve test coverage of time-stamp-pattern parsing

* test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): Use test
strings that are easier to mis-parse, for a more exacting test.

* (fz-make+zone, fz-make-zone): Declare pure.

13 months agoImplement more Android text editing controls
Po Lu [Sun, 5 Nov 2023 02:40:52 +0000 (10:40 +0800)]
Implement more Android text editing controls

* lisp/term/android-win.el (android-deactivate-mark-command):
New command.
(select-all, start-selecting-text, stop-selecting-text): Arrange
for commands manipulating the region to be executed when these
keys are registered.

* src/android.c (android_get_keysym_name): Return the keysym
name of each of the new keysyms introduced.

* src/androidterm.c (performContextMenuAction): Save special
keysyms into key events for the selectAll, startSelectingText
and stopSelectingText actions.

13 months agoAdd project-any-command and project-prefix-or-any-command
Dmitry Gutov [Sun, 5 Nov 2023 00:35:25 +0000 (02:35 +0200)]
Add project-any-command and project-prefix-or-any-command

* lisp/progmodes/project.el (project-any-command): New command.
(project-prefix-map): Bind it to 'o'.
(project-switch-commands): Add entry for it here too.
(project-prefix-or-any-command): New command (bug#63648).
(project-switch-commands): Update the custom type to mention
'project-prefix-or-any-command' as well.
* etc/NEWS: Document the change.

13 months agoAlign date stamps to whole days in ERC
F. Jason Park [Fri, 3 Nov 2023 00:05:48 +0000 (17:05 -0700)]
Align date stamps to whole days in ERC

* lisp/erc/erc-stamp.el (erc-stamp--current-time): Ditch overriding
precedence of the `erc--ts' property in `:around' method because the
variable `erc-stamp--current-time' fills that role well enough.
(erc-stamp--current-datestamp-left): Remove unused variable.
(erc-stamp--insert-date-stamp-as-phony-message): Assume
`erc-timestamp-last-inserted-left' has already been assigned the
updated rendered stamp for the current time.
(erc-stamp--lr-date-on-pre-modify): Use the variable
`erc-stamp--current-time' instead of the `erc-ts' property to convey
an overriding time value for `erc-add-timestamp'.  Set
`erc-timestamp-last-inserted-left' instead of fiddling with another
temporary variable to hack around these ill-fitting interfaces.  Use
day-aligned time value for the `erc-ts' property assigned to date
stamps.
(erc-stamp--date-mode): New internal minor mode.
(erc-insert-timestamp-left-and-right): Defer to `erc-stamp--date-mode'
for setting up date-stamp specific hooks.
(erc-stamp--time-as-day): New function to "round" a date stamp to
start of local day.
(erc-stamp--setup): Defer to `erc-stamp--date-mode' for date-stamp
specific teardown.  (Bug#60936)
* test/lisp/erc/erc-fill-tests.el
(erc-fill-tests--current-time-value): Change default value to nil.
(erc-stamp--current-time): New method for test cases.
(erc-fill-tests--insert-privmsg): Use realistic value for `unparsed'
slot.
(erc-fill-tests--wrap-populate): Bind
`erc-fill-tests--current-time-value' to 0.  Don't mock the function
`erc-stamp--current-time' because doing so inhibits normal polymorphic
dispatch, which test cases rely on for delivering correct timestamp
values in varied contexts.
; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.

13 months agoDecouple disparate escape-hatch concerns in erc-stamp
F. Jason Park [Sat, 4 Nov 2023 20:48:11 +0000 (13:48 -0700)]
Decouple disparate escape-hatch concerns in erc-stamp

* lisp/erc/erc-stamp.el (erc-stamp--allow-unmanaged): Improve doc
string.
(erc-stamp--permanent-cursor-sensor-functions): New variable to take
over the formerly provided `cursor-sensor-functions' aspect of the
flag `erc-stamp--allow-unmanaged'.
(erc-add-timestamp): Use
`erc-stamp--permanent-cursor-sensor-functions' instead of
`erc-stamp--allow-unmanaged' in guard condition.
(erc-munge-invisibility-spec): Use dedicated compatibility flag
`erc-stamp--permanent-cursor-sensor-functions' and forgo unnecessary
setup when it's non-nil.  (Bug#60936)

13 months agoPreserve user markers when inserting ERC date stamps
F. Jason Park [Sat, 4 Nov 2023 18:08:22 +0000 (11:08 -0700)]
Preserve user markers when inserting ERC date stamps

* lisp/erc/erc-stamp.el
(erc-stamp--insert-date-stamp-as-phony-message): Ensure existing
user markers aren't displaced by date-stamp insertion.
* lisp/erc/erc.el (erc--insert-line-function): New function-valued
variable for overriding `insert'.
(erc-insert-line): Call `erc--insert-line-function', when non-nil, to
insert line specially.
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--on-insert-modify): New assertion helper
function.
(erc-scenarios-stamp--date-mode/left-and-right): New test.
(Bug#60936)

13 months agoDon't over-truncate erc-timestamp-format-left
F. Jason Park [Thu, 2 Nov 2023 02:22:49 +0000 (19:22 -0700)]
Don't over-truncate erc-timestamp-format-left

* lisp/erc/erc-stamp.el (erc-timestamp-format-left): Fix typo in doc
string and mention that changing the value mid-session requires
cycling the minor mode.
(erc-echo-timestamp-format): Add Custom :tag for choices.
(erc-stamp--date-format-end): Revise doc string.
(erc-stamp--format-date-stamp): Fix bug involving erroneous truncation
parameter for `substring' when `erc-timestamp-format-left' doesn't end
in a newline.  Thanks to Emanuel Berg for catching this.
(erc-stamp-prepend-date-stamps-p) Revise doc string.
(erc-insert-timestamp-left-and-right): Add comment regarding
compatibility concession.  (Bug#60936)

13 months agoReally fix off-by-one in erc--get-inserted-msg-bounds
F. Jason Park [Fri, 3 Nov 2023 23:07:20 +0000 (16:07 -0700)]
Really fix off-by-one in erc--get-inserted-msg-bounds

* lisp/erc/erc.el (erc--get-inserted-msg-bounds): Account for
`previous-single-property-change' returning a position adjacent to
that with an actual changed value.  The prior attempt at addressing
this was insufficient.
* test/lisp/erc/erc-tests.el (erc--get-inserted-msg-bounds): New test.
; * test/lisp/erc/resources/base/local-modules/second.eld: Timeout.
; * test/lisp/erc/resources/base/local-modules/third.eld: Timeout.

13 months ago; Fix last change in the FAQ
Eli Zaretskii [Sat, 4 Nov 2023 15:29:24 +0000 (17:29 +0200)]
; Fix last change in the FAQ

* doc/misc/efaq.texi (Start Emacs maximized, Common requests): Fix
last change.

13 months agoMake FAQ on starting Emacs maximized portable
Stefan Kangas [Sat, 4 Nov 2023 13:51:33 +0000 (14:51 +0100)]
Make FAQ on starting Emacs maximized portable

* doc/misc/efaq.texi (Start Emacs Maximized): Rename node from
"Fullscreen mode on MS-Windows".  Make advice portable to other
platforms, and remove MS-Windows specific hacks.
Ref: https://lists.gnu.org/r/emacs-devel/2023-10/msg00733.html

Co-authored-by: David Hedlund <public@beloved.name>
13 months ago; Improve commentary in 'files-tests-save-buffer-read-only-file'.
Eli Zaretskii [Sat, 4 Nov 2023 13:02:07 +0000 (15:02 +0200)]
; Improve commentary in 'files-tests-save-buffer-read-only-file'.

13 months agoAdd tests for saving to write-protected files
Jens Schmidt [Wed, 1 Nov 2023 18:56:06 +0000 (19:56 +0100)]
Add tests for saving to write-protected files

* test/lisp/files-tests.el (files-tests--with-yes-or-no-p): Add macro.
(files-tests-save-buffer-read-only-file): Add test for writing to
write-protected files with `save-buffer'.  (Bug#66546)

13 months ago; Update eww-suggest-uris :version.
Visuwesh [Sat, 4 Nov 2023 02:39:14 +0000 (08:09 +0530)]
; Update eww-suggest-uris :version.

* lisp/net/eww.el (eww-suggest-uris): Bump it to 30.1 since it was
changed.  (Bug#66926)

13 months agoFix bytecomp-tests--dest-mountpoint test failure
Mattias Engdegård [Sat, 4 Nov 2023 09:19:52 +0000 (10:19 +0100)]
Fix bytecomp-tests--dest-mountpoint test failure

* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--dest-mountpoint): Add lexical cookie.

Bug reported and fix suggested by Jens Schmidt
(https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00719.html)

13 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 4 Nov 2023 09:21:39 +0000 (05:21 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

33fae4b02d6 Suggest alternative reason for ERT test duplication error

13 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 4 Nov 2023 09:21:39 +0000 (05:21 -0400)]
Merge from origin/emacs-29

196def4fa64 Fix description of 'Package-Requires' library header
c1778432790 ; * doc/misc/tramp.texi (FUSE setup): Fix typo.
a64336cbb9c * lisp/emacs-lisp/cl-lib.el (cl--defalias): Improve&fix d...
da8b85b577d Add two docstrings in cl-lib.el

13 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 4 Nov 2023 09:21:38 +0000 (05:21 -0400)]
; Merge from origin/emacs-29

The following commits were skipped:

41939127457 Fix Tramp (don't merge)
c22eeba8277 ; Fix typo
4f57af7fccd * doc/misc/tramp.texi (Traces and Profiles): Fix indentat...
ccaf801baad * doc/misc/tramp.texi (Traces and Profiles): Fix indentat...

13 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 4 Nov 2023 09:21:38 +0000 (05:21 -0400)]
Merge from origin/emacs-29

d5e5ea4e36b Fix guessing commands for zstandard archives in Dired
90db29aff86 Fix eglot.texi (JSONRPC objects in Elisp) example
5ef48ad6a37 ; Fix one author's name.
c4e9a6159a3 * doc/man/emacsclient.1: Fix --tramp option.
6dca3a8eab2 Improve `nsm-protocol-check--3des-cipher` docstring

13 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 4 Nov 2023 09:21:38 +0000 (05:21 -0400)]
; Merge from origin/emacs-29

The following commits were skipped:

04215e616f5 Recognize backslash in `dns-mode` quoted values
6629e861b35 Make `dns-mode` fontify quoted values correctly

13 months agoSuggest alternative reason for ERT test duplication error
Mattias Engdegård [Fri, 3 Nov 2023 17:06:04 +0000 (18:06 +0100)]
Suggest alternative reason for ERT test duplication error

* lisp/emacs-lisp/ert.el (ert-set-test): Amend error message;
maybe the redefinition was caused by a file loaded twice.
(Bug#66782)

Suggested by Xiyue Deng.

(cherry picked from commit 425d23fbeaede81ab4f50b4073949cc1c8a3fbd0)

13 months agoDon't need text properties when sending a mail
Manuel Giraud [Wed, 1 Nov 2023 12:59:37 +0000 (13:59 +0100)]
Don't need text properties when sending a mail

* lisp/mail/smtpmail.el (smtpmail-send-data): Don't get text
properties when sending mail data.  (Bug#66880)

13 months agoFix desktop-save on remote dired (bug#66697)
Manuel Giraud [Tue, 24 Oct 2023 12:51:04 +0000 (14:51 +0200)]
Fix desktop-save on remote dired (bug#66697)

Do not gather "misc data" for dired buffer not meant to be
desktop saved.

lisp/dired.el (dired-desktop-save-p): New function to test if
`dired-directory' should be desktop saved.
(dired-desktop-buffer-misc-data): Use it.

13 months agoFix description of 'Package-Requires' library header
Eli Zaretskii [Sat, 4 Nov 2023 07:59:45 +0000 (09:59 +0200)]
Fix description of 'Package-Requires' library header

* doc/lispref/tips.texi (Library Headers): Update the description
of the 'Package-Requires' header.  (Bug#66677)

13 months agoRemove unnecessary assertion added 2 days ago
Eli Zaretskii [Sat, 4 Nov 2023 07:33:33 +0000 (09:33 +0200)]
Remove unnecessary assertion added 2 days ago

* src/xdisp.c (get_glyph_face_and_encoding): Remove unnecessary
assertion.  It triggers, for no good reason, when running the
recipe of bug#66922 and typing C-p in the *Warnings* buffer after
the recipe finishes, because the glyph passed to this function is
a STRETCH_GLYPH, not a CHAR_GLYPH.

13 months agoMH-E testing: find locally-installed GNU Mailutils libraries
Stephen Gildea [Fri, 3 Nov 2023 22:24:21 +0000 (15:24 -0700)]
MH-E testing: find locally-installed GNU Mailutils libraries

* test/lisp/mh-e/test-all-mh-variants.sh: LD_LIBRARY_PATH is sometimes
necessary.  This reverts part of commit f1fcd321ff of 24 Nov 2021.

13 months ago* lisp/emacs-lisp/comp-cstr.el (comp--direct-supertype): Remove unused.
Andrea Corallo [Fri, 3 Nov 2023 17:34:05 +0000 (18:34 +0100)]
* lisp/emacs-lisp/comp-cstr.el (comp--direct-supertype): Remove unused.

13 months agoSuggest alternative reason for ERT test duplication error
Mattias Engdegård [Fri, 3 Nov 2023 17:06:04 +0000 (18:06 +0100)]
Suggest alternative reason for ERT test duplication error

* lisp/emacs-lisp/ert.el (ert-set-test):
Amend error message; maybe the redefinition was caused by a file
loaded twice (bug#66782).

Suggested by Xiyue Deng.

13 months ago; Fix recent changes in documentation
Eli Zaretskii [Fri, 3 Nov 2023 07:41:11 +0000 (09:41 +0200)]
; Fix recent changes in documentation

* lisp/man.el (Man-header-file-path, man): Doc fix.

* etc/NEWS: Fix wording.

13 months agoRound underline position and thickness
Po Lu [Fri, 3 Nov 2023 07:20:04 +0000 (15:20 +0800)]
Round underline position and thickness

* src/sfntfont.c (sfntfont_open): Round underline thickness
instead of truncating it, as is proper according to several
inquiries.

13 months agoAvoid moving point while analyzing text conversion
Po Lu [Fri, 3 Nov 2023 03:32:17 +0000 (11:32 +0800)]
Avoid moving point while analyzing text conversion

* lisp/simple.el (analyze-text-conversion): If neither calling
p-s-i-h nor calling p-t-c-h yields a change to point, return it
to its location before analyze-text-conversion was called.

* src/keyboard.c (kbd_buffer_get_event): See that text
conversion events are uniformly delivered prior to keyboard
events arriving in unison.

13 months ago* lisp/emacs-lisp/oclosure.el (oclosure--lambda): Burp in dynbind mode
Stefan Monnier [Fri, 3 Nov 2023 03:12:00 +0000 (23:12 -0400)]
* lisp/emacs-lisp/oclosure.el (oclosure--lambda): Burp in dynbind mode

The "fixes" bug#66867.

13 months agoRemove 'M-.' binding from js-mode and js-ts-mode
Dmitry Gutov [Thu, 2 Nov 2023 23:40:36 +0000 (01:40 +0200)]
Remove 'M-.' binding from js-mode and js-ts-mode

* lisp/progmodes/js.el (js-mode-map, js-ts-mode-map): Remove.
The global binding must be a lot more useful for most users
(https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg01295.html).

13 months agoAdapt doc for man.el
Michael Albinus [Thu, 2 Nov 2023 11:14:13 +0000 (12:14 +0100)]
Adapt doc for man.el

* etc/NEWS: Rephrase 'Man-support-remote-systems' entry.
Fix typos.

* lisp/man.el (Man-header-file-path, man): Adapt docstrings.

13 months ago; Improve documentation of recent changes
Eli Zaretskii [Thu, 2 Nov 2023 07:56:55 +0000 (09:56 +0200)]
; Improve documentation of recent changes

* etc/NEWS:
* lisp/simple.el (completion-auto-wrap, completion-auto-select)
(first-completion, last-completion, previous-completion)
(next-completion, previous-line-completion)
(next-line-completion): Doc fixes.  (Bug#59486)

13 months agoProperly compute overhangs for overstruck text
Po Lu [Thu, 2 Nov 2023 05:18:37 +0000 (13:18 +0800)]
Properly compute overhangs for overstruck text

* src/xdisp.c (get_glyph_face_and_encoding): Account for
non-character glyphs by not attempting to translate them to
characters.
(gui_get_glyph_overhangs, gui_produce_glyphs): If the face is
overstruck, increase the right side bearing by 1 pixel.

13 months agoPreserve point when inserting date stamps in ERC
F. Jason Park [Tue, 31 Oct 2023 23:50:16 +0000 (16:50 -0700)]
Preserve point when inserting date stamps in ERC

* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-disable): Move
remaining local teardown business to `erc-stamp--setup' and use
`erc-buffer-do' instead of `erc-with-all-buffers-of-server' to
emphasize that all ERC buffers are affected.
(erc-stamp--insert-date-stamp-as-phony-message): Move `erc--msg-props'
binding to `erc-stamp--lr-date-on-pre-modify'.
(erc-stamp--lr-date-on-pre-modify): Bind `erc--msg-props' here so that
the related guard condition in `erc-add-timestamp' is satisfied and
`erc-insert-timestamp-function' runs.  This fixes a regression new in
ERC 5.6 and introduced by c68dc778 "Manage some text props for ERC
insertion-hook members".  Also, `save-excursion' when narrowing to
prevent point from being dislodged after submitting input at the
prompt.
(erc-insert-timestamp-left-and-right): Don't initialize date stamps
when `erc-timestamp-format-left' is nil or consists only of newlines,
and enable fallback behavior in such cases on behalf of users without
informing them.  Allow global hook members to run first so that those
owned by `scrolltobottom' and similar can see the unadulterated input.
Fix wrong hook name.
(erc-stamp--setup): Fix wrong hook name.  Kill all local vars here
instead of sharing this duty with the minor-mode toggle.  (Bug#60936)

13 months ago; Attempt to fix race in erc-buffer-display test
F. Jason Park [Tue, 31 Oct 2023 06:36:54 +0000 (23:36 -0700)]
; Attempt to fix race in erc-buffer-display test

* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--time-vals,
erc-fill-tests--current-time-value): Rename former to latter and
change type from function to natnum.
(erc-fill-tests--wrap-populate, erc-fill-wrap--merge,
erc-fill-wrap--merge-action): Use `erc-fill-tests--current-time-value'
instead of function `erc-fill-tests--time-vals'.
* test/lisp/erc/erc-scenarios-base-association.el
(erc-scenarios-common--base-association-multi-net): Extend timeout.
* test/lisp/erc/erc-scenarios-base-buffer-display.el
(erc-scenarios-base-buffer-display--reconnect-common): Move some
common assertions here from callers.
(erc-scenarios-base-buffer-display--defwin-recbury-intbuf,
erc-scenarios-base-buffer-display--count-reset-timeout):
Factor out a couple common assertions.  Clarify some comments.
(erc-scenarios-base-buffer-display--defwino-recbury-intbuf):
Factor out a couple common assertions and clarify some comments.
Account for possible concurrency bug leading to intermittent
test failures.
* test/lisp/erc/erc-scenarios-base-misc-regressions.el
(erc-scenarios-base-gapless-connect,
erc-scenarios-base-channel-buffer-revival): Extend timeouts.
* test/lisp/erc/resources/dcc/chat/accept.eld: Extend timeout.
* test/lisp/erc/resources/base/reconnect/options-again.eld: Extend
timeouts.
* test/lisp/erc/resources/erc-d/erc-d.el (erc-d--m): Prevent possible
wrong-type error.
* test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Extend
timeouts.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--base-network-id-bouncer): Extend timeout.

13 months ago(project-switch-project): Fix the previous change
Dmitry Gutov [Wed, 1 Nov 2023 20:48:23 +0000 (22:48 +0200)]
(project-switch-project): Fix the previous change

* lisp/progmodes/project.el (project-switch-project):
Clear the buffer-local value in the right buffer (bug#66317).

13 months agoNew commands previous-line-completion and next-line-completion (bug#59486)
Juri Linkov [Wed, 1 Nov 2023 17:45:05 +0000 (19:45 +0200)]
New commands previous-line-completion and next-line-completion (bug#59486)

* lisp/simple.el (completion-list-mode-map): Bind [up] to
'previous-line-completion', and [down] to 'next-line-completion'.
(completion-auto-wrap): Mention `next-line-completion' and
`previous-line-completion' in the docstring.
(previous-line-completion, next-line-completion): New commands.

13 months agoRun `man' also on remote systems
Michael Albinus [Wed, 1 Nov 2023 15:54:31 +0000 (16:54 +0100)]
Run `man' also on remote systems

This implements bug#66758

* doc/emacs/programs.texi (Man Page):
Describe Man-support-remote-systems.

* etc/NEWS: Mention user option 'Man-support-remote-systems'.
Fix typos.

* lisp/dired.el (Man-support-remote-systems): Declare.
(dired-do-man): Use it.  Use also `file-local-name'.

* lisp/man.el (Man-support-remote-systems): New defcustom.
(Man-xref-normal-file): Handle remote files.
(Man-default-directory, Man-shell-file-name)
(Man-header-file-path): New defuns.
(Man-init-defvars): Use octal numbers.
(Man-support-local-filenames): Handle remote files.
(Man-completion-table): Use `Man-default-directory' and `process-file'.
(man): Adapt docstring.
(Man-start-calling): Use `Man-default-directory'.
(Man-getpage-in-background): Use `Man-default-directory',
`Man-shell-file-name', `start-file-process' and `process-file'.  Adapt
buffer name.
(Man-update-manpage): Use `Man-shell-file-name' and `process-file'.
(Man-view-header-file): Use `Man-header-file-path'.

13 months agoNon-recursive marking of buffer-local variables
Mattias Engdegård [Wed, 1 Nov 2023 13:34:30 +0000 (14:34 +0100)]
Non-recursive marking of buffer-local variables

* src/alloc.c (mark_localized_symbol): Inline into...
(process_mark_stack): ...this code and do don't use recursion.

13 months agoAdd two docstrings in cl-macs.el
Jeremy Bryant [Tue, 31 Oct 2023 23:37:10 +0000 (23:37 +0000)]
Add two docstrings in cl-macs.el

* lisp/emacs-lisp/cl-macs.el (cl--simple-exprs-p)
(cl--const-expr-p): Add docstrings

13 months agoPrevent errors when generating events above menu bar windows
Po Lu [Wed, 1 Nov 2023 03:15:24 +0000 (11:15 +0800)]
Prevent errors when generating events above menu bar windows

* src/keyboard.c (make_lispy_position): Pass false to w_f_c,
for the subsequent code is not prepared to encounter menu bar
windows.

13 months agoOnly override the current project buffer-locally
Dmitry Gutov [Wed, 1 Nov 2023 02:01:53 +0000 (04:01 +0200)]
Only override the current project buffer-locally

* lisp/progmodes/project.el (project-switch-project): Only
override the current project buffer-locally.  This is mostly for
the the mode-line indicator (https://debbugs.gnu.org/66317#53).

13 months agoCatch 'permission-denied' during project lookup
Dmitry Gutov [Wed, 1 Nov 2023 01:58:45 +0000 (03:58 +0200)]
Catch 'permission-denied' during project lookup

* lisp/progmodes/project.el (project--find-in-directory):
Catch 'permission-denied' (bug#66317).

Co-Authored-By: Spencer Baugh <sbaugh@catern.com>
13 months agoRespect `browse-url-default-scheme` on Android
Stefan Kangas [Wed, 1 Nov 2023 00:39:27 +0000 (01:39 +0100)]
Respect `browse-url-default-scheme` on Android

* lisp/net/browse-url.el (browse-url-default-android-browser):
Respect 'browse-url-default-scheme'.

13 months agolisp/emacs-lisp/comp-cstr.el: Fix bootstrap
Stefan Monnier [Tue, 31 Oct 2023 23:20:58 +0000 (19:20 -0400)]
lisp/emacs-lisp/comp-cstr.el: Fix bootstrap

* lisp/emacs-lisp/comp-cstr.el: Remove redundant require of `cl-macs`
and add missing require of `cl-extra`.

* lisp/emacs-lisp/cl-generic.el: Improve warning message.
* lisp/emacs-lisp/cl-extra.el (cl--print-table): Remove redundant arg.

13 months ago; * doc/misc/tramp.texi (FUSE setup): Fix typo.
Michael Albinus [Tue, 31 Oct 2023 16:32:23 +0000 (17:32 +0100)]
; * doc/misc/tramp.texi (FUSE setup): Fix typo.

13 months ago* lisp/emacs-lisp/comp.el: Remove redundant requires
Stefan Monnier [Tue, 31 Oct 2023 16:24:51 +0000 (12:24 -0400)]
* lisp/emacs-lisp/comp.el: Remove redundant requires

13 months agoDon't round underline metrics
Po Lu [Tue, 31 Oct 2023 13:04:11 +0000 (21:04 +0800)]
Don't round underline metrics

* src/sfntfont.c (sfntfont_open): Don't round underline position
or thickness, much as the other font drivers don't either.

13 months agoExtract underline positions from PostScript metrics tables
Po Lu [Tue, 31 Oct 2023 10:41:59 +0000 (18:41 +0800)]
Extract underline positions from PostScript metrics tables

* src/sfntfont.c (struct sfnt_font_desc): Introduce fields where
the font's underline position is recorded.
(sfnt_enum_font_1): Compute the underline position with
information in the post table whenever it exists.
(sfntfont_open): Scale the recorded position and save it into
the font object.

13 months ago* lisp/progmodes/project.el (project-menu-entry): Add 'bound-and-true-p'.
Juri Linkov [Tue, 31 Oct 2023 07:34:03 +0000 (09:34 +0200)]
* lisp/progmodes/project.el (project-menu-entry): Add 'bound-and-true-p'.

This is needed for compatibility with older versions (bug#66317).

13 months agoFix project-mode-line-format breaking buffer-file-coding-system (bug#66825)
Juri Linkov [Tue, 31 Oct 2023 07:22:28 +0000 (09:22 +0200)]
Fix project-mode-line-format breaking buffer-file-coding-system (bug#66825)

* lisp/progmodes/project.el (project-mode-line-format):
Let-bind 'last-coding-system-used' to prevent changing
'buffer-file-coding-system' in 'basic-save-buffer'.

13 months ago* lisp/emacs-lisp/cl-lib.el (cl--defalias): Improve&fix docstring
Stefan Monnier [Mon, 30 Oct 2023 22:50:47 +0000 (18:50 -0400)]
* lisp/emacs-lisp/cl-lib.el (cl--defalias): Improve&fix docstring

13 months ago; cperl-mode.el: Obey comment conventions
Harald Jörg [Mon, 30 Oct 2023 16:19:42 +0000 (17:19 +0100)]
; cperl-mode.el: Obey comment conventions

* lisp/progmodes/cperl-mode.el: Use ;;; only for "chapter headings".
Eliminate some redundant and misleading comments.  Fix an over-wide line.

13 months agoAdd two docstrings in cl-lib.el
Jeremy Bryant [Sun, 29 Oct 2023 21:56:54 +0000 (21:56 +0000)]
Add two docstrings in cl-lib.el

* lisp/emacs-lisp/cl-lib.el (cl--set-buffer-substring)
(cl--defalias): Add docstrings.  (Bug#66828)

13 months ago; * lisp/emacs-lisp/comp-cstr.el (comp-subtype-p): Hoist above use.
Mattias Engdegård [Mon, 30 Oct 2023 10:48:04 +0000 (11:48 +0100)]
; * lisp/emacs-lisp/comp-cstr.el (comp-subtype-p): Hoist above use.

13 months agoAscertain font spacing from post table if present
Po Lu [Mon, 30 Oct 2023 07:32:58 +0000 (15:32 +0800)]
Ascertain font spacing from post table if present

* src/sfnt.c (sfnt_table_names): Introduce name of post table.
(sfnt_read_post_table): New function.
(main): New tests.

* src/sfnt.h (struct sfnt_post_table): New struct.

* src/sfntfont.c (sfnt_enum_font_1): Read post table, and set
spacing from its is_fixed_pitch value.
(sfntfont_list_1): Compare spacing between both fonts if
supplied in the font spec.
(sfntfont_open): Set FONT_FILE_INDEX as well as
FONT_FULLNAME_INDEX.

13 months agocomp-cstr.el: The type hierarchy is a DAG, not a tree
Stefan Monnier [Mon, 30 Oct 2023 04:59:19 +0000 (00:59 -0400)]
comp-cstr.el: The type hierarchy is a DAG, not a tree

Adjust the type operations to account for the fact that types can have
several parents.

* lisp/emacs-lisp/comp-cstr.el (comp--cl-class-hierarchy):
Use `cl--class-allparents`.  Add FIXME.
(comp--direct-supertype): Declare obsolete.
(comp--direct-supertypes): New function.
(comp--normalize-typeset0): Rewrite to use `comp--direct-supertypes`;
adjust to account for the DAG structure; use `cl-set-difference`.
(comp--direct-subtypes): Rewrite.
(comp--intersection): New function.
(comp-supertypes): Rewrite and change return type.
(comp-subtype-p): Simplify.
(comp-union-typesets): Use `comp-supertypes` instead of iterating over
`comp-cstr-ctxt-typeof-types`.
* lisp/emacs-lisp/comp.el (comp--native-compile): Don't catch
errors if we're debugging.
* test/lisp/emacs-lisp/comp-cstr-tests.el: Adjust tests.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix mishap when we
evaluate (cl-defstruct cl-structure-object ..) during the compilation
of `cl-preloaded.el`.
* lisp/emacs-lisp/cl-preloaded.el: Add corresponding assertion.

13 months agoExclude Git submodules from 'project-files'
Jim Porter [Sun, 29 Oct 2023 05:20:41 +0000 (22:20 -0700)]
Exclude Git submodules from 'project-files'

* lisp/progmodes/project.el (project--vc-list-files): Exclude Git
submodules (bug#66806).
(project-search, project-query-replace-regexp): Remove now-unneeded
workaround.

13 months agoTeach ffap to look for relative file names under project-root
Spencer Baugh [Sat, 21 Oct 2023 18:35:53 +0000 (14:35 -0400)]
Teach ffap to look for relative file names under project-root

Now file-name-at-point-functions, which runs
ffap-guess-file-name-at-point, will pick up on a file name at point if
that file name is a relative file name which exists when looked up
from the root of the project.

For example, in test/lisp/progmodes/eglot-tests.el there is the string
lisp/progmodes/eglot.el; if you put point on that and C-x C-f,
lisp/progmodes/eglot.el under the root of the Emacs repo will now be
part of future history.

* lisp/ffap.el (ffap-alist): Add entry for ffap-in-project.
(ffap-in-project): Add. (bug#66668)

13 months agoUse OClosure to drop `advice--buffer-local-function-sample` hack
Stefan Monnier [Sun, 29 Oct 2023 18:12:22 +0000 (14:12 -0400)]
Use OClosure to drop `advice--buffer-local-function-sample` hack

* lisp/emacs-lisp/nadvice.el (advice--forward): New OClosure, to
replace `advice--buffer-local-function-sample`.
(advice--set-buffer-local, advice--buffer-local): Adjust accordingly.

13 months agoRequire `cl-lib` rather than directly some of its subfiles
Stefan Monnier [Sun, 29 Oct 2023 18:07:04 +0000 (14:07 -0400)]
Require `cl-lib` rather than directly some of its subfiles

* test/src/filelock-tests.el:
* lisp/net/tramp-sh.el: Require `cl-lib` rather than `cl-seq` or `cl-macs`.

13 months agoEliminate some nested repetitions in regexps
Mattias Engdegård [Thu, 5 Oct 2023 12:06:24 +0000 (14:06 +0200)]
Eliminate some nested repetitions in regexps

Nested repetitions such as (A*)* potentially take exponential time but
can usually be rewritten in a faster and more readable way without
much trouble.  These were all found by Relint.

* lisp/obsolete/terminal.el (te-parse-program-and-args):
* lisp/org/org.el (org-make-tags-matcher):
Apply the transform (A+B*)+ -> A(A|B)*

* lisp/textmodes/fill.el (adaptive-fill-regexp):
Apply the transform A*(B+A*)* -> (A|B)*

* lisp/progmodes/idlw-shell.el (idlwave-shell-filter):
Find the last newline or CR in a more direct way.

* lisp/progmodes/vhdl-mode.el (vhdl-port-copy, vhdl-subprog-copy):
Trim trailing whitespace from a string in a more direct way.
All-whitespace strings are left unchanged as before.

13 months agoFix broken gdb-control-commands-regexp (bug#66363)
Mattias Engdegård [Sun, 29 Oct 2023 16:16:35 +0000 (17:16 +0100)]
Fix broken gdb-control-commands-regexp (bug#66363)

* lisp/progmodes/gdb-mi.el (gdb-python-guile-commands-regexp):
Remove, integrate into...
(gdb-control-commands-regexp): ...this.  Translate into rx.
Remove useless submatches which broke earlier attempts at using other
submatches.  Rewrite tail expression to avoid superlinear nested
repetition, eliminating a Relint complaint.
* lisp/progmodes/gdb-mi.el (gdb-send): Simplify use of the regexp
above, and use the correct submatch this time.  Remove unnecessary and
incorrect second regexp matching.

13 months ago; Fix typo in tramp.texi
Michael Albinus [Sun, 29 Oct 2023 14:29:32 +0000 (15:29 +0100)]
; Fix typo in tramp.texi