1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-02 08:22:22 +00:00
Commit Graph

140863 Commits

Author SHA1 Message Date
Mattias Engdegård
7839390f27 Quote semanticdb-ebrowse-default-file-name in regexp
Noticed by Andreas Schwab.

* lisp/cedet/semantic/db-ebrowse.el (semanticdb-load-ebrowse-caches):
Quote file name in regexp.
2020-04-16 12:14:38 +02:00
Mattias Engdegård
905c0a13f7 Fix bugs, inefficiencies and bad style in regexps
Found by relint.  See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00265.html

* lisp/org/org-table.el (org-table-finish-edit-field):
* lisp/arc-mode.el (archive-rar-summarize):
Avoid wrapped subsumption in repeated sequences.
* lisp/erc/erc-dcc.el (erc-dcc-ctcp-query-send-regexp): Replace
inefficient repeated empty-matching expression with a plain greedy
form.
(erc-dcc-handle-ctcp-send): Adjust group numbers.
* lisp/net/puny.el (puny-encode-domain): Fix fast-path shortcut
pattern so that it actually works as intended.
* lisp/progmodes/gdb-mi.el (gdb-control-commands-regexp):
* lisp/vc/diff-mode.el (diff-imenu-generic-expression):
Remove superfluous backslashes.
* lisp/progmodes/scheme.el (scheme-imenu-generic-expression):
Correct confused definition-matching pattern which would match more
than intended.
* lisp/textmodes/sgml-mode.el (sgml-tag-name-re): Avoid inefficient
matching by using the fact that the first character cannot match the
last char of sgml-name-re.
2020-04-16 12:14:38 +02:00
Mattias Engdegård
01436fddfb Regularise some file-matching regexps
* admin/authors.el (authors-obsolete-files-regexps)
(authors-renamed-files-regexps): Replace ^ and $ with \` and \'.
2020-04-16 12:14:37 +02:00
Eli Zaretskii
c77d6af1dd Avoid compiler warning in indent.c
* src/indent.c (Fvertical_motion): Avoid compilation warning.
Reported by Juanma Barranquero <lekktu@gmail.com>.
2020-04-16 13:08:01 +03:00
Eli Zaretskii
82c1d15093 ; * src/w32image.c (w32_select_active_frame): Comment about GUID values. 2020-04-16 12:52:35 +03:00
Eli Zaretskii
490f279c7e File-handling cleanup in w32image.c
* src/w32image.c (w32_load_image): Encode the image file name and
convert it via 'map_w32_filename'.  No need to do anything special
when 'w32_unicode_filenames' is zero, since file names are in
UTF-8 internally, and this code will never run on Windows 9X.
* src/w32.h (map_w32_filename): Add prototype; removed prototypes
from all *.c files.
2020-04-16 09:14:07 +03:00
Eli Zaretskii
e16374507f Fix retrieval of frame delay when using GDI+
* src/w32image.c (enum PropertyItem_type): New enumeration.
(decode_delay): New function.
(w32_frame_delay): Call 'decode_delay' to retrieve the frame delay
from image data.
2020-04-15 23:15:03 +03:00
Glenn Morris
97e48510ad Merge from origin/emacs-27
a5f7c26907 (origin/emacs-27) * admin/authors.el: Add an author alias.
d87a4d1f4e Limit RLIMIT_NOFILE to FD_SETSIZE on macOS
e5ca8e5e73 Fix Elisp manual entry on 'set-window-configuration'
485f24223f ; Update ChangeLog.3
8f200254fb ; Update etc/AUTHORS
c7adc851ad * admin/authors.el: Add missing author aliases.
4acdd7fe58 Fix edge case errors in filename-matching regexps
5f36e21fe5 Clarify the doc string of 'yank'
13301d4266 New function erc-track-switch-buffer-other-window
38f7538d8f New function erc-switch-to-buffer-other-window

# Conflicts:
#	etc/NEWS
2020-04-15 07:50:15 -07:00
Eli Zaretskii
afa542c914 Fix small glitches in documenting the native image API feature
* etc/NEWS: Fix wording of the entry for native image API support.
Reported by Juanma Barranquero <lekktu@gmail.com>.

* configure.ac (native-image-api): Fix the "--help" description.
2020-04-15 16:54:38 +03:00
Eli Zaretskii
bedb3cb665 Avoid infloop in redisplay when wrap-prefix is too wide
* src/xdisp.c (move_it_to): Avoid infloop due to wrap-prefix that
is wide enough to leave no space to display even the first
character of the continuation line.  (Bug#40632)
2020-04-15 14:28:21 +03:00
Nicolas Petton
a5f7c26907
* admin/authors.el: Add an author alias. 2020-04-15 13:22:44 +02:00
YAMAMOTO Mitsuharu
d87a4d1f4e Limit RLIMIT_NOFILE to FD_SETSIZE on macOS
* src/nsterm.m ([EmacsApp applicationDidFinishLaunching:]): Call
CoreFoundation functions that increase RLIMIT_NOFILE behind our back
during startup, and then set RLIMIT_NOFILE back to FD_SETSIZE to avoid
crashes in setup_process_coding_system  (Bug#39164).
2020-04-15 11:55:16 +02:00
Martin Rudalics
e5ca8e5e73 Fix Elisp manual entry on 'set-window-configuration'
* doc/lispref/windows.texi (Window Configurations): Fix
description of 'set-window-configuration'.
2020-04-15 10:18:15 +02:00
Stefan Monnier
72fc8ec6dd * lisp/htmlfontify.el: Use font-lock-ensure unconditionally
Remove redundant `:group`s.

(hfy-force-fontification): Make it an obsolete alias for `font-lock-ensure`.
Update all callers.
(hfy-init-kludge-hooks, hfy-init-kludge-hook): Remove vars, not used any more.
(hfy-kludge-cperl-mode): Declare it obsolete.
2020-04-15 00:23:32 -04:00
Eli Zaretskii
26df9aae53 Avoid compiler warning in image.c
* src/image.c (image_can_use_native_api): Avoid compiler warnings
by making this function conditioned on HAVE_NATIVE_IMAGE_API.
(initialize_image_type): Call image_can_use_native_api only if
HAVE_NATIVE_IMAGE_API is non-zero.  Reported by Basil
L. Contovounesios <contovob@tcd.ie>.
2020-04-14 22:22:07 +03:00
Nicolas Petton
485f24223f
; Update ChangeLog.3 2020-04-14 18:34:30 +02:00
Nicolas Petton
8f200254fb
; Update etc/AUTHORS 2020-04-14 18:33:50 +02:00
Nicolas Petton
c7adc851ad
* admin/authors.el: Add missing author aliases. 2020-04-14 18:33:28 +02:00
Eli Zaretskii
6bf79d65d3 ; * src/image.c: Cleanup of #ifdef's related to HAVE_NATIVE_IMAGE_API. 2020-04-14 18:19:59 +03:00
Eli Zaretskii
e94206aaf6 Make use of MS-Windows native image API be selectable at run time
* configure.ac: Minor cleanup in how w32image.o is added to the
build when native image APIs are requested.

* src/w32gui.h (w32_load_image, w32_can_use_native_image_api)
(w32_gdiplus_shutdown): Move prototypes from w32term.h here, since
w32.c doesn't include w32term.h.
* src/image.c (struct image_type): No need to pass TYPE to the
'valid_p' method.  All callers changed.
(initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
'image_can_use_native_api' before trying image-specific methods.
(image_can_use_native_api): New function.
(image_types): Remove the native_image_type parts.
(syms_of_image): New symbol 'native-image'.
(parse_image_spec): Accept native-image "type" for any image type.
* src/w32term.c (syms_of_w32term): New variable
'w32-use-native-image-API'.
* src/w32image.c: (w32_can_use_native_image_api): New function.
(gdiplus_init): Rename from w32_gdiplus_startup. Simplify code.
Move the call to GdiplusStartup to a separate function.  Use
ordinal number for SHCreateMemStream if cannot load it by name.
(w32_load_image): Ignore Win32Error status from
w32_select_active_frame.
Move DEFSYMs from here...
* src/image.c (syms_of_image) [HAVE_NATIVE_IMAGE_API]: ...to here.

* etc/NEWS: Update the entry about native image API use.
2020-04-14 18:10:41 +03:00
Mattias Engdegård
4acdd7fe58 Fix edge case errors in filename-matching regexps
These changes fix actual or latent bugs in regexps that match
file names, such as PATTERN arguments to 'directory-files'.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00265.html

* admin/authors.el (authors-obsolete-files-regexps)
(authors-renamed-files-regexps):
* lisp/auth-source-pass.el (auth-source-pass-entries):
* lisp/calendar/todo-mode.el (todo-show, todo-find-filtered-items-file)
(todo-filter-items, todo-reset-nondiary-marker, todo-reset-done-string)
(todo-reset-comment-string, todo-reset-highlight-item):
* lisp/cedet/semantic/db-ebrowse.el (semanticdb-load-ebrowse-caches):
* lisp/cedet/semantic/texi.el (semantic-texi-associated-files):
* lisp/cedet/srecode/map.el (srecode-map-update-map):
* lisp/dired.el (dired-re-no-dot):
* lisp/emacs-lisp/autoload.el (update-directory-autoloads):
* lisp/emacs-lisp/shadow.el (load-path-shadows-find):
* lisp/files.el (auto-mode-alist, directory-files-no-dot-files-regexp):
* lisp/finder.el (finder-compile-keywords):
* lisp/generic-x.el (inetd-conf-generic-mode, named-boot-generic-mode)
(resolve-conf-generic-mode, etc-modules-conf-generic-mode):
* lisp/gnus/gnus-agent.el (gnus-agent-read-agentview)
(gnus-agent-regenerate-group, gnus-agent-update-files-total-fetched-for):
* lisp/gnus/gnus-cache.el (gnus-cache-articles-in-group):
* lisp/gnus/gnus-score.el (gnus-score-search-global-directories):
* lisp/gnus/gnus-util.el (gnus-delete-directory):
* lisp/gnus/gnus-uu.el (gnus-uu-dir-files):
* lisp/gnus/nndraft.el (nndraft-request-group):
* lisp/gnus/nnmh.el (nnmh-request-group, nnmh-request-create-group):
(nnmh-request-delete-group, nnmh-active-number, nnmh-update-gnus-unreads):
* lisp/gnus/nnspool.el (nnspool-request-group):
* lisp/gnus/spam-stat.el (spam-stat-process-directory)
(spam-stat-test-directory):
* lisp/help-fns.el (help-fns--first-release):
* lisp/help.el (view-emacs-news):
* lisp/international/quail.el (quail-update-leim-list-file):
* lisp/international/titdic-cnv.el (batch-titdic-convert):
* lisp/mail/mspools.el (mspools-set-vm-spool-files)
(mspools-get-spool-files):
* lisp/mail/rmail.el (rmail-secondary-file-regexp)
(rmail-speedbar-match-folder-regexp):
* lisp/net/ange-ftp.el (ange-ftp-delete-directory):
* lisp/net/tramp.el (tramp-use-absolute-autoload-file-names):
* lisp/obsolete/gulp.el (gulp-send-requests):
* lisp/obsolete/vc-arch.el (vc-arch-trim-revlib):
* lisp/org/ob-core.el (org-babel-remove-temporary-directory):
* lisp/progmodes/ebnf2ps.el (ebnf-file-suffix-regexp, ebnf-style-database):
* lisp/progmodes/executable.el (executable-command-find-posix-p):
* lisp/startup.el (command-line):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/url/url-about.el (url-probe-protocols):
* lisp/vc/vc-rcs.el (vc-rcs-register, vc-rcs-unregister):
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test19-directory-files-and-attributes):
* test/lisp/net/tramp-tests.el (tramp-test19-directory-files-and-attributes):
Replace ^ and $ with \` and \', respectively.
Use (rx (or (not ".") "...")), translated into "[^.]\\|\\.\\.\\.",
to match anything but "." and "..", instead of several incorrect
regexps.
2020-04-14 12:25:16 +02:00
Juan José García-Ripoll
df254a7445 Initial version of native image API support for MS-Windows
* src/w32image.c: New file.
* src/w32term.h: Add prototypes of 'w32_load_image',
'w32_gdiplus_startup', 'w32_gdiplus_shutdown', and
'w32_query_frame_background_color'.
* src/w32term.c (w32_query_frame_background_color): No longer
static.
* src/w32.c (term_ntproc) [HAVE_GDIPLUS]: Call
'w32_gdiplus_shutdown'.
* src/image.c (struct image_type) <valid_p>: Accept an additional
argument, the image type.  All implementations changed.
(init_native_image_functions, native_image_p, native_image_load)
[HAVE_NATIVE_IMAGE_API]: New methods for "native image type".
(initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
'init_native_image_functions'.
(image_types) [HAVE_NATIVE_IMAGE_API]: Add settings for native
image API.
(lookup_image_type) [HAVE_NATIVE_IMAGE_API]: Initialize native
functions if needed.

* lisp/term/w32-win.el (dynamic-library-alist): Add gdiplus and
shlwapi.

* etc/NEWS: Announce the new feature.

* configure.ac (native-image-api): New option, OFF by default.
(HAVE_NATIVE_IMAGE_API): If native-image-api is selected, add
w32image.o to W32_OBJ.
2020-04-14 09:52:55 +03:00
Eli Zaretskii
5f36e21fe5 Clarify the doc string of 'yank'
* lisp/simple.el (yank): Mention 'current-kill' in the doc string,
so that people could find all the gory details of what is "the most
recent kill" for this purpose.  (Bug#40375)
2020-04-14 08:38:00 +03:00
Amin Bandali
13301d4266
New function erc-track-switch-buffer-other-window
* lisp/erc/erc-track.el (erc-track-switch-buffer): Factor out the
implementation from here ...
(erc-track--switch-buffer): ... to here.
(erc-track-switch-buffer-other-window): New function, like
`erc-track-switch-buffer', but uses `switch-to-buffer-other-window'
instead, to open the buffer in another window.
2020-04-14 00:23:56 -04:00
Amin Bandali
38f7538d8f
New function erc-switch-to-buffer-other-window
* lisp/erc/erc.el (erc-switch-to-buffer): Factor out the buffer choice
implementation from here ...
(erc--switch-to-buffer): ... to here.
(erc-switch-to-buffer-other-window): New function, like
`erc-switch-to-buffer', but uses `switch-to-buffer-other-window'
instead, to open the buffer in another window.
2020-04-13 23:35:34 -04:00
Juri Linkov
7a9fb5d55c Fix hi-lock test and add new test for unhighlight (bug#40337)
* lisp/hi-lock.el (hi-lock-unface-buffer): Use hi-lock--hashcons
only on strings, not lists.

* test/lisp/hi-lock-tests.el (hi-lock-bug26666): Revert previous change,
use "a" instead of "b".
(hi-lock-unhighlight): New test.
2020-04-14 02:33:52 +03:00
Juri Linkov
086faceb1c * lisp/vc/vc.el (vc-deduce-fileset): Improve docstring (bug#34949). 2020-04-14 02:24:51 +03:00
Glenn Morris
cdbb37f628 Merge from origin/emacs-27
f84aed5fd2 (origin/emacs-27) Clarify documentation on inhibit-modific...
2020-04-13 09:02:29 -07:00
Glenn Morris
584ff8c2dc ; Merge from origin/emacs-27
The following commit was skipped:

81d07da788 gnus-shorten-url: Improve and avoid args-out-of-range error
2020-04-13 09:02:29 -07:00
Glenn Morris
0a4b992c42 Merge from origin/emacs-27
1dfc497fac Minor wording change in Introduction to Programming in Ema...
ff09b4eeac Fix 'flymake-show-diagnostics-buffer' when line numbers ar...
63e8d0ea87 Fix last changes describing mail commands
01212a762f Do setup Flymake in file-less Elisp buffers
36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995)
3f9310b0fe Fix and improve documentation of mail-related features
1482a75efa Fix build failure with Fx_gtk_debug
cf57663f2a Mention jit-lock deferred as an alternative to fast-but-im...

# Conflicts:
#	etc/NEWS
2020-04-13 09:02:29 -07:00
Glenn Morris
d0b9cf876f * doc/lispref/processes.texi (Network): Fix xref usage. 2020-04-13 09:01:45 -07:00
Glenn Morris
3b4def8e60 * doc/emacs/msdos.texi (Windows Keyboard): Fix xref. 2020-04-13 08:59:05 -07:00
Albert
9c6392c358 Fix previous change in w32fns.c
* src/w32fns.c (w32_msg_pump): Simplify by not calling
ImmGetOpenStatus.
(Fw32_get_ime_open_status): Fix a typo.
2020-04-13 18:31:35 +03:00
Eli Zaretskii
fc336a4655 Document the new 'w32-get/set-ime-open-status' functions
* doc/emacs/msdos.texi (Windows Keyboard): Document
'w32-set-ime-open-status'.

* etc/NEWS: Announce the new IME-related functions.
2020-04-13 16:33:57 +03:00
Eli Zaretskii
61da72dc2d ; Fix last change. 2020-04-13 16:20:14 +03:00
Albert
c6ecdab0ee Support toggling native Input Methods on MS-Windows
* src/w32term.h (WM_EMACS_IME_STATUS): New message code.

* src/w32fns.c (ImmGetOpenStatus_Proc, ImmSetOpenStatus_Proc): New
typedefs.
(w32_msg_pump): Handle the WM_EMACS_IME_STATUS message.
(Fw32_get_ime_open_status, Fw32_set_ime_open_status): New functions
(syms_of_w32fns): Defsubr them.
(globals_of_w32fns): Load ImmGetOpenStatus and ImmSetOpenStatus
from IMM2.DLL.
2020-04-13 16:07:19 +03:00
Štěpán Němec
f84aed5fd2 Clarify documentation on inhibit-modification-hooks intended usage
Cf. bug#40332 and the discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00921.html

* doc/lispref/text.texi (Change Hooks):
* src/insdel.c (syms_of_insdel): Clarify the intended usage of
'inhibit-modification-hooks'.
2020-04-13 12:15:13 +02:00
Štěpán Němec
188bd80a90 gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:

  (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40)
  ;; => Lisp error: (args-out-of-range "/path/and" -18 nil)

This commit makes it account for #fragments and fixes faulty string
computation, reusing existing helper function.  (bug#39980)

* lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to
'string-truncate-left' and move...
* lisp/emacs-lisp/subr-x.el (string-truncate-left):  ...here.
All callers changed.
* lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range
error, don't drop #fragments, use 'string-truncate-left'.
2020-04-13 12:12:00 +02:00
Štěpán Němec
81d07da788 gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:

  (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40)
  ;; => Lisp error: (args-out-of-range "/path/and" -18 nil)

This commit makes it account for #fragments and fixes faulty string
computation.  (bug#39980)

Do not merge to master, where the helper is put to subr-x.el.

* lisp/gnus/gnus-sum.el (gnus--string-truncate-left): New helper
function (copied from 'ediff-truncate-string-left').
(gnus-shorten-url): Use it and don't drop #fragments.
2020-04-13 12:03:38 +02:00
Eli Zaretskii
c395ebaf21 Fix last change
* lisp/mail/rmail.el (rmail-simplified-subject): A prefix can have
up to 4 characters, not 3.
2020-04-13 12:25:37 +03:00
Eli Zaretskii
1dfc497fac Minor wording change in Introduction to Programming in Emacs Lisp
* doc/lispintro/emacs-lisp-intro.texi (Prevent confusion): Mention
that dynamic scoping is only the default in Emacs Lisp, not the
only scoping rule.  (Bug#40594)
2020-04-13 11:53:47 +03:00
Eli Zaretskii
49f2811f78 Improve support of "Re:" in Rmail
* lisp/mail/rmail.el (rmail-simplified-subject)
(rmail-reply-regexp): Recognize U+FF1A FULLWIDTH COLON as a colon
after "Re:"-type prefixes.
(rmail-re-abbrevs): New defcustom with localized abbreviations of
"Re:".
(rmail-reply-regexp): Use 'rmail-re-abbrevs'.  Recognize U+FF1A
in addition to the ASCII colon.

* etc/NEWS: Call out the new defcustom 'rmail-re-abbrevs'.
2020-04-13 11:43:39 +03:00
Eli Zaretskii
ff09b4eeac Fix 'flymake-show-diagnostics-buffer' when line numbers are displayed
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
Do nothing if 'flymake--diagnostics-buffer-source' is not a
buffer.  (Bug#40529)
2020-04-13 08:00:14 +03:00
Juri Linkov
91e4acf7c7 Fix hi-lock test and add new test for case-fold (bug#40337)
* lisp/hi-lock.el (hi-lock--regexps-at-point): Handle font-lock faces.
(hi-lock-unface-buffer): Simplify default value handling.
(hi-lock-set-pattern): Add either lighter or regexp to
hi-lock-interactive-lighters.
(hi-lock-set-pattern): Put overlay prop hi-lock-overlay-regexp to
either lighter or regexp.

* test/lisp/hi-lock-tests.el (hi-lock-bug26666): Use "b" instead of "a".
(hi-lock-case-fold): New test.
2020-04-13 02:40:56 +03:00
Štěpán Němec
68ffe4a3c9 Fix bootstrap compiler warnings about `read-library-name'
Introduced by

2020-03-28T22:16:28+01:00!stepnem@gmail.com
2c45091791 (load-library, locate-library: Use read-library-name)

Thanks to Juanma Barranquero <lekktu@gmail.com> for reporting.

* lisp/files.el:
* lisp/subr.el: Declare 'read-library-name'.
2020-04-12 22:41:32 +02:00
Eli Zaretskii
63e8d0ea87 Fix last changes describing mail commands
* doc/emacs/sending.texi (Sending Mail): Fix the description of
the behavior of 'C-x m' without prefix argument.  (Bug#40561)
2020-04-12 21:47:52 +03:00
Philipp Stephani
42306747d8 Fix error in 'call-process-region' when START is nil (Bug#40576)
* src/callproc.c (Fcall_process_region): Fix behavior when START is
nil and DELETE is non-nil.

* test/src/callproc-tests.el
(call-process-region-entire-buffer-with-delete): New unit test.
2020-04-12 19:04:11 +02:00
Philipp Stephani
900947fbe8 ; * test/src/callproc-tests.el: Fix checkdoc errors. 2020-04-12 18:08:35 +02:00
João Távora
01212a762f Do setup Flymake in file-less Elisp buffers
Fixes: bug#40573

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Change
condition for setting flymake-diagnostic-functions.
2020-04-12 15:17:15 +01:00
Philipp Stephani
36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995)
* lisp/emacs-lisp/cl-macs.el (cl-struct-unknown-slot): Remove spurious
format specifiers.
2020-04-12 15:12:16 +02:00