~ubuntu-elisp/emacs/+git/master:bugfix/shorthand-fixes

Last commit made on 2023-11-30
Get this branch:
git clone -b bugfix/shorthand-fixes https://git.launchpad.net/~ubuntu-elisp/emacs/+git/master

Branch merges

Branch information

Name:
bugfix/shorthand-fixes
Repository:
lp:~ubuntu-elisp/emacs/+git/master

Recent commits

7e99ed2... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Fix prefix discovery for files with read-symbol-shorthands (bug#67325)

In a previous commit, the local-variable read-symbol-shorthands is
already read into the temporary buffer used for the autoload parsing
aerobatics, so all we needed to do in 'l-g--compute-prefixes' is
use 'read' to give 'read-symbol-shorthands' a chance to kick in.

* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--compute-prefixes):

ff48f14... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Also teach loaddefs-gen.el about shorthands (bug#63480)

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Make aware of read-symbol-shorthands.

48f5bd5... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Improve shorthands-font-lock-shorthands (bug#67390)

Add font locking to the shorthand prefix of a given printed symbol
name by checking if any of the shorthand prefixes in
read-symbol-shorthands are a prefix for that print name. Although
this does more string comparisons, it didn't prove to be any slower
than the existing approach, and is more correct.

This version is more accurate when highlighting files with many
overlapping shorthands. Given:

;; Local Variables:
;; read-symbol-shorthands: (("bc-" . "breadcrumb-")
;; ("aw-" . "ace-window-")
;; ("zorglub/" . "ace-window-")
;; ("he//" . "hyperdrive-entry--")
;; ("h//" . "hyperdrive--")
;; ("he/" . "hyperdrive-entry-")
;; ("h/" . "hyperdrive-"))
;; End:

The following are correct highlights on print names

'(zorglub/blerh ; hilits "zorglub/" reads to 'ace-window-blerh'
  he/foo ; hilits "he/" reads to 'hyperdrive-entry-foo'
  he//bar ; hilits "he//" reads to 'hyperdrive-entry--bar'
  h/coiso ; hilits "h/" reads to 'hyperdrive-coiso'
  h//thingy ; hilits "//" reads to 'hyperdrive--thingy'
  bc-yo ; hilits "bc-" reads to 'breadcrumb-yo'
  aw-thingy ; hilits "aw-" reads to 'ace-window-thingy'
  )

Co-authored-by: Jonas Bernoulli <email address hidden>
Co-authored-by: João Távora <<email address hidden>

* lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands):

d1e8e9d... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Consider read-symbol-shorthands in check-declare.el (bug#67523)

* lisp/emacs-lisp/check-declare.el (check-declare-verify):
Consider read-symbol-shorthands.

e184e15... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Process read-symbol-shorthands from longest to shortest (bug#67390)

This ensures that overlapping shorthands are handled correctly and
consistently even if specified out-of-order by the user.

* doc/lispref/symbols.texi (Shorthands): Describe shorthand sort
order.

* lisp/files.el (hack-local-variables--find-variables): Specially
handle read-symbol-shorthands.

3c6719f... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Make sure read-symbol-shorthands is permanently local

bug#63480, bug#67390

* lisp/files.el (permanently-enabled-local-variables): Add
  read-symbol-shorthands.

5a0250f... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Jsonrpc: prevent while-no-input messing with jsonrpc-request

'jsonrpc-request' already has its "interrupt on user input" mechanism
base on 'sit-for'. If called from a situation that uses
while-no-input to do basically the same, that mechanism may become
confused, so it's important to prevent that interfence.

This was confirmed to be a problem when using the Corfu completion
front-end.

See also
https://github.com/joaotavora/eglot/discussions/1127#discussioncomment-7277567

Many thanks to JD Smith <email address hidden> for helping me debug this
and pointing in the right direction.

* lisp/jsonrpc.el (Version): Bump to 1.0.18
(jsonrpc-request): Bind throw-on-input to nil

02d88e3... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Unbreak Eglot, Jsonrpc as EIEIO inches closer to CLOS (bug#67480)

EIEIO is an innacurate emulation of CLOS in many aspects and one of
them in accessor definition. Before this commit

commit 6c47931a1ad4de4af3f147b9604169c2441100fe
Author: Brandon <email address hidden>
Date: Sat Nov 4 17:11:32 2023 -0400

    Make EIEIO ':accessor' behave like ':reader' when reading (bug#66938)

An :initform-less, non-:initarg'ed slot with be read using an
:accessor which would just return nil. This is EIEIO specific of
course, but it made for (my) sloppy programming in jsonrpc.el and
eglot.el.

Tightening up the rules a bit meant these things broke and now I'm
fixing them.

* lisp/jsonrpc.el (jsonrpc-connection): Add a bunch of :initform nil
(jsonrpc-process-connection): Add a bunch of :initform nil

* lisp/progmodes/eglot.el (eglot-lsp-server): Add a bunch of :initform nil

7a5c91a... by Juri Linkov <email address hidden>

* lisp/dired.el (dired-context-menu): Add menu item "Open With" (bug#63911).

Populate the menu item "Open With" with commands returned
by 'shell-command-guess' on the current file name.

b8d4242... by Juri Linkov <email address hidden>

New user option 'shell-command-guess-functions' (bug#18132)

* lisp/dired-aux.el (dired-minibuffer-default-add-shell-commands):
Remove function since now mailcap commands are available
by shell-command-guess-mailcap for shell-command-guess
used by dired-guess-shell-command.
(dired-read-shell-command): Don't set minibuffer-default-add-function
to dired-minibuffer-default-add-shell-commands.
(dired-guess-shell-command): Replace dired-guess-default
with shell-command-guess.
(shell-command-guess-functions): New defcustom.
(shell-command-guess, shell-command-guess-dired)
(shell-command-guess-mailcap, shell-command-guess-xdg):
New functions.

* lisp/simple.el (minibuffer-default-add-shell-commands):
Use 'shell-command-guess' instead of requiring 'mailcap'
with 'mailcap-file-default-commands'. Remove 'interactive'.