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.
Alan Mackenzie [Mon, 31 May 2021 16:24:11 +0000 (16:24 +0000)]
Make frames record when their selected window was the mini-window
When a frame in this state is selected again by Fselect_frame (but not by
Fselect_window), the mini-window rather than the frame's currently selected
window, is chosen for selection, should there still be an active minibuffer in
it.
This fixes bug #48674.
* src/frame.h (struct frame): Add new boolean field select_mini_window_flag.
* src/frame.c (make_frame): Initialize select_mini_window_flag to false.
(do_switch_frame): Set the new flag appropriately for the old frame, and
process the new frame's setting of this flag, before setting it to false.
* src/window.c (select_window): Set f->select_mini_window_flag to false.
(Fset_frame_selected_window, Fdelete_other_windows_internal)
(Fdelete_window_internal): Add comments clarifying that there is no clearing
of f->select_mini_window_flag in these functions.
Alan Mackenzie [Mon, 31 May 2021 10:33:10 +0000 (10:33 +0000)]
Correct mouse handling when window origin changes between down and up events
Do this by using frame relative positions rather than window relative ones,
which gave rise to spurious drag events when the origin of the window changed
between the mouse down and up events. This fixes bug #48409.
* keyboard.c (frame_relative_event_pos): New static variable.
(make_lispy_event): Record frame relative position of down event. When the up
event is in the same position, "move" this event into the window of the down
event when this window (typically a mini-window) is no longer under the mouse.
Call make_lispy_position a second time to generate this changed event.
(syms_of_keyboard): Declare Qwindow_edges. static_pro
frame_relative_event_pos.
* lisp/emacs-lisp/elp.el (elp-results): Make `q' work in ELP
results buffer (bug#14104).
(elp-results-mode): Define as an empty special mode derivation.
Philipp Stephani [Sun, 30 May 2021 20:39:54 +0000 (22:39 +0200)]
Document that the 'syntax-propertize-function' may move point.
The functions generated by 'syntax-propertize-rules' don't use
'save-excursion', but 'syntax-propertize' does, so we might as well
document that the 'syntax-propertize-function' may move point.
* doc/lispref/syntax.texi (Syntax Properties): Document that the
'syntax-propertize-function' may move point.
Mauro Aranda [Sun, 30 May 2021 12:35:13 +0000 (09:35 -0300)]
Do not reset settings when disabling a theme
* lisp/custom.el (disable-theme): Don't call custom-push-theme, since
that resets the theme settings and it isn't useful: we only need to
remove the theme setting from the themed variable or face. This fixes
a regression when "toggling" themes, introduced while fixing Bug#34027.
(Bug#48736)
Eli Zaretskii [Sun, 30 May 2021 08:16:59 +0000 (11:16 +0300)]
Don't account for character compositions in 'format' and friends
'lisp_string_width' is called from 'format' and 'format-message',
which can be called both very early into Emacs initialization and in
other contexts where using the font backend is impossible or
undesirable. So this commit changes 'lisp_string_width' to try
accounting for automatic compositions only when explicitly requested,
and only 'string-width' does that; 'format' and 'format-message'
don't.
* src/character.c (lisp_string_width): Accept an additional
argument AUTO_COMP; attempt accounting for auto-compositions only
if that argument is non-zero. (Bug#48732)
* src/editfns.c (styled_format):
* src/character.c (Fstring_width): Callers of 'lisp_string_width'
adjusted.
* lisp/menu-bar.el (menu-bar-select-buffer): Move from
here... (bug#15651).
* lisp/msb.el (menu-bar-select-buffer): ... to here (which is the
only usage in-tree in Emacs).
Stephen Gildea [Sun, 30 May 2021 05:54:30 +0000 (22:54 -0700)]
time-stamp: improve unit-test coverage
* test/lisp/time-stamp-tests.el (time-stamp-format-year-4digit,
time-stamp-format-ignored-modifiers): Improve coverage with more cases.
(time-stamp-format-multiple-conversions): New test.
Daniel Martín [Sun, 30 May 2021 04:41:24 +0000 (06:41 +0200)]
Improve the documentation of documentation groups
* doc/lispref/help.texi (Documentation Groups): Fix typos and add an
example.
* lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): Add
:no-eval* and :result-string keywords to the docstring. (Bug#48730)
Eli Zaretskii [Sat, 29 May 2021 08:17:53 +0000 (11:17 +0300)]
Fix last change
* lisp/international/quail.el (quail-add-unread-command-events):
Fix wording of the doc string. Move the rationale for the
function out of the doc string and into a comment.