* lisp/mail/sendmail.el (mail-citation-prefix-regexp): Don't
regard "]" as a citation prefix character (bug#25150). This
allows some motion commands (like forward-sexp) to behave more as
expected in Message mode buffers.
Paul Eggert [Mon, 23 Sep 2019 06:53:39 +0000 (23:53 -0700)]
Update some URLs
This mostly changes http: to https: in URLs. It also updates
some URLs that have moved, removes some URLs that no longer
work, recommends against using procmail (procmail.org no
longer works), and removes some mentions of the
no-longer-existing Gmane, LPF and VTW.
It doesn't update all URLs, just the ones I had time for.
* GNUmakefile (help):
* admin/admin.el (manual-doctype-string):
* admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map):
* admin/charsets/mapconv:
* lisp/net/soap-client.el (soap-create-envelope):
* lisp/org/org.el (org-doi-server-url):
* lisp/textmodes/bibtex.el (bibtex-generate-url-list):
Prefer https: to http: un URLs.
Stephen Gildea [Mon, 23 Sep 2019 03:27:53 +0000 (20:27 -0700)]
Expand time-stamp unit tests to cover all formatting options
* time-stamp-tests.el: Expand unit tests to cover all formatting options.
These tests validate time-stamp-pattern formatting that has existed
since at least Emacs 22 (released in 2007). The tests cover both
documented behavior and behavior implemented to support future migrations.
* time-stamp.el (time-stamp-string): Add a second argument (TIME) to
open a testing seam. Have the unit tests call this public function.
* time-stamp.el (time-stamp-string, time-stamp-string-preprocess):
Remove the second pass through time-string--format. (Previously both
functions called it.) It was used only to handle "%", but this is now
handled by having time-stamp-string-preprocess not double it.
Not doubling the "%" in time-stamp-string-preprocess fixes the padding
of "%2%", which was discovered by the new unit tests to be wrong.
The regexp in this list used a capitalized “React” because it actually
should be capitalized like that. Otherwise, the following code would
produce a false positive match: import Thing from './react/Thing'
* lisp/progmodes/js.el (js-jsx-regexps): Update docstring.
(js-jsx--detect-and-enable): Match case-sensitively when determining
whether JSX should be enabled.
Paul Eggert [Sun, 22 Sep 2019 17:43:21 +0000 (10:43 -0700)]
Avoid crashes when casifying noncontiguous regions
This is a followon fix for Bug#37477.
* lisp/simple.el (region-extract-function):
Use setq here, since the var is now defined in C code.
* src/casefiddle.c (casify_pnc_region): New function.
(Fupcase_region, Fdowncase_region, Fcapitalize_region)
(Fupcase_initials_region): Use it.
(Fupcase_initials_region): Add region-noncontiguous-p flag
for consistency with the others. All uses changed.
(syms_of_casefiddle): Define Qbounds, Vregion_extract_function.
* src/insdel.c (prepare_to_modify_buffer_1):
* src/keyboard.c (command_loop_1):
Use Vregion_extraction_function.
* src/insdel.c (syms_of_insdel): No need to define
Qregion_extract_function.
* test/src/casefiddle-tests.el (casefiddle-oldfunc): New var.
(casefiddle-loopfunc, casefiddle-badfunc): New functions.
(casefiddle-invalid-region-extract-function): New test.
* lisp/image/exif.el (exif-parse-buffer): New function.
(exif-orientation): Ditto.
(exif-error): New error symbol, and adjust all error signalling to
only use that signal.
Eric Abrahamsen [Sun, 21 Apr 2019 18:04:20 +0000 (11:04 -0700)]
New option for making Gnus window layouts atomic
* lisp/gnus/gnus-win.el (gnus-use-atomic-windows): New boolean
customization option.
(gnus-configure-windows): When removing old window layouts, check
for and remove atomicity.
(gnus-configure-windows): When gnus-use-atomic-windows is non-nil,
make Gnus window layouts atomic.
* doc/misc/gnus.texi (Window Layout): Document.
Juri Linkov [Sat, 21 Sep 2019 23:00:01 +0000 (02:00 +0300)]
Support rectangular regions in capitalize-region and capitalize-dwim.
* lisp/simple.el (capitalize-dwim): Add arg region-noncontiguous-p
in capitalize-region call.
* src/casefiddle.c (Fcapitalize_region): Add arg region-noncontiguous-p.
If non-nil, operate on multiple chunks. (Bug#37477)
(Fdowncase_region): Use builtin symbol Qregion_extract_function
rather than calling intern.
Paul Eggert [Sat, 21 Sep 2019 18:27:46 +0000 (11:27 -0700)]
Revert too-picky file-access tests
Problem reported by Andreas Schwab (Bug#37475).
* doc/lispref/files.texi (Writing to Files)
(Testing Accessibility, Kinds of Files):
Document that accessibility and file-type predicates return nil
if there is trouble determining accessibility or type.
* etc/NEWS: Adjust, and list the affected primitives.
* src/callproc.c (init_callproc): Go back to Ffile_exists_p.
* src/fileio.c (PICKY_EACCES, file_test_errno):
Remove. All uses removed.
(Ffile_name_case_insensitive_p, Ffile_exists_p, Ffile_symlink_p)
(Ffile_directory_p, Ffile_regular_p): Document that these
functions return nil if there is trouble.
(Ffile_name_case_insensitive_p, check_file_access)
(Ffile_writable_p, Ffile_symlink_p, Ffile_directory_p)
(Ffile_accessible_directory_p, Ffile_regular_p)
* src/lread.c (Fload):
Go back to treating trouble in determining the answer as if the
file were missing.
* src/fileio.c (Ffile_newer_than_file_p): Use file_attribute_errno
not file_test_errno, since returning nil is not appropriate when
there are two files to test; e.g., in the rare cases where both
file timestamps have overflowed then neither t nor nil is correct.
* lisp/gnus/gnus-registry.el (gnus-registry-article-marks-to-chars):
(gnus-registry-article-marks-to-names): The registry is an object,
not a hash table.
* lisp/help-fns.el (describe-face): Move to here from faces.el and
split up (bug#36670).
(help-fns--face-custom-version-info):
(help-fns--face-attributes): Factored out into own functions.
(help-fns-describe-face-functions): New variable.
* lisp/auth-source.el (auth-source--deobfuscate): Use more
obfuscated obfuscation (bug#37196).
(auth-source--pad, auth-source--obfuscate)
(auth-source-netrc-normalize): Use it.
(auth-source-netrc-parse): Ditto.
Stefan Kangas [Mon, 16 Sep 2019 08:45:14 +0000 (10:45 +0200)]
Recommend against SHA-1 and MD5 for security
* doc/lispref/text.texi (Checksum/Hash):
* src/fns.c (Fmd5, Fsecure_hash):
* lisp/subr.el (sha1): Doc fix to recommend against SHA-1 and MD5 for
security-related applications, since they are not collision
resistant. (Bug#37420)
Change default value of message-make-forward-subject-function
* lisp/gnus/message.el (message-make-forward-subject-function): Change
default value to be a list so it's easier for users to add
functions. Change the type so the customize interface allows selecting
multiple provided functions instead of just one (bug#37470).
Michael Albinus [Fri, 20 Sep 2019 09:27:49 +0000 (11:27 +0200)]
Some Tramp methods allow to change the remote login shell
* doc/misc/tramp.texi (Inline methods) <sshx, plink, plinkx>:
(External methods) <scpx, pscp, psftp>: Mention, that the remote
login shell could be changed.
(Remote shell setup): Remove description of properties
"remote-shell-login" and "remote-shell-args", they don't matter
here. Changing the default remote shell works only for some
methods.
(Frequently Asked Questions): Refer to alternative approach fixing
zsh problems.
* etc/NEWS: Some Tramp methods allow to change the remote login shell.
* lisp/net/tramp-sh.el (tramp-default-remote-shell): New defconst.
(tramp-methods): Use it.
(tramp-get-sh-extra-args): New defun.
(tramp-open-shell, tramp-maybe-open-connection): Use it.
Eric Abrahamsen [Thu, 19 Sep 2019 17:36:42 +0000 (10:36 -0700)]
Only use Gnus registry for formatting when registry is loaded
See bug #36903
* lisp/gnus/gnus-registry.el (gnus-registry-article-marks-to-chars):
(gnus-registry-article-marks-to-names): In some circumstances it's
possible for the user's summary line format spec to include
registry-specific code, while the registry itself isn't actually
loaded. Make sure the database is actually a hashtable before
accessing it.
Eli Zaretskii [Thu, 19 Sep 2019 14:10:00 +0000 (17:10 +0300)]
Fix calls to insert-*-hooks when JIT font lock is active
* src/insdel.c (signal_after_change): Save and restore
interval_insert_behind_hooks and
interval_insert_in_front_hooks across calls to various other
hooks, to prevent their clobbering by those other hooks.
(Bug#37455)
* lisp/align.el (align-areas): When given a callback function and
JUSTIFY, pick out the correct parameters (bug#30139). Suggested
by "John Wiegley" <johnw@gnu.org>.
Paul Eggert [Thu, 19 Sep 2019 07:59:59 +0000 (00:59 -0700)]
Also prefer .emacs.d if .emacs exists
Problem reported by Katsumi Yamaoka (Bug#37456).
* lisp/startup.el (startup--xdg-or-homedot): Also
prefer .emacs.d if a traditional .emacs file exists.
Paul Eggert [Thu, 19 Sep 2019 06:53:46 +0000 (23:53 -0700)]
Omit some overenthusiastic file-truename calls
Problem reported by Tino Calancha (Bug#37445).
* src/emacs.c (init_cmdargs): Call file-truename only if
needed, i.e., if invocation-directory ends in "/i386/" on
WINDOWSNT.
* src/lread.c (readevalloop): If the sourcename is not
absolute, make it absolute. There is no need to convert
non-absolute files into truenames, since absolute files are
not converted into truenames.
(init_lread): Do not convert source-directory into a truename
at startup. There is no need to do so in a dumped Emacs since
an absolute file name suffices. The source directory might
not even exist any more, or might have been replaced by an
interloper who takes advantage of the truename calculation.
(syms_of_lread): Remove Qfile_truename; no longer needed.
Matt Bisson [Thu, 19 Sep 2019 06:48:43 +0000 (08:48 +0200)]
Fix ignored Motif scrollbar resources (Bug#37359)
* src/xterm.c (x_create_toolkit_scroll_bar): On Motif
scrollbars, "foreground" has no meaning, while "background"
means the truck and arrow colors, and "trough" means the
background of the entire widget. This fix hooks up the Emacs
scrollbar "foreground" color to the XmNbackground resource
and the "background" color to XmNtroughColor which is more in
line with how Xaw scrollbars behave.
Stephen Leake [Thu, 19 Sep 2019 00:42:30 +0000 (17:42 -0700)]
Enhance 'pcomplete/make' to complete on targets in included makefiles
* lisp/pcmpl-gnu.el (pcmpl-gnu-makefile-includes): New.
(pcmpl-gnu-make-targets): New, factored out of pcmpl-gnu-make-all-targets.
(pcmpl-gnu-make-includes): New.
(pcmpl-gnu-make-all-targets): Use new functions.
in isearch-lazy-highlight-timer to cancel it in lazy-highlight-cleanup.
(isearch-done): No need to set isearch-lazy-highlight-start to nil -
it used to reset lazy-highlight loop like isearch-lazy-highlight-window-start,
but now other packages set isearch-lazy-highlight-last-string to nil to reset
lazy-highlight loop.
Paul Eggert [Wed, 18 Sep 2019 12:17:03 +0000 (05:17 -0700)]
Out-of-datedness .elc check is merely a file test
* src/fileio.c (file_test_errno): Now extern.
* src/lread.c (Fload): Use file_test_errno instead,
since this is really just a file test (the attributes
are not given to the user).
Paul Eggert [Wed, 18 Sep 2019 11:21:19 +0000 (04:21 -0700)]
Be less picky about EACCES in file test predicates
Problem reported by Tino Calancha (Bug#37445) and others.
* src/fileio.c (PICKY_EACCES): New constant, false by default.
(file_test_errno): Ignore EACCES if not picky.
(check_file_access): Investigate EACCES problems further
if picky.
Paul Eggert [Wed, 18 Sep 2019 02:18:14 +0000 (19:18 -0700)]
Improve reporting of I/O, access errors
Signal an error for file-oriented errors that are not tame
errors like ENOENT and ENOTDIR (Bug#37389).
Do this for primitives exposed to Lisp; the lower
level internal C API merely makes errno values available
to higher-level C code.
* doc/lispref/files.texi (Testing Accessibility)
(File Attributes, Extended Attributes): Do not say that the
functions return nil when the return value cannot be determined.
* etc/NEWS: Mention the change.
* src/dired.c (Ffile_attributes): Fix doc string confusion
about opening a file vs getting its attributes.
(file_attributes): Signal serious errors.
* src/fileio.c (check_existing, check_executable)
(check_writable): Remove. All callers changed to use
check_file_access or file_access_p.
(file_access_p, file_metadata_errno, file_attribute_errno)
(file_test_errno, check_file_access, check_emacs_readlinkat):
New functions.
* src/fileio.c (Ffile_executable_p, Ffile_readable_p)
(Ffile_name_case_insensitive_p, Frename_file, Ffile_exists_p):
(Ffile_symlink_p, Ffile_directory_p)
(Ffile_accessible_directory_p, Ffile_regular_p)
(Ffile_selinux_context, Ffile_acl, Ffile_modes)
(Ffile_newer_than_file_p, Fset_visited_file_modtime)
(Ffile_system_info):
* src/filelock.c (unlock_file, Ffile_locked_p):
* src/lread.c (Fload):
Signal serious errors.
* src/fileio.c (Ffile_writable_p): Remove unnecessary CHECK_STRING.
(emacs_readlinkat): Now static.
* src/filelock.c (current_lock_owner, lock_if_free): Return a
positive errno on error, and the negative of the old old value
on success. All callers changed.
* src/lread.c (openp): Propagate serious errno values to caller.
See https://lists.gnu.org/archive/html/emacs-devel/2019-09/msg00364.html
* lisp/replace.el(perform-replace): Rename variable
to next-replacement-replaced.
Eli Zaretskii [Tue, 17 Sep 2019 11:19:54 +0000 (14:19 +0300)]
Improve font lookup on MS-Windows
* src/w32font.c (struct font_callback_data): New member
'known_fonts'.
(w32font_list_internal, w32font_match_internal): Set up
match_data.known_fonts if the font spec includes :script that
names one of the non-USB scripts.
(add_font_entity_to_list): If font_matches_spec returns zero
for a font, and we have some fonts in match_data->known_fonts,
consider the font to be a match if it is named in known_fonts.
(font_supported_scripts): Update the Unicode Subranges. In
particular, map bit 74 to 'burmese', as this is the name Emacs
uses, not 'myanmar'. Add a list of scripts that have no USBs
defined for them.
(syms_of_w32font) <Qburmese, Qcuneiform_numbers_and_punctuation>
<Qaegean_number, Qw32_non_USB_fonts>: New symbols.
* lisp/term/w32-win.el (w32-no-usb-subranges): New defconst.
(w32--filter-USB-scripts, w32-find-non-USB-fonts): New functions.
(w32-non-USB-fonts): New defvar.
* lisp/international/fontset.el (setup-default-fontset): Add
more scripts to automatic setup by representative characters.
* doc/emacs/msdos.texi (Windows Fonts): Document
'w32-find-non-USB-fonts' and 'w32-non-USB-fonts'.
* etc/NEWS: Mention 'w32-find-non-USB-fonts' and
'w32-non-USB-fonts'.