Alan Mackenzie [Mon, 10 Feb 2020 21:20:12 +0000 (21:20 +0000)]
c-end-of-macro: Handle block coment lines with unescaped NLs correctly
* lisp/progmodes/cc-langs.el (c-last-open-c-comment-start-on-line-re): Make
obsolete, and supersede by ...
(c-open-c-comment-on-logical-line-re): New language variable.
* lisp/progmodes/cc-engine.el (c-end-of-macro): Inside macros, handle
multiline block comments whose line ends are not escaped correctly.
Eli Zaretskii [Sat, 8 Feb 2020 09:38:52 +0000 (11:38 +0200)]
More accurate documentation of 'package-menu-hide-package'
* doc/emacs/package.texi (Package Menu): Improve the description
of the 'H' command.
* lisp/emacs-lisp/package.el (package-menu-mode-menu): More
accurate wording of the help-echo string.
(package-menu-hide-package): Make the doc string more accurate.
(Bug#39436)
Stefan Kangas [Thu, 6 Feb 2020 12:30:33 +0000 (13:30 +0100)]
Revert "Signal user-error on duplicate package refresh"
That commit caused errors when the connection was dropped in the
middle of a package refresh. To avoid any further issues this close
to the pretest, we simply remove this feature. (Bug#39187)
Don't merge to master, where we will instead try to fix the bug.
Juri Linkov [Wed, 5 Feb 2020 22:38:53 +0000 (00:38 +0200)]
Wrap some set-auto-mode calls with delay-mode-hooks (bug#39190)
* lisp/gnus/mm-view.el (mm-display-inline-fontify):
* lisp/vc/diff-mode.el (diff-syntax-fontify-props):
* lisp/vc/vc.el (vc-find-revision-no-save):
Add delay-mode-hooks around set-auto-mode calls
to not run hooks that might assume buffer-file-name
really associates buffer with a file.
Robert Pluim [Fri, 31 Jan 2020 09:22:59 +0000 (10:22 +0100)]
Cater for 3-argument version of pthread_setname_np
Fixes Bug#39363.
* configure.ac: Add check for 3-argument version of
pthread_setname_np.
* src/systhread.c (sys_thread_set_name)
[HAVE_PTHREAD_SETNAME_NP_3ARG]: Call pthread_setname_np with
3 arguments.
Clarify lexvar restrictions for add-to-ordered-list, add-to-history
* lisp/subr.el (add-to-ordered-list, add-to-history):
* doc/lispref/lists.texi (List Variables):
* doc/lispref/minibuf.texi (Minibuffer History):
Note in the doc string and manual that the variable arguments to
add-to-ordered-list and add-to-history cannot refer to a lexical
variable (bug#39373).
Replace add-to-list to lexical variable with push (bug#39373)
Since 'add-to-list', being a plain function, cannot access lexical
variables, such use must be rewritten for correctness.
(Some instances actually do work thanks to a compiler macro,
but it's not something code should rely on.)
While add-to-list often works with lexical variables, this is a hack
that isn't always effective; better tell the user not to try.
* doc/lispref/lists.texi (List Variables): Add a note about lexical
variables to the add-to-list description. Fix the equivalent code.
* lisp/subr.el (add-to-list): Amend doc string.
Stephen Gildea [Sat, 1 Feb 2020 17:28:30 +0000 (09:28 -0800)]
MH-E: alter content in mh-display-msg, not mh-show-mode
* lisp/mh-e/mh-show.el (mh-display-msg, mh-show-mode): buffer-altering
code formerly in mh-show-mode is moved to the location in mh-display-msg
where mh-show-mode used to be called before the fix to MH-E bug #470
moved the call earlier.
Stephen Gildea [Sat, 1 Feb 2020 17:18:46 +0000 (09:18 -0800)]
Update documentation for mh-show-mode-hook
* lisp/mh-e/mh-e.el, doc/misc/mh-e.texi (mh-show-mode-hook): Now that
the fix for MH-E bug #470 calls mh-show-mode-hook earlier, update the
documentation to no longer say that the message contents are available.
Stephen Gildea [Wed, 29 Jan 2020 17:21:19 +0000 (09:21 -0800)]
Example goto-addr hook: MH-E already uses goto-address
* lisp/net/goto-addr.el, doc/emacs/misc.texi: Do not use MH-E as the
example of how to add a hook to goto-address, because MH-E calls
goto-address internally.
Add more blackboard bold characters to TeX input method
This patch adds all capital blackboard bold letters and those for "1"
and "2". Most characters are in common use in mathematics, but it does
not seem useful to exclude the few not widely used.
Eli Zaretskii [Fri, 31 Jan 2020 09:34:50 +0000 (11:34 +0200)]
Allow exiting the Python interpreter of a GDB session
* lisp/progmodes/gdb-mi.el (gdb-delchar-or-quit): Send EOF to GDB
if we are in an embedded interpreter. This allows to exit from
"pi" cleanly. (Bug#39140)
Federico Tedin [Wed, 29 Jan 2020 21:24:40 +0000 (22:24 +0100)]
Ensure minibuffer input is added to history in read_minibuf
* src/minibuf.c (read_minibuf): Parse input string after saving
the string to the history list instead of before, in case parsing
signals an error or is interrupted by C-g. (Bug#39291)
Juri Linkov [Tue, 28 Jan 2020 00:11:59 +0000 (02:11 +0200)]
* lisp/wdired.el: Clean out isearch-filter-predicate (bug#37496)
* lisp/wdired.el (wdired-change-to-dired-mode): Use remove-function to
remove wdired-isearch-filter-read-only (whose value was added in
wdired-change-to-wdired-mode) from local value of isearch-filter-predicate.
Stefan Kangas [Sat, 25 Jan 2020 15:21:06 +0000 (16:21 +0100)]
Improve doc string of 'newline'
* lisp/simple.el (newline): Doc fix. Move 'use-hard-newlines' down,
since it's less important than the meaning of the prefix argument, and
is less frequently used than 'electric-indent-mode' and
'auto-fill-mode'. Change the wording to no longer call it an
option.
Paul Eggert [Sat, 25 Jan 2020 00:57:31 +0000 (16:57 -0800)]
Improve doc of eq on bignums etc.
* doc/lispref/numbers.texi (Integer Basics):
* doc/lispref/objects.texi (Integer Type, Equality Predicates):
Be clearer about eq vs eql vs = on bignums, floats, and strings.
Stephen Gildea [Fri, 24 Jan 2020 17:15:44 +0000 (09:15 -0800)]
; Clarify what time-stamp-active enables
Fix documentation strings and comments for time-stamp. Most notably:
* lisp/time-stamp.el (time-stamp-active): in the doc string, clarify
that time-stamp-active does not add time-stamp to any hook.
Juri Linkov [Wed, 22 Jan 2020 23:23:17 +0000 (01:23 +0200)]
Tab-bar related finishing touches.
* lisp/tab-bar.el (tab-bar-tab-name-ellipsis): Use shorter name
instead of tab-bar-tab-name-truncated-ellipsis.
(tab-bar-new-tab-to) <defcustom>: Add 'function' option.
(tab-bar-new-tab-to) <function>: Use it.
* lisp/tab-line.el (tab-line-close-tab): Add missing arg 'tab' to
tab-line-close-tab-function funcall.
Alan Mackenzie [Wed, 22 Jan 2020 19:50:30 +0000 (19:50 +0000)]
Make call_process call signal_after_change. This fixes bug #38691.
Now, functions such as call-proess-region invoke after-change-functions
correctly.
* src/callproc.c (call_process): Call prepare_to_modify_buffer in a single
place, no longer delegating the task to insert_1_both, etc. Call
signal_after_change in each of two code branches, such that
before-change-functions and after-change-functions are always called in
balanced pairs.
* lisp/image-dired.el (image-dired-rotate-thumbnail-left)
(image-dired-rotate-thumbnail-right)
(image-dired-rotate-original-left)
(image-dired-rotate-original-right): Move the text in the doc
strings about rotating the originals to the correct commands
(bug#38928).
Eli Zaretskii [Tue, 21 Jan 2020 16:23:32 +0000 (18:23 +0200)]
Avoid leaving artifacts when the system caret is used on w32
* src/xdisp.c (try_window_reusing_current_matrix, try_window_id):
* src/dispnew.c (scrolling_window) [HAVE_NTGUI]: If
w32-use-visible-system-caret is non-nil, disallow scrolling the
display are in scroll_run_hook. This avoids copying traces of the
caret, about which Emacs knows nothing, and thus considers those
pixels show the default background. (Bug#39188)
(gui_update_window_end): Block input only around part of the code,
as we did before this code was extracted from backend-specific
implementations.
* src/w32term.c (w32_update_window_begin, w32_update_window_end):
Only hide/show the caret when redisplaying the window where the
caret is shown.
Eli Zaretskii [Tue, 21 Jan 2020 15:58:23 +0000 (17:58 +0200)]
Improve display of temporary echo messages
* lisp/minibuffer.el (set-minibuffer-message): Fix cursor position
for the temporary display of an echo-area message when minibuffer
is active. Ensure the message is visible even if the end of the
completion candidates presented by the likes of Icomplete mode is
not visible due to its length, under resize-mini-windows = nil.
(Bug#38457)
Juri Linkov [Mon, 20 Jan 2020 23:03:37 +0000 (01:03 +0200)]
Allow optional truncation of tab names in tab-bar and tab-line (bug#38693)
* lisp/tab-line.el (tab-line-tab-name-truncated-max): New defcustom.
(tab-line-tab-name-truncated-buffer): Use tab-line-tab-name-truncated-max
consistently with similar options in tab-bar.el.
(tab-line-tabs-limit): Remove variable.
(tab-line-tabs-window-buffers): Remove use of tab-line-tabs-limit
that was an experimental feature before horizontal scrolling was implemented.
(tab-line-close-tab-function): Rename from tab-line-close-tab-action
and allow a customizaed function as option.
(tab-line-close-tab): Call function if tab-line-close-tab-function
is customized to a function.
* lisp/tab-bar.el (tab-bar-tab-name-function): Add option
tab-bar-tab-name-truncated.
(tab-bar-tab-name-truncated-max): New defcustom.
(tab-bar-tab-name-truncated-ellipsis): New variable.
(tab-bar-tab-name-truncated): New function.
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Go back to actually testing completion before semicolon.
(shell-tests-completion-after-semi): Test completion after semicolon,
correctly (bug#39075).
Tino Calancha [Sun, 19 Jan 2020 10:13:02 +0000 (11:13 +0100)]
Fix shell-command-dont-erase-buffer feature
* lisp/simple.el (shell-command-dont-erase-buffer):
The default, nil, is backward compatible, i.e. it erases the buffer
only if the output buffer is not the current one; the new value 'erase
always erases the output buffer.
Update docstring.
(shell-command-save-pos-or-erase):
Add optional arg output-to-current-buffer.
Rename it so that it's not internal. All callers updated.
(shell-command-set-point-after-cmd): Rename it so that it's not internal.
All callers updated.
Adjust it to cover a side case.
(shell-command): Adjust logic to match the specification (Bug#39067).
Enable the feature when the output buffer is the current one.
(shell-command-on-region): Little tweak to follow
`shell-command-dont-erase-buffer' specification.
Eric Abrahamsen [Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)]
Ensure that gnus-summary-attach-article finds the right articles
* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): Before
iterating over the articles to attach, first close any open
article. Using `set-buffer' required `gnus-summary-select-article' to
re-set the buffer every time, meaning we never got off the original
article.
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Amend the shell.el tests to catch errors such as bug#39057.
* lisp/shell.el (shell--parse-pcomplete-arguments): Skip the
semi-colon as well. This avoids inflooping when a semi-colon is
typed by the user. (Bug#39057)
Amin Bandali [Sat, 18 Jan 2020 04:38:04 +0000 (23:38 -0500)]
Fix erc-notifications-notify for non-PRIVMSGs, broken in last commit
* lisp/erc/erc-desktop-notifications.el (erc-notifications-notify):
Take optional argument `privp', to be non-nil when notifying for a
PRIVMSG. This is to work around bug introduced in last commit, as
`erc-get-buffer' may return nil for non-PRIVMSG cases.
(erc-notifications-PRIVMSG): Call erc-notifications-notify with
non-nil `privp', as described above.
Amin Bandali [Sat, 18 Jan 2020 03:33:03 +0000 (22:33 -0500)]
Fix the notification action for PRIVMSG in erc-notifications-notify
* lisp/erc/erc-desktop-notifications.el (erc-notifications-notify):
explicitly request the buffer for `nick', rather than relying on
(current-buffer) returning it. That works fine for the very first
PRIVMSG sent by `nick', but ERC seems to handle subsequent PRIVMSGs
differently, where (current-buffer) would return the server buffer
rather than the existing buffer for PRIVMSGs from `nick'.
Dmitry Gutov [Fri, 17 Jan 2020 21:14:24 +0000 (00:14 +0300)]
Honor tags-case-fold-search during xref identifer completion
* etc/NEWS: New entry.
* lisp/progmodes/etags.el (tags-case-fold-search):
Mark as safe-local.
(find-tag--completion-ignore-case):
Extract from tags-completion-at-point-function, find-tag-tag and
etags--xref-find-definitions.
(xref-backend-identifier-completion-ignore-case):
New method. Use it here as well.
* lisp/progmodes/xref.el
(xref-backend-identifier-completion-ignore-case): New generic.
(xref--read-identifier): Use it here.
Damien Cassou [Fri, 27 Dec 2019 14:35:52 +0000 (15:35 +0100)]
Add unattended spell-checking to checkdoc
This commit makes checkdoc capable of spell-checking even when the
user isn't using it interactively. When TAKE-NOTES is non-nil,
checkdoc will run spell-checking (with ispell) and report spelling
mistakes.
Fixes: (bug#38583).
* lisp/textmodes/ispell.el (ispell-word): Extract part of it to
`ispell--run-on-word`.
(ispell--run-on-word): New function, extracted from `ispell-word`.
(ispell-error-checking-word): New function.
(ispell-correct-p): New function. Use `ispell--run-on-word` and
`ispell-error-checking-word`.
* lisp/emacs-lisp/checkdoc.el (checkdoc-current-buffer): Pass
TAKE-NOTES to `checkdoc-start`.
(checkdoc-continue): Pass TAKE-NOTES to `checkdoc-this-string-valid`.
(checkdoc-this-string-valid): Add optional argument TAKE-NOTES and
pass it to `checkdoc-this-string-valid-engine`.
(checkdoc-this-string-valid-engine): Add optional argument TAKE-NOTES
and pass it to `checkdoc-ispell-docstring-engine`.
(checkdoc-ispell-init): Call `ispell-set-spellchecker-params` and
`ispell-accept-buffer-local-defs`. These calls are required to
properly use ispell. The problem went unnoticed until now because
checkdoc was only using ispell through the high-level command
`ispell-word` which takes care of all the initialization for the user.
(checkdoc-ispell-docstring-engine): Add optional argument TAKE-NOTES
to force reporting of spell-checking errors. Throw error
when (checkdoc-ispell-init) fails configuring ispell. Replace a
few (if cond nil body) with (unless cond body). Replace (let ((var
nil))) with (let (var)). Replace (if (not (eq checkdoc-autofix-flag
'never)) body) with just body because `checkdoc-autofix-flag` is
checked at the beginning of the function.
Robert Pluim [Wed, 15 Jan 2020 11:24:43 +0000 (12:24 +0100)]
Make emacs prefer an existing ~/.emacs.d to an existing XDG location
* doc/emacs/custom.texi (Find Init): Update description of how Emacs
finds its init file directory and the interaction with
$XDG_CONFIG_HOME
(Early Init File): Correct XDG location of early-init.el
* etc/NEWS: Update description to make it clear the ~/.emacs.d is
preferred, even if the XDG location exists.
* lisp/startup.el: Prefer ~/.emacs.d even if the XDG location exists.
* lib-src/emacsclient.c (open_config): Prefer home directory the XDG
location.
Juri Linkov [Wed, 15 Jan 2020 23:30:33 +0000 (01:30 +0200)]
Move shell-related menu items to "Shell Commands" submenu (bug#37594)
* lisp/menu-bar.el (menu-bar-shell-commands-menu): New variable.
(menu-bar-tools-menu): Move shell-related menu items to
'menu-bar-shell-commands-menu' and add menu items for
'async-shell-command' and 'shell'.