Wolfgang Scherer [Fri, 21 Feb 2020 20:28:11 +0000 (21:28 +0100)]
Don't write absolute filenames and duplicate strings to CVS ignore files
* lisp/vc/vc-cvs.el (vc-cvs-ignore): Expand filename correctly
and pass on only the basename as the pattern.
(vc-cvs-append-to-ignore) Do not write duplicate strings to
.cvsignore. New optional parameter SORT to more explicitly
control sorting of the ignore entries. (Bug#37215)
* lisp/vc/pcvs.el (cvs-mode-ignore): Call 'vc-cvs-append-to-ignore'
with SORT argument.
Allen Li [Mon, 17 Feb 2020 07:55:43 +0000 (23:55 -0800)]
Document 'message-send-mail-function' in the Emacs manual
Most of the manual here addresses Message mode, yet talks about
'send-mail-function' which is used for Mail mode.
Fixing this completely requires more involved work, but for now at
least document the difference here.
Steven Allen [Sat, 15 Feb 2020 23:13:59 +0000 (15:13 -0800)]
Skip shell prompt on current line in Eshell even if it's protected
When the eshell prompt is protected (e.g., with rear non-sticky,
inhibited movements, etc.), 'beginning-of-line' won't move to the
actual beginning of the line and therefore won't skip over the
prompt.
* lisp/eshell/em-prompt.el (eshell-previous-prompt): Use
'forward-line' to go to the beginning of the line, even if it's
protected. (Bug#39627)
Paul Eggert [Thu, 20 Feb 2020 01:21:16 +0000 (17:21 -0800)]
Fix bug when visiting euc-jp-encoded directories
Problem reported by Ken Sasaki (Bug#39672).
* src/fileio.c (Ffile_directory_p):
Encode filename before giving it to file_directory_p.
This fixes a typo introduced in
2019-09-18T02:18:14Z!eggert@cs.ucla.edu.
Make OMake support slightly less expensive (bug#39595)
When run with -p or -P, OMake regurgitates error messages that
prevented further progress, indented by 6 spaces. Use that fact
to ameliorate the modification done to other error message regexps.
* lisp/progmodes/compile.el (compilation-parse-errors):
When 'omake' is enabled, allow error messages to be indented by 0 or 6
spaces instead of any number of spaces, to avoid pathological
behaviour.
(compilation-error-regexp-alist-alist): Anchor the 'omake' pattern to
bol for performance. Repair the 'ruby-Test::Unit' pattern, which
relied on the previously over-generous 'omake' hack.
* etc/compilation.txt (OMake): Add examples.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-test-error-regexps): Add test for OMake (indented error).
Speed up 'msft' and 'watcom' compilation error regexps
They have similar structure, and both suffer from being able to
match leading spaces in multiple ways which leads to bad performance
when backtracking (bug#39595).
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Improved 'msft' and 'watcom' regexps.
Anchor the regexp at line-start to prevent quadratic behaviour when
it doesn't match (bug#39595). It's unclear whether the type tag, like
[ERROR], is always present; we keep it optional just in case.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Rewrite 'maven' regexp, using rx for clarity.
* etc/compilation.txt (maven): More examples.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): No leading spaces; they seems to
stem from a misunderstanding in bug#11517.
Alan Mackenzie [Sun, 16 Feb 2020 17:46:02 +0000 (17:46 +0000)]
Amend c-backward-sws better to handle multiline block comments
In particular, multiline comments lacking escaped newlines.
* lisp/progmodes/cc-engine.el (c-backward-sws): Whilst searching backward for
a putative beginning of macro, move back over block comments whose innards
lack escaped newlines.
* lisp/progmodes/cc-engine.el (c-end-of-macro): Handle multiline block
comments lacking escaped newlines using parse-partial-sexp rather than the
former variables removed from cc-langs.el.
Eli Zaretskii [Sat, 15 Feb 2020 08:47:08 +0000 (10:47 +0200)]
Fix 'reverse-region' when less than one line is in region
* lisp/sort.el (reverse-region): Signal a user-error if the region
includes less than one full line, thus avoiding an inadvertent
deletion of text following the current line. Fix the doc string.
Fix comments to start with a capital letter. (Bug#39376)
* lisp/emacs-lisp/package.el (package-menu-mode-menu): Remove obsolete
menu entry "Redisplay buffer".
(package-menu-mode-menu): Menu entry "Refresh Package List":
make the doc string more accurate.
(Bug#39436)
Eli Zaretskii [Wed, 12 Feb 2020 19:39:44 +0000 (21:39 +0200)]
Fix display of minibuffer prompt in ido.el
* lisp/minibuffer.el (minibuffer--message-overlay-pos): New
function.
(set-minibuffer-message): Use it to determine where to show the
overlay with the temporary message.
* lisp/ido.el (ido-exhibit): Revert "Render Ido suggestions using
an overlay"; this restores the original code which inserted the
match-status information into the minibuffer, instead of
displaying it in an overlay with an after-string. Put the special
'minibuffer-message' text property at the beginning of the
inserted text. (Bug#39379)
* etc/NEWS:
* doc/lispref/display.texi (Displaying Messages):
* doc/lispref/text.texi (Special Properties): Document the
'minibuffer-message' text property and its effect.
rx: Use longest match for all-string 'or' forms (bug#37659)
Revert to the Emacs 26 semantics that always gave the longest match
for rx 'or' forms with only string arguments. This guarantee was
never well documented, but it is useful and people likely have come to
rely on it. For example, prior to this change,
(rx (or ">" ">="))
matched ">" even if the text contained ">=".
* lisp/emacs-lisp/rx.el (rx--translate-or): Don't tell regexp-opt to
preserve the matching order.
* doc/lispref/searching.texi (Rx Constructs): Document the
longest-match guarantee for all-string 'or' forms.
* test/lisp/emacs-lisp/rx-tests.el (rx-or): Update test.
Dmitry Gutov [Tue, 11 Feb 2020 21:45:52 +0000 (23:45 +0200)]
vc-hg-dir-status-files: Fix when DIR is not repository root
* lisp/vc/vc-hg.el (vc-hg-dir-status-files):
Make sure it works correctly in a subdirectory of the repo root.
Bind default-directory to DIR and add 're: -I .' to the arguments
(bug#39380).
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).