Juri Linkov [Wed, 15 Sep 2021 06:27:57 +0000 (09:27 +0300)]
* lisp/tab-bar.el: Rename args to consistent naming convention.
Use the same naming scheme for function arguments. Use the term "index" when
arguments count from 0, and the term "number" when arguments count from 1.
* lisp/tab-bar.el (tab-bar-select-tab): Rename ‘arg’ to ‘tab-number’.
(tab-bar-move-tab-to): Rename ‘from-index’ to ‘from-number’
and ‘to-index’ to ‘to-number’.
(tab-bar-move-tab-to-frame): Rename ‘from-index’ to ‘from-number’
and ‘to-index’ to ‘to-number’.
(tab-bar-new-tab-to): Rename ‘to-index’ to ‘tab-number’.
(tab-bar-close-tab): Rename ‘arg’ to ‘tab-number’
and ‘to-index’ to ‘to-number’.
(tab-bar-rename-tab): Rename ‘arg’ to ‘tab-number’.
(tab-bar-change-tab-group): Rename ‘arg’ to ‘tab-number’.
To be able to filter results coming from
elisp-xref-find-def-functions, and for general ease of
understanding.
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
Undo the previous change.
(xref-backend-apropos): Update accordingly.
(elisp--xref-filter-definitions): New function.
(xref-backend-definitions): Use it to post-filter the results
coming from elisp--xref-find-definitions.
* test/lisp/progmodes/elisp-mode-tests.el (find-defs-minor-defvar-c):
New test.
(find-defs-defun-defvar-el): Update test.
Wilson Snyder [Wed, 15 Sep 2021 01:21:03 +0000 (21:21 -0400)]
verilog-mode.el: Update verilog-mode from upstream.
* lisp/progmodes/verilog-mode.el: (verilog-basic-complete-re)
(verilog-behavioral-block-beg-re, verilog-defun-keywords)
(verilog-defun-level-generate-only-re, verilog-defun-level-re)
(verilog-endcomment-reason-re, verilog-indent-re) (verilog-keywords,
verilog-no-indent-begin-re) (verilog-set-auto-endcomments): Support
Verilog-A `analog` blocks (#1738). Reported by Dan McMahill.
(verilog-read-defines): Fix verilog-read-defines to work
with SystemVerilog types (#1734). Reported by Shareef Jalloq.
(verilog-indent-declaration,
verilog-pretty-declarations): Fix leaving extra spaces before tabs on
lining up declarations. (#1723) Reported by TAKAI Kousuke.
(verilog-auto-inst, verilog-auto-inst-port)
(verilog-read-auto-template-middle, verilog-read-sub-decls-line):
Support AUTONOHOOKUP to not AUTOWIRE hookup AUTO_TEMPLATE signals. (#1526)
Reported by firefoxtc.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-special-variables): New test for $^T
and $^{VARNAME}.
(cperl-test-ws-rx cperl-test-ws+-rx),
(cperl-test-version-regexp, cperl-test-package-regexp): Skip
for perl-mode.
(cperl-test-identifier-rx, cperl--test-unicode-setup)
(cperl-test-unicode-labels, cperl-test-unicode-sub)
(cperl-test-unicode-varname)
(cperl-test-unicode-varname-list, cperl-test-unicode-arrays)
(cperl-test-unicode-hashes, cperl-test-unicode-hashref)
(cperl-test-unicode-proto, cperl-test-unicode-fhs)
(cperl-test-unicode-hashkeys, cperl-test-word-at-point):
New tests for unicode identifiers.
(cperl-test-imenu-index): Add a unicode identifier to the test.
* test/lisp/progmodes/cperl-mode-resources/grammar.pl: Add a
function with non-ASCII name for imenu tests.
Eli Zaretskii [Tue, 14 Sep 2021 13:47:40 +0000 (16:47 +0300)]
Fix recent changes in Flymake manual
* doc/misc/flymake.texi: Fix typos. Downcase the first word of
each index entry, for more reliable sorting.
(Starting Flymake, Finding diagnostics, Troubleshooting): Fix
typos.
* lisp/emacs-lisp/find-func.el (find-function-source-path): Made
into obsolete alias (bug#50508).
(find-library-source-path): New name.
(find-library-name, find-library, find-function-noselect)
(find-variable-noselect, find-definition-noselect): Adjust usage
and update doc strings.
João Távora [Sun, 12 Sep 2021 21:16:35 +0000 (22:16 +0100)]
Re-organize and rewrite parts of the Flymake manual
bug#50244
* doc/misc/flymake.texi (Starting Flymake): New section.
(Finding diagnostics): New section, now contains info previously in
"Listing diagnostics"
(Mode line status): Renamed from "Mode-line syntax check status"
(Troubleshooting): Renamed from "Backend exceptions".
(Flymake error types): Tweak phrasing.
João Távora [Wed, 1 Sep 2021 22:45:53 +0000 (23:45 +0100)]
Add support for project-wide diagnostics in Flymake (bug#50244)
This is done with two new concepts: "foreign diagnostics" and
"list-only diagnostics". The manual has been updated with a
description of these new concepts.
* doc/misc/flymake.texi (Flymake utility functions):
Explain creation of foreign diagnostics.
(Foreign and list-only diagnostics): New subsection.
(Listing diagnostics): New subsection.
* lisp/progmodes/flymake.el
(Version): Bump to 1.2.1
(project): Require project.
(flymake--diag): Add new slots 'orig-beg' and 'orig-end'. Rename
'buffer' slot to 'locus'.
(flymake-make-diagnostic): Rework docstring. Accept stringp
LOCUS arg.
(flymake-diagnostic-beg, flymake-diagnostic-end)
(flymake-diagnostic-buffer): Simplify definition.
(flymake--equal-diagnostic-p): New helper
(flymake--highlight-line): Rework. Accept FOREIGN arg.
(flymake--state): Work docstring. Add new slot 'foreign-diags'
(flymake--handle-report): Call
flymake--update-diagnostics-listings.
(flymake--handle-report): New helper.
(flymake--mode): Forward declare.
(flymake--handle-report): Rework for foreign diagnostics.
(flymake-mode): When turning on, notice any Flymake diagnostics
for current buffer. When turning off update diagnostics listings.
(flymake-kill-buffer-hook): Turn off flymake explicitly before
killing.
(flymake--mode-line-counter): Use flymake-diagnostics to collect
diagnostics.
(flymake-show-diagnostic): Visit buffer of file-specific
diagnostic.
(flymake--tabulated-entries-1): New helper extracted from
flymake--diagnostic-buffer-entries.
(flymake--diagnostics-buffer-entries): Rework.
(flymake--diagnostics-base-tabulated-list-format): New helper.
(flymake--diagnostics-buffer-name): Adjust.
(flymake-list-only-diagnostics): New variable.
(flymake--project-diagnostic-list-project): New variable.
(flymake--clear-list-only-diagnostics): New helper.
(flymake-project-diagnostics-mode): New major mode.
(flymake--project-diagnostics)
(flymake--project-diagnostics-entries)
(flymake--project-diagnostics-buffer): New helpers.
(flymake-show-project-diagnostics): New command.
(flymake--update-diagnostics-listings): New helper.
(flymake-show-buffer-diagnostics): Renamed from flymake-diagnostics-buffer.
João Távora [Mon, 30 Aug 2021 15:24:25 +0000 (16:24 +0100)]
Keep and report "foreign" diangnostics in flymake-cc Flymake backend
This includes diagnostics for .h files that sprang up when checking a
c file. Those diagnostics are reported to the Flymake infrastructure
which does not (yet) do anything with them.
João Távora [Sun, 29 Aug 2021 21:35:46 +0000 (22:35 +0100)]
Rename flymake--backend-state to flymake--state
The previous name was confusing and akward and dreadful to type and
read.
* lisp/progmodes/flymake.el (flymake--state): Rename from
flymake--backend-state.
(flymake--with-backend-state): Use flymake--state.
(flymake--handle-report): Use flymake--state.
(flymake--collect): Use flymake--state.
(flymake-running-backends): Use flymake--state.
(flymake--disable-backend): Use flymake--state.
(flymake--run-backend): Use flymake--state.
(flymake-start): Use flymake--state.
(flymake-mode): Use flymake--state.
(flymake--mode-line-title): Use flymake--state.
(flymake--mode-line-exception): Use flymake--state.
(flymake--mode-line-counter): Use flymake--state.
Alan Third [Mon, 13 Sep 2021 19:09:22 +0000 (20:09 +0100)]
Fix incorrectly appearing toolbar on NS (bug#50534)
* src/nsmenu.m (update_frame_tool_bar): Ensure both sides of the test
are booleans.
* src/nsterm.m ([EmacsWindow createToolbar:]): Make the toolbar
non-visible initially, in case things get out of sync. Remove call to
update_frame_tool_bar: the window isn't yet associated with the view,
so it will return immediately.
Juri Linkov [Tue, 14 Sep 2021 06:42:11 +0000 (09:42 +0300)]
* lisp/tab-bar.el: Close tab only on mouse-1, not down-mouse-1 (bug#41343)
* lisp/tab-bar.el (tab-bar-mouse-select-tab): Don't close the tab
when clicked on the close button.
(tab-bar-mouse-close-tab-from-button): New function.
(tab-bar-map): Bind [mouse-1] to 'tab-bar-mouse-close-tab-from-button'.
(tab-bar-mouse-move-tab): Do nothing on non-tab events.
Stefan Kangas [Mon, 13 Sep 2021 19:57:13 +0000 (21:57 +0200)]
Add user option to avoid checkdoc warning for unescaped left paren
* lisp/emacs-lisp/checkdoc.el
(checkdoc-column-zero-backslash-before-paren): New user option to
avoid warning on unescaped left parenthesis in column zero.
(checkdoc-this-string-valid-engine): Respect above new option.
Stefan Kangas [Mon, 13 Sep 2021 05:17:50 +0000 (07:17 +0200)]
Minor improvements to checkdoc
* lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Add ignored
values.
(checkdoc-proper-noun-list): Remove XEmacs from list of words to
capitalize; there is little need to insist on consistency here.
(checkdoc-in-abbreviation-p): Add abbreviation "etc." and sort entries
alphabetically.
* lisp/isearch.el: Add recenter to 'isearch-motion' property of
'end-of-buffer' to maximize the number of search hits on the screen.
In 'isearch-motion' property of 'scroll-up-command' use 'recenter 0'
for the first line of the screen.
(isearch-beginning-of-buffer)
(isearch-end-of-buffer): Sync logic from 'isearch-allow-motion' part
of isearch-pre-command-hook. Direct users to isearch-allow-motion
in the docstrings.
(isearch-pre-command-hook): Don't override shifted 'isearch-yank-on-move'
in 'isearch-allow-motion'.
* test/lisp/progmodes/xref-tests.el
(xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-nondirectory)
(xref--xref-file-name-display-is-relative-to-project-root):
Update for the latest change in xref.el.
Use a fringe mark in bookmark instead of a whole background line
* lisp/bookmark.el (bookmark-face): Adjust colors.
(bookmark-fringe-mark): New bitmap.
(bookmark--fontify): Use a fringe instead of marking the whole line.
(bookmark--unfontify): Adjust to remove.
(bookmark--jump-via): Ditto.
(bookmark-set-fringe-mark): Renamed from bookmark-fontify.
(bookmark--set-fringe-mark, bookmark--remove-fringe-mark): Renamed
from --*fontify. Callers adjusted.
Juri Linkov [Mon, 13 Sep 2021 08:14:32 +0000 (11:14 +0300)]
Support mouse events clicked on the tab bar but outside of any tab (bug#41343)
* lisp/tab-bar.el (tab-bar--key-to-number): Return non-nil non-numeric t
when no tab is used. Return nil for current-tab.
(tab-bar-mouse-select-tab, tab-bar-mouse-close-tab): Do nothing
when tab-bar--key-to-number returns non-nil non-numeric t
for click events outside of any tab.
(tab-bar-mouse-context-menu): Add context menu when mouse is clicked
outside of tabs. Add "Duplicate" alongside with "Close" to the menu
used when mouse is clicked on a tab.
(toggle-tab-bar-mode-from-frame, toggle-frame-tab-bar): Move code
closer to 'tab-bar-show'.
* src/xdisp.c (handle_tab_bar_click): Return Qtab_bar with empty list
when mouse is clicked on the tab bar but outside of any tab.
Only do multi-isearch in eww if there's next/prev links
* lisp/net/eww.el (eww-handle-link): Only do multi-isearch if
there's a next/prev link in the HTML (bug#50497).
(eww-setup-buffer): Clear the function.
(eww-mode): Don't set it here.
Extend xref-file-name-display to elisp and etags definitions
And all other types of locations (with a looks-like-file-name check).
* lisp/progmodes/xref.el (xref--group-name-for-display): Extract
from xref-buffer-location's implementation of xref-location-group.
(xref-file-location): Define trivial reader for the 'file' slot.
(xref-location-group): Update docstring.
(xref--analyze): Use the new function here, to be able to format
group names coming from any location type.
ERC: Use 'string-replace' only on Emacs 28 and later
* lisp/erc/erc-dcc.el (erc-dcc-unquote-filename):
* lisp/erc/erc.el (erc-quit-reason-zippy, erc-part-reason-zippy)
(erc-update-mode-line-buffer, erc-message-english-PART): Use
'string-replace' only on Emacs 28 and later, otherwise use
'replace-regexp-in-string' on older Emacsen.
ERC: Use 'string-search' only on Emacs 28 and later
* lisp/erc/erc-backend.el (erc-parse-server-response):
* lisp/erc/erc-dcc.el (erc-dcc-member):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-server)
(erc-speedbar-expand-channel, erc-speedbar-expand-user):
* lisp/erc/erc.el (erc-send-input): Use 'string-search' only on
Emacs 28 and later, otherwise use 'string-match' on older Emacsen.
Juri Linkov [Sun, 12 Sep 2021 17:32:02 +0000 (20:32 +0300)]
* lisp/thingatpt.el (thing-at-mouse): New function (bug#50256).
* lisp/net/dictionary.el: Add 'context-menu-dictionary' to
'context-menu-functions'.
(dictionary-search-word-at-mouse): New function.
(context-menu-dictionary): New function that uses 'thing-at-mouse'.
(dictionary-mouse-popup-matching-words): Remove stray 'selected-window'.
* lisp/mouse.el (context-menu-undo, context-menu-region):
* lisp/progmodes/prog-mode.el (prog-context-menu):
Use 'when' instead of ':visible' that allows to remove duplicate separators
created between empty submenus.
Juri Linkov [Sun, 12 Sep 2021 16:10:02 +0000 (19:10 +0300)]
* lisp/tab-bar.el: Improve logic of 'ignore-current-tab'.
* lisp/tab-bar.el (tab-bar-get-buffer-tab): Prefer the current tab
when 'ignore-current-tab' is nil.
(display-buffer-in-tab): Use alist entry 'ignore-current-tab'
as the third arg of 'tab-bar-get-buffer-tab'. Improve docstring.
Suggested by Feng Shu <tumashu@163.com>
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg00955.html
Improve the accuracy of `xref-find-definitions` by inferring the
likely namespace of the sought identifier from its context.
This reduces the number of irrelevant search hits when it is clear
what kind of identifier is being looked for (such as showing a
variable when the user looks for a function).
Co-written with Dmitry Gutov.
* lisp/progmodes/elisp-mode.el (elisp--xref-list-index)
(elisp--xref-infer-namespace, xref-backend-identifier-at-point): New.
(xref-backend-definitions): Use the buffer position for inferring.
(elisp--xref-find-definitions): Use the inferred namespace.
(xref-backend-apropos): Adapt call.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-mode-test--with-buffer)
(elisp-mode-with-buffer, elisp-mode-infer-namespace): New tests.
Martin Rudalics [Sun, 12 Sep 2021 09:11:41 +0000 (11:11 +0200)]
Improve doc-strings of some buffer display options (Bug#50518)
* lisp/window.el (pop-up-frame-alist, same-window-buffer-names)
(same-window-regexps, pop-up-frames, pop-up-windows): In
doc-strings say that these options are maintained for backward
compatibility only (Bug#50518).
Eli Zaretskii [Sun, 12 Sep 2021 08:02:58 +0000 (11:02 +0300)]
Improve documentation of tab bars in the Emacs manual
* doc/emacs/frames.texi (Tab Bars): Improve wording, indexing, and
cross-references. Make sure each command is mentioned by its name
when it is called out by the key sequence. Index entries should
precede @item lines in a @table.
Olivier Certner [Thu, 14 Jan 2021 17:36:08 +0000 (18:36 +0100)]
ERC: Track: Fix a perceived minor bug in mode line face selection
* lisp/erc/erc-track.el (erc-track-modified-channels): Fix what is a
probable bug when a new insert event happens for a buffer that was not
tracked or for which no mode line face was selected: in this case,
stop treating the latest buffer's face (first in list) as the previous
one, which could be overridden with an older one (in FACES' rest), as
if it had happened after.
Olivier Certner [Thu, 14 Jan 2021 17:26:38 +0000 (18:26 +0100)]
ERC: Track: Rewrite 'erc-track-find-face' as 'erc-track-select-mode-line-face'
* lisp/erc/erc-track.el (erc-track-find-face): Declare obsolete and
rewrite as 'erc-track-select-mode-line-face', changing the function
arguments, so that it is very clear what the current algorithm is.
No functional changes. Performance improvements. Clarify the
documentation and remove the part on some faces being lists, which
clearly does not apply.
(erc-track-modified-channels): Replace calls to 'erc-track-find-face'
with calls to 'erc-track-select-mode-line-face', preserving the
existing behavior.
(erc-modified-channels-alist): Change the reference to
'erc-track-select-mode-line-face' in the documentation following the
rename.
* etc/NEWS: Announce the change.
d7f4cc0974 ERC: Track: Clarify documentation on tracked buffers and a... fb1f0dfec9 ERC: Track: Fix documentation of structure of 'erc-modifie... 252a769b11 ; * doc/lispref/files.texi (Changing Files): Fix xref to f... edc93a5ce6 ; Fix grammar in efaq.texi on Emacs vs XEmacs.
Olivier Certner [Thu, 14 Jan 2021 17:20:26 +0000 (18:20 +0100)]
ERC: Track: Clarify documentation on tracked buffers and add references
* lisp/erc/erc-track.el (erc-modified-channels-alist): Clarify what
the list contains. Add references to variables and functions involved
in displaying tracked buffers from this list.
(erc-make-mode-line-buffer-name): Describe exactly the algorithm, and
reference custom variables that influence it.
Olivier Certner [Wed, 13 Jan 2021 16:39:54 +0000 (17:39 +0100)]
ERC: Track: Fix documentation of structure of 'erc-modified-channels-alist'
* lisp/erc/erc-track.el (erc-modified-channels-alist): Fix the
docstring: each element is a dotted list where the last cdr is
sometimes a proper list, making the element only sometimes a proper
list.