Eric Abrahamsen [Fri, 6 Aug 2021 00:53:05 +0000 (17:53 -0700)]
Further fix to filtering Gnus search group names
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Group
names in the GROUPS argument may be prefixed or not, depending on
which server we're searching, so always enforce prefix policy within
the function.
Make `q' in `org-agenda' work even with `debug-on-error' set
* lisp/org/org-agenda.el (org-agenda-get-restriction-and-command):
Using `error' here will trigger users with `debug-on-error' so use
`user-error' instead (bug#49920). It would probably be preferable
to rewrite this to not use the error system to do control flow.
* lisp/progmodes/perl-mode.el: Handle variables first to avoid
conflicting with keywords. This fixes cases like "$package"
(bug#49906).
Copyright-paperwork-exempt: yes
Allow building on MacOS with MacPorts and libgccjit
* configure.ac: Check for the "port" command (MacPorts).
Add the required lib/include directories for nativecomp.
* src/Makefile.in (LIBGCCJIT_CFLAGS, LIBGCCJIT_LIBS): Split into
two parts to allow including -L/-I for MacPorts.
(LIBES): Adjust.
(EMACS_CFLAGS): Ditto.
dick r. chiang [Fri, 6 Aug 2021 11:24:53 +0000 (13:24 +0200)]
Fix problem with occasional stalls in `url-retrieve-synchronously'
* lisp/url/url.el (url-retrieve-synchronously): Use
`accept-process-output' on a null process. That is the safer, more
conventional way of achieving non-blocking sleep-for (bug#49897).
Eli Zaretskii [Fri, 6 Aug 2021 07:51:45 +0000 (10:51 +0300)]
Fix automatic hscrolling when line numbers are displayed
* src/xdisp.c (hscroll_window_tree): When line numbers are
displayed, account for the the line-number space when calculating
the desired X coordinate on the left. (Bug#49891)
Eli Zaretskii [Fri, 6 Aug 2021 06:46:39 +0000 (09:46 +0300)]
Make sure installed *.eln files have correct permissions
* Makefile.in (install-eln): Add "umask 022" to ensure the *.eln
files are accessible from the user's Emacs session. Suggested by
Wilhelm Kirschbaum <wkirschbaum@gmail.com>. (Bug#49864)
ERC right stamps: also use latest buffer's window's width (Bug#44140)
* lisp/erc/erc-stamp.el (erc-insert-timestamp-right): Use latest
buffer's window's width to position the timestamp, if both
`erc-timestamp-right-column' and `erc-fill-column' are not set (or
`erc-fill-mode' is off). This is what the documentation says, but was
not implemented. Also fix the bug of using selected window's width
instead of the (or some) window showing the buffer. The latest
window's width is saved in `erc-timestamp-last-window-width' and used
when the buffer is no more shown. In case the buffer was never shown,
which I'm not sure can happen, either use `fill-column' if set, or
give up on aligning and just output the timestamp (modulo the kludge)
right after message text. While here, fix the off by one calculation
of point start when the reference is the window's width.
Dmitry Gutov [Fri, 6 Aug 2021 00:30:10 +0000 (03:30 +0300)]
Change how project-find-file's completion works
* lisp/progmodes/project.el (project--completing-read-strict):
Allow to choose a non-existent file, with confirmation
(bug#49204).
Don't use the string at point as a "real" default, and instead
only include it in "future history": meaning, it will be inserted
on 'M-n' (bug#49865).
Juri Linkov [Thu, 5 Aug 2021 23:36:22 +0000 (02:36 +0300)]
Add function minibuffer-restore-windows (bug#45072)
* lisp/minibuffer.el (minibuffer-restore-windows): New function
that removes the completions buffer. Add it to minibuffer-exit-hook.
* src/minibuf.c (read-minibuffer-restore-windows): Mention
minibuffer-restore-windows.
Eli Zaretskii [Thu, 5 Aug 2021 17:42:10 +0000 (20:42 +0300)]
Fix files-tests on non-Posix systems
* test/lisp/files-tests.el (files-test-auto-save-name-default)
(files-test-auto-save-name-transform)
(files-test-auto-save-name-unique, files-test-lock-name-default)
(files-test-lock-name-unique): Skip the drive letter in absolute
file names on MS-Windows/MS-DOS when comparing file names against
the expected ones.
(files-tests-file-name-non-special--subprocess): Skip test on
MS-Windows/MS-DOS.
The current method of propagating constants through setq was unsound
because it relied on each setq form only being traversed at most once
during optimisation, which isn't necessarily true in general; it could
be made to miscompile code in rare cases.
Since it was only used in limited circumstances, disabling this
optimisation doesn't cost us much.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't update the known value when traversing `setq`.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
Make `M-j' work reliably if `comment-auto-fill-only-comments' is set
* lisp/simple.el (default-indent-new-line): Force breaking the
line when called interactively (bug#49849). (Perhaps the
interactive command should be rebound and call this function
instead...)
dickmao [Tue, 3 Aug 2021 16:02:48 +0000 (12:02 -0400)]
ffap ido accommodation
Now that ffap-file-finder can be ido-find-file, the
noninteractive portion of find-file-at-point cannot
assume ffap-file-finder always takes an argument
(ido-find-file does not).
* lisp/ffap.el (find-file-at-point): Do not call ffap-file-finder.
* test/lisp/ffap-tests.el (ffap-ido-mode): Test it.
Miha Rihtaršič [Wed, 4 Aug 2021 07:15:25 +0000 (09:15 +0200)]
Use `abort-minibuffers' in delsel
* lisp/delsel.el (minibuffer-keyboard-quit): Use
`abort-minibuffers' (bug#49821).
Previously, C-g was bound to abort-recursive-edit, now it is bound to
abort-minibuffers. However, after requiring delsel, it gets bound to
minibuffer-keyboard-quit, which still uses abort-recursive-edit. Use
the new function instead.
* lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Evaluate
forms that are eql specializers. Provide backward compatibility
with a warning.
* test/lisp/emacs-lisp/cl-generic-tests.el: Add a test.
* lisp/emacs-lisp/bindat.el (bindat--type): Adhere to the new rule.
* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Adhere to the new rule.
* lisp/emacs-lisp/map.el (map-into): Adhere to the new rule.
* lisp/emacs-lisp/radix-tree.el (map-into): Adhere to the new rule.
* lisp/frame.el (cl-generic-define-context-rewriter): Adhere to the new rule.
* lisp/gnus/gnus-search.el
(gnus-search-transform-expression): Adhere to the new rule.
* lisp/image/image-converter.el
(image-converter--probe image-converter--convert): Adhere to the new rule.
* lisp/mail/smtpmail.el (smtpmail-try-auth-method): Adhere to the new rule.
* lisp/progmodes/elisp-mode.el
(xref-backend-definitions)
(xref-backend-apropos): Adhere to the new rule.
* lisp/progmodes/etags.el (xref-backend-identifier-at-point)
(xref-backend-identifier-completion-table)
(xref-backend-identifier-completion-ignore-case)
(xref-backend-definitions)(xref-backend-apropos): Adhere to the new rule.
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-cl-defmethod-with-types-ok)
(checkdoc-cl-defmethod-qualified-ok)
(checkdoc-cl-defmethod-with-extra-qualifier-ok): Adhere to the new rule.
Michael Albinus [Tue, 3 Aug 2021 20:08:18 +0000 (22:08 +0200)]
Code cleanup for Tramp's yubikey integration
* lisp/net/tramp-sh.el (tramp-actions-before-shell)
(tramp-actions-copy-out-of-band):
Use `tramp-security-key-confirm-regexp'.
* lisp/net/tramp.el (tramp-security-key-confirm-regexp): Rename from
`tramp-yubikey-regexp'. Adapt docstring.
(tramp-security-key-confirmed-regexp): New defcustom.
(tramp-action-show-and-confirm-message):
Redisplay. Use `tramp-security-key-confirmed-regexp'.
Phil Sainty [Sat, 16 Jan 2021 12:25:13 +0000 (01:25 +1300)]
Make `global-so-long-mode' use `buffer-line-statistics'
* lisp/so-long.el: (so-long-statistics-excessive-p): New predicate
function using `buffer-line-statistics'.
(so-long-predicate): Use `so-long-statistics-excessive-p' by default.
* etc/NEWS: Describe changes.
* test/lisp/so-long-tests/so-long-tests-helpers.el:
* test/lisp/so-long-tests/so-long-tests.el: Update tests.
Also improve the existing `so-long-tests-predicate' tests.
A more general solution to bug#45084 has been implemented via
new user options `so-long-mode-preserved-variables' and
`so-long-mode-preserved-minor-modes'.
See the previous commit (before this revert) for details.
Phil Sainty [Sun, 10 Jan 2021 02:02:58 +0000 (15:02 +1300)]
Support 'preserved' variables and minor modes in `so-long-mode'
The default values support preserving the state of `view-mode' when
switching to (and reverting from) `so-long-mode' (bug#45084).
* lisp/so-long.el (so-long-mode-preserved-variables)
(so-long-mode-preserved-minor-modes): New user options.
(so-long-mode-maintain-preserved-variables)
(so-long-mode-maintain-preserved-minor-modes): New functions.
(so-long-remember-all, so-long-after-change-major-mode)
(so-long-mode-revert): Use them.
Phil Sainty [Sat, 20 Mar 2021 08:48:18 +0000 (21:48 +1300)]
; so-long-tests.el: Suppress expected warnings
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-invisible-buffer-function): Suppress warning about
obsolete function `run-window-configuration-change-hook', as we are
using it intentionally (see the preceding code comments and URL for
details).
Phil Sainty [Sun, 10 Jan 2021 02:20:51 +0000 (15:20 +1300)]
; * lisp/so-long.el: Minor bug fixes
(so-long-disable-minor-modes): Don't call the mode function to disable
the mode unless it was actually enabled.
(so-long-restore-minor-modes, so-long-restore-variables): Use the
remembered list values, which might be different to the defaults.
Also comments, and spelling consistency changes for the so-long tests
(a fixup for commit 83bc4ad369 which had only addressed so-long.el,
and not the test files).
This doesn't affect buffers which are simply in `fundamental-mode' by
default. It only affects buffers for which `set-auto-mode' has been
called (normally via `find-file') without establishing a different
major mode.
Phil Sainty [Sun, 10 Jan 2021 01:29:32 +0000 (14:29 +1300)]
Increase `so-long-threshold' and `so-long-max-lines' defaults
* lisp/so-long.el (so-long-threshold, so-long-max-lines): Increase
default values to reduce false-positives.
* etc/NEWS: Describe changes.
Lines shorter than 10,000 characters shouldn't generally be causing
problems, so testing this explicitly will largely eliminate
false-positives. We must also increase the maximum number of lines
to check, because 'minified' code may still include newlines, and so
there may be many lines shorter than the new threshold before we find
a line which exceeds it.
Previously we used a minimum-effort heuristic, testing a very small
number of lines against a maximum length which, while not remotely
long enough to cause problems, would nevertheless be uncommon in any
normal file of programming code (and hence indicative that the file
was likely to be minified code).
Testing indicates that the performance penalty for the larger values
should be negligible.
* Fix error while disassembling native code on macOS
* lisp/emacs-lisp/disass.el (disassemble-internal): Make sure the
regexp that searches for a symbol takes into account of llvm-objdump's
output format.
* lisp/erc/erc-ibuffer.el (erc-modified): Don't use `length' on dotted
lists (and not even to test if there is more than one element, for
that matter). Use `cdr' instead.
Stephen Gildea [Mon, 2 Aug 2021 04:00:37 +0000 (21:00 -0700)]
mh-junk: adjust messages for allow/block actions
* lisp/mh-e/mh-junk.el: Remove messages that get overwritten quickly.
Keep messages that give status for slow operations. Add information
that might be useful for debugging failures.
Stefan Monnier [Sun, 1 Aug 2021 22:13:41 +0000 (18:13 -0400)]
* lisp/mwheel.el: Don't use `custom-initialize-delay`.
Set up the keybindings when loading the file.
(mouse-wheel--installed-bindings-alist): Move to beginning.
(mouse-wheel-change-button): Don't update bindings when they're not installed.
(mouse-wheel--setup-bindings): New function extracted from `mouse-wheel-mode`.
(<topleve>): Call it when loading the file.
(mouse-wheel-mode): Use the default :initializer.
Change `dlet` so that it has binding semantics like `let` because that
is what a user would expect and it allows a corresponding `dlet*` to
be added later should the need arise. Fortunately the change has no
effect where it is currently used.
* lisp/subr.el (dlet): Work like let.
* lisp/calendar/cal-bahai.el (calendar-bahai-date-string):
* lisp/calendar/cal-coptic.el (calendar-coptic-date-string):
* lisp/calendar/cal-dst.el (calendar-time-zone-daylight-rules)
(calendar-dst-starts, dst-in-effect):
* lisp/calendar/cal-persia.el (calendar-persian-date-string):
* lisp/calendar/calendar.el (calendar-dlet, calendar-generate-month)
(calendar-update-mode-line, calendar-date-string):
* lisp/calendar/diary-lib.el (diary-list-entries-2)
(diary-list-entries, diary-mark-entries-1, diary-sexp-entry)
(diary-remind, diary-font-lock-date-forms, diary-fancy-date-pattern):
* lisp/calendar/holidays.el (holiday-sexp):
* lisp/calendar/icalendar.el (icalendar--convert-float-to-ical):
* lisp/calendar/solar.el (solar-time-string):
* lisp/calendar/todo-mode.el (todo-date-pattern)
(todo-edit-item--header, todo-convert-legacy-date-time)
(todo-read-date):
Rename `calendar-dlet*` to `calendar-dlet` since it uses `dlet`.
Juri Linkov [Sun, 1 Aug 2021 08:38:51 +0000 (11:38 +0300)]
* lisp/filecache.el: Fix cycling (bug#49761).
(file-cache-cycle): Refactor from file-cache-minibuffer-complete.
(file-cache-minibuffer-complete): Use file-cache-cycle in 2 old places,
and in 1 following new place. When last-command is equal to this-command,
use file-cache-cycle to continue cycling the previous completion
as long as the user continues typing C-TAB.
Also when displaying a list of completions, don't try to move point
to the common prefix.
When an occur-mode regexp matches across multiple lines, the spacing
prefixes inserted between each did not have the `occur-target`
property which is essential for jumping to the corresponding place in
the target buffer. This prevented next-error and previous-error
from working.
* lisp/replace.el (occur-engine): Put the `occur-target` property on
the continuation prefix to avoid the gap.
* lisp/help-mode.el (help-mode-map): Remove key bindings for RET
and <mouse-2> (bug#49784).
(help-xref-stack, help-xref-forward-stack, help-xref-stack-item)
(help-make-xrefs): Fix doc strings -- these aren't used by
`help-follow', but by `help-follow-symbol'.
(help-follow-mouse, help-follow): Make obsolete.
Alan Third [Wed, 23 Jun 2021 15:07:12 +0000 (16:07 +0100)]
Fix some macOS problems
* src/nsmenu.m (update_frame_tool_bar): Make sure the toolbar isn't
displayed when it's not supposed to be.
* src/nsterm.m ([EmacsView layoutSublayersOfLayer:]): Reinstate code
intended to prevent a crash when running redisplay.
Alan Third [Sat, 12 Jun 2021 18:04:02 +0000 (19:04 +0100)]
Move parent frame setting code into EmacsWindow
* src/nsterm.m (ns_make_frame_visible):
(ns_set_parent_frame):
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Use new method.
([EmacsWindow setParentChildRelationships]): New method.