Eli Zaretskii [Thu, 10 Jun 2021 13:55:04 +0000 (16:55 +0300)]
Support mercury in 'ctags' as well
The previous lack of support was due to incorrect calls to 'make_tag'
in 'mercury_pr', which caused 'pfnote' to refrain from adding Mercury
tags to the list of recorded tags.
* lib-src/etags.c (mercury_pr): Pass the correct NAME and NAMELEN
arguments to 'make_tag'.
* test/manual/etags/CTAGS.good: Adjust to the above change.
Eli Zaretskii [Thu, 10 Jun 2021 12:06:10 +0000 (15:06 +0300)]
Improve documentation of 'M-y'
* doc/emacs/killing.texi (Yanking): Mention that TTY frames can
also support yanking from the clipboard.
(Earlier Kills): Finalize the documentation of the new behavior
of the lone 'M-y'. (Bug#48478)
Martin Rudalics [Thu, 10 Jun 2021 07:14:21 +0000 (09:14 +0200)]
Provide new option `delete-window-set-selected' (Bug#47300)
When `delete-window' deletes its frame's selected window, this new
option allows to choose another window as replacement.
* lisp/window.el (get-lru-window, get-mru-window)
(get-largest-window): New optional argument NO-OTHER.
(window-at-pos): New function.
(delete-window-set-selected): New option.
(delete-window): Handle `delete-window-set-selected'.
* src/window.c (Fdelete_window_internal): Set the selected
window of WINDOW's frame to the first window on that frame and
let `delete-window' choose a more suitable window instead.
* doc/lispref/windows.texi (Deleting Windows): Describe new
option `delete-window-set-selected'.
(Cyclic Window Ordering): Describe new NO-OTHER argument for
`get-lru-window', `get-mru-window' and `get-largest-window'.
* etc/NEWS: Mention `delete-window-set-selected' and the NO-OTHER
argument.
Alan Third [Tue, 8 Jun 2021 19:08:34 +0000 (20:08 +0100)]
Fix image filename encoding issues (bug#48902)
* src/image.c (image_find_image_fd): Don't return an encoded filename
string.
* src/nsfns.m: ([NSString stringWithLispString:]): Clarify usage
comment.
* src/nsimage.m ([EmacsImage allocInitFromFile:]): No need to encode
the filename when converting to NSString.
Harald Jörg [Tue, 8 Jun 2021 21:23:25 +0000 (23:23 +0200)]
; perl-mode.el: Detect regexes immediately after "|&"
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Add "|&" to the list of characters after which a slash starts a
regular expression (Bug#23992).
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-ppss):
Correct the docstring.
(cperl-test-bug-23992): New test for Bug#23992.
(cperl-test-bug-42168): Adapt inline comments to the current code.
* test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl:
Resource file with example code from the bug report.
Juri Linkov [Tue, 8 Jun 2021 16:51:51 +0000 (19:51 +0300)]
Sync overlay code in minibuffer-message and set-minibuffer-message (bug#48669)
* lisp/minibuffer.el (minibuffer-message): Copy more overlay positioning code
from set-minibuffer-message.
(minibuffer--message-overlay-pos): Mention both minibuffer-message and
set-minibuffer-message in the docstring.
(set-minibuffer-message): Use 'cursor t' instead of 1.
Stephen Gildea [Tue, 8 Jun 2021 04:47:24 +0000 (21:47 -0700)]
MH-E: do not look for MH variants in relative directories
* lisp/mh-e/mh-e.el (mh-variants): Do not examine relative directories
in exec-path (e.g., "."); these won't have MH installed. Also,
file-chase-links is not robust with relative names: you cannot pass it
a relative name that is a symlink.
* test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-relative-to-project-root):
Make tests more strict again.
Eli Zaretskii [Sun, 6 Jun 2021 12:29:18 +0000 (15:29 +0300)]
Fix a problem with restarting 'tags-search'
* lisp/progmodes/etags.el (tags-search, tags-query-replace): Link
to 'fileloop-continue' instead of 'tags-loop-continue', for
continuing TAGS-based search/replace commands.
* lisp/fileloop.el (fileloop-continue): Reset
'switch-to-buffer-preserve-window-point' to nil when switching to
another buffer, so as to make sure a new search always restarts
from point-min in each buffer it searches. (Bug#48628)
Fabrice Nicol [Tue, 1 Jun 2021 02:15:59 +0000 (04:15 +0200)]
Add support for Mercury (https://mercurylang.org) in 'etags'
Tag declarations starting lines with ':-'.
By default, all declarations are tagged. Optionally, first
predicate or functions in clauses can be tagged as in Prolog
support using '--declarations'. (Bug#47408).
* lib-src/etags.c (test_objc_is_mercury, Mercury_functions)
(mercury_skip_comment, mercury_decl, mercury_pr):
Implement Mercury support. As Mercury and Objective-C have
the same file extension .m, a heuristic test tries to detect
the language.
* doc/man/etags.1: Document the change. Add Mercury-specific
behavior for '--declarations'. This option tags first
predicates or functions in clauses in addition to declarations.
Paul W. Rankin [Sat, 8 May 2021 09:09:59 +0000 (19:09 +1000)]
src/nsterm.m: fix window tabbing on macOS
* src/nsterm.m: remove NSWindowTabbingModeDisallowed to respect
system-wide preferences
* etc/NEWS: add mention of native tab support in macOS and where
to specify system-wide setting
Alex Bochannek [Sat, 5 Jun 2021 20:29:09 +0000 (22:29 +0200)]
Fix Gnus summary exclusion when everything matches
* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-recipient):
* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-subject):
(gnus-summary-limit-to-address, gnus-summary-limit-to-extra):
Don't claim that there aren't any matches when everything matches
an exclusion (bug#48834).
for the details.
* src/keyboard.c (read_decoded_event_from_main_queue): For
raw-text encoed input, if Meta bit is encoded, apply the Meta
modifier to single-byte characters that have the 0x80 bit set.
For input encoded otherwise, if the Meta bit is encoded, remove
the 0x80 bit after decoding the characters.
(tty_read_avail_input): Reset the 0x80 bit only if Meta bit is not
encoded.
(Fset_input_meta_mode): Support 'encoded' as the value of META.
(Fset_input_mode): Document 'encoded' for META.
(Fcurrent_input_mode): Support and document 'encoded' as the value
of META.
(syms_of_keyboard): DEFSYM 'encoded'.
Eli Zaretskii [Sat, 5 Jun 2021 11:16:06 +0000 (14:16 +0300)]
Fix slow operation of 'string-width'
* src/composite.c (find_automatic_composition): Accept one
additional argument BACKLIM; don't look back in buffer or string
farther than that. Add an assertion for BACKLIM.
(composition_adjust_point, Ffind_composition_internal): Callers
adjusted.
* src/composite.h (find_automatic_composition): Adjust prototype.
* src/character.c (lisp_string_width): Call
'find_automatic_composition' with the value of BACKLIM equal to POS,
to avoid costly and unnecessary search back in the string, since
those previous characters were already checked for automatic
compositions. (Bug#48734) (Bug#48839)
Dmitry Gutov [Sat, 5 Jun 2021 00:56:33 +0000 (03:56 +0300)]
Make icomplete less blinky and more responsive
* lisp/icomplete.el (icomplete-pre-command-hook, icomplete-tidy):
Remove, update the callers
(https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00111.html).
(icomplete-compute-delay): Change the default to 150ms.
(icomplete-max-delay-chars): Change the default to 2.
Tassilo Horn [Fri, 4 Jun 2021 19:58:11 +0000 (21:58 +0200)]
Ask if dir and subdir dired buffers be killed when deleting dir
Previously, when you've had dired buffers
~/foo/
~/foo/bar/
~/foo/bar/baz/
and then deleted ~/foo/, dired (with dired-clean-up-buffers-too set to
non-nil) would only ask to delete the dired buffer of ~/foo/. Now it
will offer to delete all three buffers.
* lisp/dired.el (dired-buffers-for-dir): Add optional argument SUBDIRS
which makes the function return also dired buffers showing a subdir of
DIR.
(dired-in-this-tree-p): Make obsolete in favor of file-in-directory-p
which actually does what the name suggest whereas dired-in-this-tree-p
is just string-matching on filenames which will fail with symlinks
filenames including ./ or ../.
Stephen Berman [Fri, 4 Jun 2021 10:01:41 +0000 (12:01 +0200)]
Fix placement of point in Dired deletion operations
* lisp/dired.el (dired-do-flagged-delete, dired-do-delete): Use
point-marker instead of point to record each file name position.
Clean up the markers before returning.
(dired-internal-do-deletions): Move to the file name marker, and
then move point to the file name to visually emphasize which file
is being operated on (bug#48805).
* windmove.el (windmove-mode-map): Add special map for windmove commands.
(windmove-mode): Add minor mode for activating windmove-mode-map.
(windmove-install-defaults): Add general function for manipulating
windmove-mode-map.
(windmove-default-keybindings): Use windmove-install-defaults.
(windmove-display-default-keybindings): Use windmove-install-defaults.
(windmove-delete-default-keybindings): Use windmove-install-defaults.
(windmove-swap-states-default-keybindings): Use windmove-install-defaults.
Eli Zaretskii [Thu, 3 Jun 2021 14:45:12 +0000 (17:45 +0300)]
Fix fill-column-indicator on TTY frames
* src/xdisp.c (extend_face_to_end_of_line): Fix calculation of
fill-column-indicator on TTY frames. Suggested by Jimmy Aguilar
Mena <spacibba@aol.com>.
Luke Lee [Thu, 3 Jun 2021 08:04:16 +0000 (16:04 +0800)]
* lisp/progmodes/hideif.el: Fix initial version for new variables
(hide-ifdef-verbose, hide-ifdef-evalulate-enter-hook)
(hide-ifdef-evalulate-leave-hook): Fix initial version to 28.1.
(hide-ifdef-expand-reinclusion-protection): Obsolete since 28.1,
rename to `hide-ifdef-expand-reinclusion-guard' instead.
Tassilo Horn [Wed, 2 Jun 2021 21:02:45 +0000 (23:02 +0200)]
Allow opening buttonized URL with secondary browser in rcirc
* lisp/net/browse-url.el (browse-url-button-open-url): Add autoload
cookie.
* lisp/net/rcirc.el (rcirc-markup-urls): Use
`browse-url-button-open-url' instead of just `browse-url' in order to
be able to use the secondary browser by giving a prefix arg.
Luke Lee [Wed, 2 Jun 2021 12:29:00 +0000 (20:29 +0800)]
* lisp/progmodes/hideif.el: update for new C++ standards and extensions
Matching gcc/clang behavior on stringification including keeping the same
number of white spaces. C++11, C++14, C++17 and GCC literals extension are
supported. Preprocessing time floating point operation supported but limited
to Emacs internal representation which is C data type "double". Also support
some frequently used keywords like __LINE__, __TIME__, __DATE__ and so on.
(hif-clear-all-ifdef-defined, hif-show-all, hif-after-revert-function)
(hide-ifdef-define, hide-ifdefs, show-ifdefs): interactive behavior changes,
mainly to allow operation within the marked region.
(hif-eval, hif-__LINE__, hif-__FILE__, hif-__COUNTER__, hif-__cplusplus)
(hif-__DATE__, hif-__TIME__, hif-__STDC__, hif-__STDC_VERSION__)
(hif-__STDC_HOST__, hif-__FILE__, hif-full-match, hif-is-number, hif-is-float)
(hif-delete-char-in-string, hif-string-to-decfloat, hif-string-to-hexfloat)
(hif-strtok, hif-is-white, hif-backward-comment, hif-split-signed-token)
(hif-keep-single, hif-display-macro): new functions.
(hide-ifdef-verbose, hide-ifdef-evalulate-enter-hook)
(hide-ifdef-evalulate-leave-hook, hide-ifdef-evaluator, hif-predefine-alist)
(hif-numtype-suffix-regexp, hif-bin-regexp, hif-hex-regexp, hif-oct-regexp)
(hif-dec-regexp, hif-decfloat-regexp, hif-hexfloat-regexp)
(hif-unicode-prefix-regexp, hif-verbose-define-count): new constants or
variables.
(hif-macroref-regexp, hif-token-alist, hif-token-regexp)
(hif-string-literal-regexp): modified constants for faster regexp processing.
(hide-ifdef-expand-reinclusion-guard): renamed from
`hide-ifdef-expand-reinclusion-protection' to match commonly used term.
(hif-lookup, hif-defined, hif-string-to-number, hif-tokenize, hif-nextoken)
(hif-if-valid-identifier-p, hif-define-operator, hif-expand-token-list)
(hif-parse-exp, hif-math, hif-factor, hif-get-argument-list, hif-stringify)
(hif-token-concat, hif-mathify, hif-comma, hif-token-stringification)
(hif-token-concatenation, hif-macro-supply-arguments, hif-evaluate-macro)
(hif-find-define, hif-add-new-defines, hide-ifdef-guts, hif-undefine-symbol)
(hide-ifdef-set-define-alist, hide-ifdef-use-define-alist): modified functions
for new internal data representation, mainly for stringification and white
space preservation. Also better error handling to report source line number
and more informative error messages.
Alex Bochannek [Wed, 2 Jun 2021 05:41:25 +0000 (07:41 +0200)]
Add new user option to Gnus to allow `#' to toggle
* doc/misc/gnus.texi (Marking Groups, Setting Process Marks):
Mention the new variable.
* lisp/gnus/gnus-group.el (gnus-group-make-menu-bar): Update menu.
(gnus-group-mark-group): Support the variable.
(gnus-group-mark-update): New command.
(gnus-group-unmark-group, gnus-group-mark-region): Pass in new
parameter.
* lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Update menu.
(gnus-summary-mark-as-processable): Use the variable.
Alan Third [Fri, 21 May 2021 12:33:56 +0000 (13:33 +0100)]
Improve performance of NS port's display on macOS
* src/nsterm.h: Update EmacsSurface definition.
* src/nsterm.m ([EmacsView focusOnDrawingBuffer]): Don't change the
CGContext's settings directly.
([EmacsView unfocusDrawingBuffer]): Don't release the context here.
(CACHE_MAX_SIZE): Add maximum cache size.
([EmacsView updateLayer]): Send a request for getContext, which will
copy the buffer and create the context if it doesn't already exist, to
the NS run loop.
([EmacsSurface initWithSize:ColorSpace:Scale:]): Add the scale factor
and if there's already a CGContext available, reuse it.
([EmacsSurface dealloc]): No longer need to release lastSurface
separately.
([EmacsSurface getContext]): Don't create more surfaces than we have
spaces for in the cache.
([EmacsSurface releaseContext]): If there's no context don't try to
release it and put currentSurface back on the cache instead of
lastSurface.
([EmacsSurface copyContentsTo:]): Don't try to copy if the source and
destination are actually the same surface.
João Távora [Tue, 25 May 2021 21:40:40 +0000 (22:40 +0100)]
Add annotation capability to icomplete-vertical-mode
Co-authored-by Daniel Mendler <mail@daniel-mendler.de>
* lisp/icomplete.el (icomplete--affixate): New helper.
(icomplete--render-vertical): Use it. Rework.
(icomplete-completions): Pass md to icomplete--render-vertical.
João Távora [Sun, 30 May 2021 15:26:02 +0000 (16:26 +0100)]
Improve icomplete-vertical-mode and fido-vertical-mode
This mode is intended to be used with Icomplete ('M-x icomplete-mode')
or Fido ('M-x fido-mode'), to display the list of completions
candidates vertically instead of horizontally. When used with
Icomplete, completions are rotated and selection kept at the top.
When used with Fido, completions scroll like a typical dropdown
widget.
If the dropdown behaviour is desired for Icomplete (instead of
rotation), icomplete-scroll can be adjusted separately by the user.
* etc/NEWS (icomplete-vertical-mode): Reword.
* lisp/icomplete.el (simple): Require it.
(icomplete-selected-match): New face.
(icomplete-scroll): New user-visible var.
(icomplete-forward-completions): Rework.
(icomplete-backward-completions): Rework.
(icomplete--fido-mode-setup): Prefer icomplete-scroll according to
icomplete-vertical mode.
(icomplete-minibuffer-setup): Initialize icomplete--scrolled-completions.
(fido-vertical-mode): An alias for icomplete-vertical-mode.
(icomplete-exhibit): Init icomplete--scrolled-past. Adjust overlay.
(icomplete--render-vertical): New helper.
(icomplete--sorted-completions): If cache is stale, also
invalidate icomplete--scrolled-past.
(icomplete-completions): Rework. Mostly reformat.
* lisp/simple.el (max-mini-window-lines): New helper.
(display-message-or-buffer): Use it.
* epa-ks.el (epa-keyserver): Interpret a list as a pool.
(epa-ks--query-url): Add new auxiliary function.
(epa-ks--fetch-key): Use epa-ks--query-url.
(epa-search-keys): Use epa-ks--query-url.