* lisp/subr.el (read-password--hide-password): Factor out (bug#17127).
(read-passwd): Use it in post-command-hook instead of
after-change-functions to ensure that we hide the password no
matter what inserts text.
* src/keymap.c (copy_keymap_1): Factor out and refuse to recurse
infinitely (bug#7496).
(Fcopy_keymap): ... from here.
(copy_keymap_item): Pass on the depth parameter.
Make Fadd_face_text_property even less destructive
* src/textprop.c (Fadd_face_text_property): We need to be
non-destructive in buffers, too, because face properties may have
been added with `put-text-property' as a list that's been reused.
Jiajie Chen [Sat, 12 Oct 2019 19:47:47 +0000 (21:47 +0200)]
button-* function doc string clarifications
* lisp/button.el (button-start, button-end, button-get)
(button-put, button-label): Have the doc string mention that they
have to be called from the current buffer (bug#23909).
* lisp/progmodes/compile.el (compilation-error-properties): Fix
thinko in compilation-transform-file-match-alist feature -- `file'
isn't a list of files after all.
* lisp/progmodes/cc-langs.el (c-string-innards-re-alist): Remove redundant
"\\|\r" from regular expression.
* lisp/progmodes/cc-mode.el (c-make-mode-syntax-table): Correct the name of
the hook normal-erase-is-backspace-MODE-hook from a non-existant hook name.
Paul Eggert [Sat, 12 Oct 2019 01:23:47 +0000 (18:23 -0700)]
Update from Gnulib
This incorporates:
2019-10-11 Simplify and regularize regex use of ‘assert’
2019-10-09 regex: omit debug assignment when not debugging
2019-10-09 regex: tell compiler there’s at most 256 arcs out
2019-10-09 regex: simplify by assuming C99
2019-10-09 regex: avoid copying of uninitialized storage
2019-09-29 fbufmode: Fix compilation error on glibc >= 2.28 systems
2019-09-28 Update comments that refer to POSIX
2019-09-23 Update URLs and associated text
* doc/misc/texinfo.tex, lib/open.c, lib/regcomp.c:
* lib/regex_internal.c, lib/regex_internal.h, lib/regexec.c:
* lib/stdio-impl.h:
Copy from Gnulib.
* lisp/help-mode.el (help-function-def--button-function): Factor
out into own function for easier reuse.
(help-function-def): ... from the lambda here.
* lisp/progmodes/sh-script.el (sh--maybe-here-document): Require a
space before expanding a heredoc (bug#3226). This allows the user
to insert a bash <<< "herestring", which was previously difficult.
Alan Mackenzie [Fri, 11 Oct 2019 19:10:11 +0000 (19:10 +0000)]
C++ Mode: Correctly handle <:, <::, <::>, etc, according to the C++ standard
* lisp/progmodes/cc-engine.el (c-before-change-check-<>-operators): Perform
checking now on an insertion, should point be inside a critical token.
(c-forward-<>-arglist-recur, c-guess-continued-construct): Check for <::, etc.
* lisp/progmodes/cc-langs.el (c-<-pseudo-digraph-cont-regexp)
(c-<-pseudo-digraph-cont-len): New lang variables/constants.
(map--into-hash): New function, extracted from `map-into <hash-table>`.
Speed it up a bit by using gethash instead of map-elt when we know
we're accessing a hash table.
Stefan Kangas [Fri, 11 Oct 2019 13:59:42 +0000 (15:59 +0200)]
Remove reference to obsolete package gnuserv from FAQ
On visiting http://meltin.net/hacks/emacs/, we now find:
"I used to have some Emacs and Haskell hacks on my previous
sites. However, these hacks are now old and un-maintained. I don’t
think there is enough interest to keep them around."
* doc/misc/efaq.texi (Using an already running Emacs process):
Remove reference to obsolete package 'gnuserv'. (Bug#37574)
* lisp/net/tramp.el: Remove :group from all defcustoms.
(tramp-encoding-shell): Fix docstring.
(tramp-error): Remove text properties from error message.
Stefan Kangas [Fri, 11 Oct 2019 11:01:13 +0000 (13:01 +0200)]
Support showing directory in shell command prompt
* lisp/simple.el (shell-command-prompt-show-cwd): New defcustom.
(async-shell-command, shell-command): Show current directory in prompt
when above option is non-nil. (Bug#4987)
* etc/NEWS: Announce it.
Martin Rudalics [Fri, 11 Oct 2019 07:26:41 +0000 (09:26 +0200)]
Minor fixes for switching to previous and next buffers (Bug#37514)
* lisp/window.el (switch-to-prev-buffer)
(switch-to-next-buffer): In doc-strings add links to
'prev-buffer' and 'next-buffer'.
(next-buffer, previous-buffer): Signal 'user-error' instead of
'error'. In doc-strings link to 'switch-to-prev-buffer' and
'switch-to-next-buffer'.
Martin Rudalics [Fri, 11 Oct 2019 06:46:52 +0000 (08:46 +0200)]
Fixes for fitting windows and frames to their buffers (Bug#37563)
* lisp/window.el (window-default-font-height)
(window-default-line-height): New functions.
(fit-frame-to-buffer): Interpret values of MAX-HEIGHT and
MIN-HEIGHT arguments in terms of WINDOW's default line height
(Bug#37563).
(fit-window-to-buffer): Obey size restricting arguments even
when size of WINDOW's text does not change. Do not
temporarily select WINDOW and perform height/width related
calculations if and only if WINDOW is accordingly combined.
Interpret values of MAX-HEIGHT and MIN-HEIGHT arguments in
terms of WINDOW's default line height.
Stefan Kangas [Fri, 11 Oct 2019 00:15:24 +0000 (02:15 +0200)]
Change font size in correct window using mouse wheel
* lisp/mwheel.el (mouse-wheel-follow-mouse): Doc fix.
(mouse-wheel--get-scroll-window): New function extracted from...
(mwheel-scroll): ...here.
(mouse-wheel-text-scale): New function to change face height in
the correct window, depending on the value of
'mouse-wheel-follows-mouse'. (Bug#28182)
(mouse-wheel-mode): Bind 'mouse-wheel-text-scale' instead of
'text-scale-increase' and 'text-scale-decrease'.
Stephen Gildea [Thu, 10 Oct 2019 16:21:38 +0000 (09:21 -0700)]
Remove tabs from time-stamp-format documentation
* time-stamp.el (time-stamp-format): Untabify the doc string, so
the two-column layout displays consistently in several contexts,
in particular when displayed by customize-variable.
Allow filtering out warnings/errors from compile.el detection
* lisp/progmodes/compile.el
(compilation-transform-file-match-alist): New variable (bug#32968).
(compilation-error-properties): Use it to remove known false
positives.
(compilation-error-regexp-alist): Mention it in this doc string.
Juri Linkov [Wed, 9 Oct 2019 22:42:56 +0000 (01:42 +0300)]
* lisp/tab-bar.el: Don't show window count for one window.
* lisp/tab-bar.el (tab-bar-tab-name-selected-window): Don't show the number
of windows when there is only one window in the window configuration.
(tab-bar-close-other-tabs): Rename from tab-close-other.
Take into account tab-bar-show to turn off when needed.
(tab-close-other): Alias to tab-bar-close-other-tabs.
Fix nnimap tick/readedness thinko introduced some weeks back
* lisp/gnus/nnimap.el (nnimap-request-set-mark): Fix thinko in the
tick/read change: Unticking a message shouldn't make it unread,
but ticking it should make it read.
Make mml-secure-epg-sign bug out if we can't find an identity
* lisp/gnus/mml-sec.el (mml-secure-epg-sign): Bug out if we
couldn't find anything to sign with instead of silently pretending
to sign.
* lisp/gnus/mml-smime.el (mml-smime-epg-sign): Don't bind
inhibit-display because that makes debugging impossible.
Stephen Gildea [Wed, 9 Oct 2019 16:19:10 +0000 (09:19 -0700)]
time-stamp: revert recent change to "%04y"
* time-stamp.el (time-stamp-string-preprocess): Revert change to "%04y"
format made 2 weeks ago by commit 0e56883878 (the previous commit to
this file). Although undocumented, "%04y" was discovered to be in use
in the wild (2016) and had not issued a warning that it would change.
Add a warning that it will change.
* time-stamp-tests.el (time-stamp-test-year-2digit): add test of "%04y"
Simen Heggestøyl [Sat, 27 Jan 2018 11:18:40 +0000 (12:18 +0100)]
Warn about missing executables in RST PDF preview
* lisp/textmodes/rst.el (rst-compile-pdf-preview): Warn about missing
executables when attempting to compile and preview an RST file as PDF.
(Bug#30063)
Stephen Gildea [Wed, 9 Oct 2019 16:06:23 +0000 (09:06 -0700)]
Expand testing of time-stamp format "%y"
* time-stamp-tests.el (time-stamp-test-year): break into two tests,
time-stamp-test-year-2digit and time-stamp-test-year-4digit. Expand
time-stamp-test-year-2digit to look more like tests for other 2-digit
conversions.
Robert Pluim [Wed, 9 Oct 2019 13:12:18 +0000 (15:12 +0200)]
Expand documentation on Lisp variables defined in C sources
* doc/lispref/internals.texi (Writing Emacs Primitives): Add
description of DEFVAR_* arguments. Describe variable naming
conventions. Explain how to express quoting of symbols in C, plus
'specbind' and how to create buffer-local variables.
Michael Albinus [Wed, 9 Oct 2019 10:58:43 +0000 (12:58 +0200)]
Support zsh as local shell in Tramp (Bug#31924)
* lisp/net/tramp-sh.el (tramp-sh-extra-args): Extend zsh
arguments. Add :version.
(tramp-maybe-open-connection): Use extra args for
`tramp-encoding-shell'. (Bug#31924)
* src/xdisp.c (syms_of_xdisp) <display-line-numbers-offset>:
New variable to add an offset to absolute line numbers.
(syms_of_xdisp) <display-line-numbers>: Mention it in docstring.
(maybe_produce_line_number): Use it.
* doc/emacs/display.texi (Display Custom): Document it.
* etc/NEWS (value): Announce it.
* lisp/frame.el: Add `display-line-numbers-offset' to list of
variables which should trigger redisplay of the current buffer.
* src/xdisp.c (maybe_produce_line_number): Check beyond_zv
before using a tick face for the line number. Move all face
selection code outside the loop that draws the line number.
Hong Xu [Wed, 9 Oct 2019 05:03:33 +0000 (07:03 +0200)]
Fix up previous visit-tags-table change
* lisp/progmodes/etags.el (visit-tags-table): Reimplement
`tags--find-default-tags-dir-recursively' using the much simpler
`locate-dominating-file'. Following up bug#37518.
Move point in the dired buffer with `n'/`p' in an image-mode buffer
* lisp/image-mode.el (image-next-file): If the image is in a dired
buffer, then move point in that buffer when advancing
(bug#21752). This makes it easier to select images.
Make menu bar entries only point to named functions, not lambdas
* lisp/menu-bar.el ()
(menu-bar--display-line-numbers-mode-visual)
(menu-bar--display-line-numbers-mode-relative)
(menu-bar--display-line-numbers-mode-absolute)
(menu-bar--display-line-numbers-mode-none)
(menu-bar--visual-line-mode-enable)
(menu-bar--toggle-truncate-long-lines)
(menu-bar--wrap-long-lines-window-edge): Make lambdas into trivial
wrapper functions so that `C-h k' on the menu items work (bug#13841).
(menu-bar-showhide-line-numbers-menu)
(menu-bar-line-wrapping-menu): Use them.
Make add-face-text-property not be destructive on strings
* src/textprop.c (add_properties): Take a parameter to say whether
it's allowed to be destructive or not (bug#20153).
(add_text_properties_1): Ditto.
(Fadd_face_text_property): Use this to say that it shouldn't
modify face properties on strings destructively. This avoids
altering the face properties of one string when altering them on a
copy of the string.