Phil Sainty [Tue, 25 Jun 2019 14:02:12 +0000 (16:02 +0200)]
Fix `goto-address-url-regexp'
* lisp/net/goto-addr.el (goto-address-uri-schemes-ignored): New
variable.
(goto-address-uri-schemes): Ditto.
(goto-address-url-regexp): Use them to compose the final regexp.
* lisp/net/goto-addr.el: The URI schemes to be recognised by
`goto-address-mode' were not regexp-quoted (Bug#23343).
Tino Calancha [Tue, 25 Jun 2019 13:42:17 +0000 (15:42 +0200)]
Make winner restore point in all windows that display a buffer
* lisp/window.el (window--before-delete-windows): New defun.
(delete-window, delete-other-windows): Use it.
* lisp/winner.el (winner-set): Use marker in 'window-prev-buffers'
when available and different than the value returned by
'winner-get-point' (bug#23621).
Robert Weiner [Tue, 25 Jun 2019 12:08:49 +0000 (14:08 +0200)]
Unlispify even more in custom-unlispify-menu-entry
* lisp/cus-edit.el (custom-unlispify-menu-entry): Also allow : and
/ as separators in symbols when making the symbols look more
human-readable (bug#23986).
* lisp/textmodes/tex-mode.el (tex-verbatim-environments): Replace
(delq t ...) with more usual (memq nil ...).
(latex-noindent-environments, latex-noindent-commands): Fix typos
and thinkos in safe-local-variable logic.
* admin/unidata/Makefile.in (extraclean): Don't delete macuvs.h,
because it's a checked-in file, and make targets altering
checked-in files is confusing.
Antoine Beaupré [Tue, 25 Jun 2019 10:58:36 +0000 (12:58 +0200)]
Add imenu support to package-menu-mode
* lisp/vc/vc-git.el (vc-git-grep-template): Include <C> in
template to be more consistent with lgrep/rgrep (bug#35326). This
will introduce the --color and -i flags to the "git grep" command.
Alan Mackenzie [Tue, 25 Jun 2019 08:52:38 +0000 (08:52 +0000)]
Fix documentation of inhibit-modification-hooks in overlays + text properties
This fixes bug #25111.
* doc/lispref/display.text (Overlay Properties): For the hook property
modification-hooks, state that inhibit-modification-hooks is bound to non-nil
when calling its functions. This also applies to insert-in-front-hooks and
insert-behind-hooks, which refer to modification-hooks.
* doc/lispref/text.texi (Special Properties): For the hook property
modification-hooks, state that inhibit-modification-hooks is NOT bound to
non-nil when calling its functions. For the hooks insert-in-fron-hooks and
insert-behind-hooks, state that that variable does get bound to non-nil.
Hong Xu [Mon, 24 Jun 2019 23:22:23 +0000 (01:22 +0200)]
Add imenu support to package-menu-mode
* gnus-cite.el (gnus-message-citation-mode): Fontify if the major
mode is derived from message-mode (not necessarily equal to
message-mode) (bug#25124).
Damien Cassou [Mon, 24 Jun 2019 22:55:45 +0000 (00:55 +0200)]
Add imenu support to package-menu-mode
* lisp/emacs-list/package.el
(package--imenu-prev-index-position-function
package--imenu-extract-index-name-function): Add Imenu functions
to package-menu-mode (bug#27134).
* src/xdisp.c (message_to_stderr): When running as a batch
process, the output from `message' goes to stderr, and has a
newline appended. Rewrite the code so that only one fwrite is
performed to enable messages that are shorter than PIPE_BUF
(usually 4096 on modern operating systems) are written out as one
chunk, as this will ensure that the messages are not interleaved
with messages from other processes that are writing at the same
time. This does not affect other stderr outputs, just the ones
from `message'.
Kaushal Modi [Mon, 24 Jun 2019 22:42:20 +0000 (00:42 +0200)]
Add example for enabling minor modes in .dir-local.el
* doc/emacs/custom.texi (Directory Variables): Add an example that
shows how a minor mode can be enabled in a .dir-local.el (Bug#27639).
Clarify that indent-tabs-mode is not a minor mode.
Stefan Monnier [Mon, 24 Jun 2019 21:15:11 +0000 (17:15 -0400)]
* lisp/svg.el: Prepare for distribution via GNU ELPA
Add a Version: and Package-Requires:.
Don't require subr-x.
Bring Commentary: from the GNU ELPA version of the package.
(svg-remove): Don't use when-let*.
Eric Abrahamsen [Tue, 30 Apr 2019 23:00:46 +0000 (16:00 -0700)]
Tweaks to html mode
* lisp/textmodes/sgml-mode.el (sgml-attributes): Add the "class" and
"id" attributes when needed.
(html-mode-map): Add the `html-div' and `html-span' commands to the
`html-quick-keys' map.
(html-ordered-list, html-unordered-list, html-paragraph): Use the
"\n" element properly.
(html-div, html-span): New HTML skeletons.
Eli Zaretskii [Mon, 24 Jun 2019 17:06:34 +0000 (20:06 +0300)]
Fix MS-Windows build as followup to pdumper executable lookup
* src/w32.c (w32_my_exename): New function.
* src/w32.h (w32_my_exename): Add prototype.
* src/emacs.c (load_pdump_find_executable) [WINDOWSNT]: Find
the actual file name of the program without looking along
PATH, by calling w32_my_exename.
* nt/mingw-cfg.site (ac_cv_func_canonicalize_file_name)
(ac_cv_func_realpath, gl_cv_func_realpath_works): Disable
testing.
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_canonicalize-lgpl): Set
to true.
* lisp/iimage.el (iimage-recenter): Call `recenter-top-bottom'
instead of `recenter', since that's the default function for `C-l'
(bug#27610). Suggested by Arne Frederic Maria Döring.
Michael Albinus [Mon, 24 Jun 2019 15:36:00 +0000 (17:36 +0200)]
Improve error handling in Tramp
* lisp/net/tramp-compat.el (ls-lisp): Require.
* lisp/net/tramp.el (ls-lisp-use-insert-directory-program):
Don't declare.
(tramp-current-connection): Adapt docstring.
(tramp-debug-message): Adapt function names.
(tramp-error, tramp-run-real-handler): Let-bind `signal-hook-function'.
(tramp-signal-hook-function): New defun.
(tramp-debug-on-error, tramp-condition-case-unless-debug): Remove.
(tramp-file-name-handler): Handle `tramp-current-connection'.
Let-bind `signal-hook-function'. Use `unwind-protect' instead of
`tramp-condition-case-unless-debug'.
(tramp-handle-insert-directory): Don't require ls-lisp.
(tramp-process-actions): Check, that
`tramp-password-save-function' is non-nil.
(tramp-equal-remote): Handle the case both files are local.
* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Do not bind `tramp-debug-on-error'.
(tramp--test-ignore-make-symbolic-link-error): Make error handler
more explicit about the error.
Add new commands to widen/narrow tabulated list columns
* doc/emacs/buffers.texi: Document widen/contracting commands in
tabulated list mode.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode-map): Add
keystrokes.
(tabulated-list-widen-current-column): New command.
(tabulated-list-narrow-current-column): Ditto. The code was
written by Boruch Baum and then tweaked by Drew Adams (bug#32106)
before some white-space changes before the commit.
* lisp/dired-aux.el (dired-compress-file-suffixes): Add suffixes for
zstd compressed tarballs and other files.
(dired-compress-file): Treat options found in
`dired-compress-file-suffixes' as arguments instead of part of the
program name.
Keith Amidon [Mon, 6 May 2019 03:21:43 +0000 (20:21 -0700)]
Minimize entry parsing in auth-source-pass
Prior to this commit, while searching for the most applicable entry
password-store entries were decrypted and parsed to ensure they were
valid. The entries were parsed in the order they were found on the
filesystem and all applicable entries would be decrypted and parsed,
which varied based on the contents of the password-store and the entry
to be found.
This is fine when the GPG key is cached and each entry can be
decrypted without user interaction. However, for security some people
have their GPG on a hardware token like a Yubikey setup so that they
have to touch a sensor on the toke for every cryptographic operation,
in which case it becomes inconvenient as each attempt to find an entry
requires a variable number of touches of the hardware token.
The implementation already assumes that names which contain more of
the information in the search key should be preferred so there is an
ordering of preference of applicable entries. If the decrypt and
parsing is removed from the initial identification of applicable
entries in the store then in most cases a single decrypt and parse of
the most preferred entry will suffice, improving the experience for
hardware token users that require interaction with the token.
This commit implements that strategy. It is in spirit a refactor of
the existing code.
* lisp/auth-source-pass.el (auth-source-pass--matching-entries): New
function, generate an ordered list of regular expression matchers for
all possible names that could be in the password-store for the entry
to be found and then makes a pass over the password-store entry names
accumulating the matching entries in a list after the regexp that
matched. This implementation ensures the password-store entry list
still only has to be scanned once.
(auth-source-pass--find-match-unambiguous): Use it to obtain candidate
entries and then parse them one by one until an entry containing the
desired information is located. When complete, return the parsed data
of the entry instead of the entry name so that the information can be
used directly to construct the auth-source response.
(auth-source-pass--build-result): Update accordingly.
(auth-source-pass--find-match): Update docstring accordingly.
(auth-source-pass--select-one-entry)
(auth-source-pass--entry-valid-p)
(auth-source-pass--find-all-by-entry-name)
(auth-source-pass--find-one-by-entry-name): Remove.
(auth-source-pass--select-from-entries)
(auth-source-pass--accumulate-matches)
(auth-source-pass--entry-reducer)
(auth-source-pass--generate-entry-suffixes)
(auth-source-pass--domains)
(auth-source-pass--name-port-user-suffixes): New functions.
* test/lisp/auth-source-pass-tests.el: One test case was added to the
test suite to verify that only the minimal number of entries are
parsed in common cases. The
auth-source-pass-only-return-entries-that-can-be-open test case had to
be re-implemented because the function it was used eliminated as the
functionality is provided elsewhere. All the other fairly substantial
changes to the test suite are the result of mechanical changes that
were required to adapt to auth-source-pass--find-match returning the
data from a parsed password-store entry instead of the entry name.
Keith Amidon [Tue, 30 Apr 2019 14:52:14 +0000 (07:52 -0700)]
Split out the attribute retrieval form auth-source-pass-get
Eliminate the need to repeatedly retrieve and parse the data for the
entry. This is generally a good thing since it eliminates repetitions
of the same crypto and parsing operations. It is especially valuable
when protecting an entry with a yubikey with touch required for crypto
operations as it eliminates the need to touch the yubikey sensor for
each attribute retrieved.
* lisp/auth-source-pass.el (auth-source-pass-get): Extract some code to
`auth-source-pass--get-attr'.
(auth-source-pass--get-attr): New function to get a field value from a
parsed entry.
(auth-source-pass--build-result): Make use of
`auth-source-pass--get-attr` to avoid repeated parsing.
Keith Amidon [Thu, 14 Feb 2019 18:27:31 +0000 (10:27 -0800)]
Fix auth-source-pass to search for hostname:port/username
auth-source-pass supports entries with username either prefixed to the
hostname with an @ as separator or in a subdirectory under the
hostname. This was true when there was no port or service included in
the name, but got broken with the introduction of
auth-source-pass-port-separator.
* lisp/auth-source-pass.el (auth-source-pass--find-match-unambiguous): Fix
to match hostname:port/username.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests.
Iku Iwasa [Sun, 7 Apr 2019 08:59:59 +0000 (17:59 +0900)]
Add auth-source-pass-port-separator option
* lisp/auth-source-pass.el (auth-source-pass-port-separator): New
option to specify separator between host and port, default to
colon (":").
(auth-source-pass--find-match-unambiguous): Adapt to make use of the
new variable.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests.
galaunay [Sun, 13 Jan 2019 21:30:53 +0000 (21:30 +0000)]
Add auth-source-pass-filename option
* lisp/auth-source-pass.el (auth-source-pass)
(auth-source-pass-filename): Add option to specify a customized
password-store path.
(auth-source-pass--read-entry)
(auth-source-pass-entries): Use the new option instead of hard-coded
`~/.password-store'.
Magnus Henoch [Fri, 2 Nov 2018 21:51:59 +0000 (21:51 +0000)]
Fix auth-source-pass to return nil if no entry found
* lisp/auth-source-pass.el (auth-source-pass-search): If there is no
matching entry, auth-source-pass-search should return nil, not (nil).
This lets auth-source fall back to other backends in the auth-sources
list.
* test/lisp/auth-source-pass-tests.el: Add corresponding test.
Carlos Pita [Sun, 23 Jun 2019 20:49:47 +0000 (22:49 +0200)]
Fix auto-revert resizing in image mode
* lisp/image-mode.el (image-transform-properties): Get image
parameters right after reverting; in particular, compute the
correct max size (bug#33631).
Optional space and unit in `file-size-human-readable' (bug#35756)
To improve readability of strings produced by
`file-size-human-readable', add two optional arguments:
- SPACE, to provide a string (typically a space or non-breaking space)
to put between the number and unit. For compatibility, the default is
an empty string.
- UNIT, a string to use as unit. For compatibility, the default is
"B" in `iec' mode and the empty string otherwise.
Also fix a glitch with small numbers in `iec' mode which caused a
stray "i" in the result.
* lisp/files.el (file-size-human-readable):
Add optional SPACE and UNIT arguments and handle small numbers correctly.
(files--ask-user-about-large-file, warn-maybe-out-of-memory):
Call with `iec' and space.
* test/lisp/files-tests.el (files-test-file-size-human-readable): New test.
* lisp/url/url-http.el (url-http-simple-after-change-function)
(url-http-content-length-after-change-function): Call with `iec' and space.
* etc/NEWS (Lisp Changes): Mention the change.
Michael Brumlow [Sun, 23 Jun 2019 18:10:21 +0000 (20:10 +0200)]
(hfy-fontify-buffer): Inhibit read only
* lisp/htmlfontify.el (hfy-fontify-buffer): Inhibit read only to
enable the function to work with text that comes from buffers that
put read-only text properties on things (bug#35025).
Mauro Aranda [Sun, 23 Jun 2019 17:57:48 +0000 (19:57 +0200)]
Document Winner mode user options
* doc/emacs/windows.texi (Window Convenience): Add documentation for
the user options winner-dont-bind-my-keys, winner-ring-size and
winner-boring-buffers (bug#35146).
Drew Adams [Sun, 23 Jun 2019 17:24:20 +0000 (19:24 +0200)]
Make ls-lisp--dired ape dired-noselect more closely
* lisp/ls-lisp.el (ls-lisp--dired): Emulate the behaviour of
non-ls-lisp.el dired better by defaulting to default-directory as
dired-noselect does (bug#35390).
Eric Abrahamsen [Sun, 23 Jun 2019 15:09:23 +0000 (08:09 -0700)]
New command gnus-summary-browse-url
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url): New command for
browsing URLs from the article buffer from the summary buffer.
(gnus-summary-mode-map): Bind to "w".
(gnus-summary-article-map): And to "A w".
* doc/misc/gnus.texi (Article Commands): Document.
Michael Albinus [Sun, 23 Jun 2019 16:58:11 +0000 (18:58 +0200)]
Improve error handling in tramp-gvfs
* lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes)
(tramp-gvfs-get-root-attributes)
(tramp-gvfs-handle-file-attributes): Don't ignore errors.
(tramp-make-goa-name): New defun.
(tramp-gvfs-get-remote-prefix): Use it.
(tramp-gvfs-maybe-open-connection): Raise user errors in case of.
Check also, that GOA accounts are proper.
(tramp-get-goa-accounts): Cache connection property.
* lisp/net/tramp.el (tramp-handle-file-equal-p)
(tramp-handle-file-in-directory-p): Use `tramp-equal-remote'.
Simen Heggestøyl [Sat, 22 Jun 2019 10:49:04 +0000 (12:49 +0200)]
Split up and add tests for two page.el functions
* lisp/textmodes/page.el (page--count-lines-page): New function
extracted from `count-lines-page'.
(count-lines-page): Extract main logic into `page--count-lines-page'.
(page--what-page); New function extracted from `what-page'.
(what-page): Extract main logic into `page--what-page'.
* test/lisp/textmodes/page-tests.el (page-tests-count-lines-page)
(page-tests-what-page): New tests for `page--count-lines-page' and
`page--what-page'. (Bug#36009)
Noam Postavsky [Fri, 21 Jun 2019 11:49:22 +0000 (07:49 -0400)]
Fix python docstring auto-fill (Bug#36056)
* lisp/progmodes/python.el (python-mode): Set
fill-indent-according-to-mode locally to t. This lets auto-fill do
the right thing when auto-filling inside a docstring. The default was
to nil on 2001-11-25 "(fill-indent-according-to-mode): Default to nil"
with the comment that it "screws up CC-mode's filling tricks". But
presumably it shouldn't be a problem for python-mode.
* test/lisp/progmodes/python-tests.el (python-auto-fill-docstring):
New test.
Noam Postavsky [Sun, 16 Jun 2019 17:48:56 +0000 (13:48 -0400)]
Make rcirc parsing more RFC2812 compliant (Bug#36233)
Do continue to allow multiple spaces between arguments, even though
that is technically not allowed by the RFC.
* lisp/net/rcirc.el (rcirc-process-server-response-1): Fix parsing of
arguments which contain colons.
* test/lisp/net/rcirc-tests.el: New test.
Paul Eggert [Sat, 22 Jun 2019 18:35:45 +0000 (11:35 -0700)]
Bring macuvs.h back under Git control
* admin/unidata/Makefile.in (maintainer-clean):
Instead of removing macuvs.h here ...
(extraclean): ... Remove it here.
* admin/unidata/uvs.el (uvs-print-table-ivd):
Add to comment explaining why macuvs.h is in Git.
* src/macuvs.h: Regenerate and re-add to Git.
Remove XEmacs compat code from savehist.el (reworked)
* lisp/savehist.el (savehist-coding-system, savehist-install)
(savehist-uninstall, savehist-save): Remove XEmacs compat code.
(savehist-trim-history): Made obsolete.
(savehist-minibuffer-hook): Update comment to reflect the t value
of HISTORY in `read-string'.
Stefan Kangas [Sun, 9 Jun 2019 02:27:09 +0000 (04:27 +0200)]
Make toolbar show keyboard equivalents in its tooltips
* src/keyboard.c (parse_tool_bar_item): Add equivalent key binding to
the tooltip string of toolbar buttons.
* etc/NEWS: Announce it.
* etc/TODO: Remove its entry. (Bug#36156)
Eli Zaretskii [Sat, 22 Jun 2019 08:59:16 +0000 (11:59 +0300)]
Fix an off-by-one error in assertion
* src/fileio.c (Fexpand_file_name): Fix off-by-one error in an
assertion. This avoids assertion violations when the home
directory is an empty string for some reason. (Bug#36363)
Eli Zaretskii [Sat, 22 Jun 2019 08:51:50 +0000 (11:51 +0300)]
Correct and update the mapping of LaTeX encodings
* lisp/international/latexenc.el
(latex-inputenc-coding-alist): Fix the association of latin5.
(Bug#36253) Uncomment latin10 and map it to iso-8859-16.
Eli Zaretskii [Sat, 22 Jun 2019 08:34:23 +0000 (11:34 +0300)]
Avoid using string-make-unibyte in select.el
* lisp/select.el (selection-coding-system): Doc fix.
(xselect--encode-string): For C_STRING, if the text is not
already unibyte, use encode-coding-string instead of
string-make-multibyte to make it unibyte.
Paul Eggert [Fri, 21 Jun 2019 21:45:35 +0000 (14:45 -0700)]
Remove src/macuvs.h from Git repository
It can be generated automatically and easily during a normal
bootstrap, so there’s no need to keep it in the repository.
* admin/unidata/Makefile.in (maintainer-clean):
Behave like extraclean and remove macuvs.h etc.
* src/macuvs.h: Remove.
Stefan Monnier [Fri, 21 Jun 2019 05:16:54 +0000 (01:16 -0400)]
* lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup
Re-enable lexical-binding in ediff. For that, change ediff-find-file
so as not to rely on dynamic scoping in its calling convention.
* lisp/vc/ediff-diff.el: Move `provide` to the end.
Remove redundant :group.
(ediff-exec-process): Disregard current directory.
(ediff-forward-word-function): Use defvar-local.
* lisp/vc/ediff-help.el (ediff-set-help-message): Use functionp.
* lisp/vc/ediff-hook.el (menu-bar-ediff-misc-menu): Make a toggle, as
in the XEmacs menu.
* lisp/vc/ediff-mult.el: Move `provide` to the end.
Remove redundant :groups.
(ediff-dir-diffs-buffer-map):
Move initialization into declaration.
(ediff-meta-mode): Use define-derived-mode.
(ediff-intersect-directories): Remove `comparison-func`, unused.
(ediff-prepare-meta-buffer): Fix use of `startup-hooks`.
* lisp/vc/ediff-ptch.el: Move `provide` to the end.
* lisp/vc/ediff-util.el (ediff-add-to-history): Use add-to-history instead.
* lisp/vc/ediff-vers.el (ediff-vc-internal, ediff-vc-merge-internal):
Use push and closures.
* lisp/vc/ediff.el: Move `provide` to the end.
Remove redundant :groups.
(ediff--magic-file-name, ediff--startup-hook): New vars.
(ediff-find-file): Change calling convention so as not to use
symbols as value cells.
(ediff--buffer-file-name): New function.
(ediff-files-internal): Adjust to new calling convention of ediff-find-file.
(ediff-directories-internal, ediff-directory-revisions-internal)
(ediff-regions-internal): Use push and closures.