Andrea Corallo
fd8dd75a71
Make input constraints into memoization hash immutable (bug#45376)
...
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1)
(comp-cstr-intersection): Copy input before soting it into the
memoization hash table.
2020-12-23 10:58:42 +01:00
Andrea Corallo
2a22fa8b68
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-copy): Tweak for perf.
2020-12-23 10:58:20 +01:00
Juri Linkov
268a3d32fb
Show image as text when trying to search/replace in image buffer (bug#25905)
...
* lisp/image-mode.el (image-mode-isearch-filter): New function.
(image-mode--setup-mode): Use it to add it as :before-while to
isearch-filter-predicate.
2020-12-23 11:30:04 +02:00
Lars Ingebrigtsen
5c86a53296
Improve the string-limit doc string
...
* lisp/emacs-lisp/subr-x.el (string-limit): Mention
truncate-string-to-width in the doc string.
2020-12-23 07:59:24 +01:00
Lars Ingebrigtsen
22c1f00d99
Allow string-slice to take zero-length matches
...
* lisp/emacs-lisp/subr-x.el (string-slice): Allow zero-length
matches. Code adapted from s.el by Magnar Sveen.
2020-12-23 07:45:19 +01:00
Lars Ingebrigtsen
21097cdd32
Revert recent server.el frame-focus changes
...
* lisp/server.el (server-switch-buffer, server-execute): Revert
9cef8fc8cd and
c5f2eb56c0 . This change led to
regressions in non-new-frame circumstances.
2020-12-23 06:58:12 +01:00
Łukasz Stelmach
1e11f6f59d
Handle gracefully href="" in base tags in shr
...
* net/shr.el (shr-tag-base): shr-parse-base can't handle empty
strings gracefully. Don't call it unless href is a non-empty
string (bug#45355).
2020-12-23 06:26:06 +01:00
Stefan Kangas
832d756893
Fix use of obsolete 'emergency' warning level
...
* src/alloc.c (display_malloc_warning): Use new style ':emergency'
warning level instead of obsolete 'emergency'.
2020-12-23 05:16:02 +01:00
Zajcev Evgeny
a649869d04
Fix use of obsolete 'error' warning level
...
* src/fileio.c (auto_save_error): Use new style ':error' warning level
instead of obsolete 'error'.
2020-12-23 04:58:48 +01:00
Alan Third
747a923b9a
Use new NSString lisp methods
...
* src/nsfont.m (ns_otf_to_script):
(ns_registry_to_script):
(ns_get_req_script): Use NSString conversion methods.
* src/nsimage.m ([EmacsImage allocInitFromFile:]): Use NSString
conversion methods.
* src/nsmenu.m (ns_menu_show): Use NSString conversion methods.
* src/nsselect.m (symbol_to_nsstring):
(ns_string_to_pasteboard_internal): Use NSString conversion methods.
* src/nsterm.m (ns_term_init):
([EmacsView initFrameFromEmacs:]): Use NSString conversion methods.
* src/nsxwidget.m (nsxwidget_webkit_uri):
(nsxwidget_webkit_title):
(js_to_lisp): Use NSString conversion methods.
(build_string_with_nsstr): Functionality replaced by NSString
extensions.
2020-12-22 23:31:56 +00:00
Liāu, Kiong-Gē 廖宮毅
433ae7b0a5
Fix --with-nativecomp Windows build (bug#45303)
...
Liāu, Kiong-Gē 廖宮毅 <gongyi.liao@gmail.com>
* src/comp.c (eln_load_path_final_clean_up): Fix argument order.
* nt/mingw-cfg.site (ac_cv_func_strsignal): Force
`ac_cv_func_strsignal' to no.
Copyright-paperwork-exempt: yes
2020-12-22 21:06:16 +01:00
Alan Mackenzie
6af31fd71f
Align the word "Function" in profiler's headers over the actual functions
...
* lisp/profiler.el (profiler-report-render-calltree-1): Replace two
occurrences of "Function" with " Function".
2020-12-22 18:34:24 +00:00
Eric Abrahamsen
aae44a36f3
Ensure that Gnus servers are open(able) before searching them
...
* lisp/gnus/gnus-search.el (gnus-search-run-search): Imap servers need
to be opened (made into the "current server") before we manipulate the
nnimap-buffer.
(gnus-search-run-search): Sneakily fix regexp.
(gnus-search-indexed-parse-output): We need to pass the server name in
here, otherwise nnmaildir won't know how to make this the "current
server".
2020-12-22 09:01:25 -08:00
Alan Mackenzie
9449b81f27
Align profiler's header-line-format to column 0, to work correctly on tty's
...
* lisp/profiler.el (profiler-report-header-line-format): Propertize the first
space with 'display '(space :align-to 0).
2020-12-22 16:57:46 +00:00
Alan Mackenzie
9920929e7b
Re-order the items in `profiler-report' output.
...
Putting the usage figures first on the line will eliminate the truncation of
function names.
lisp/profiler.el (profiler-version): Change to "28.1".
(profiler-format): Enhance, so that a width of zero means print the string
without padding or truncation.
(profiler-report-cpu-line-format, profiler-report-memory-line-format): Amend
for the new layout. The number of places for the cpu samples has been reduced
from 19 to 12 (enough for ~30 years at 1,000 samples per second).
(profiler-report-line-format, profiler-report-describe-entry): Amend for the
new order of arguments to profiler-format.
etc/NEWS (Specialized Modes): Add an entry documenting this change.
doc/lispref/debugging.texi (Profiling): Describe the new ordering of the items
in place of the old ordering.
2020-12-22 12:06:21 +00:00
Michael Albinus
188b09d6d9
Reorganize Tramp header lines
...
* lisp/net/tramp.el: Move header lines Version, Package-Requires,
Package-Type and URL ...
* lisp/net/trampver.el: ... here.
2020-12-22 12:13:37 +01:00
Bastien Guerry
7f8793e5f1
Update to Org 9.4.4
2020-12-22 10:29:37 +01:00
Basil L. Contovounesios
e42a63a960
; Fix docstrings in last change to subr-x.el
2020-12-22 09:01:47 +00:00
Daniel Martín
9015329678
Fix wdired-get-filename when ls -F marks symlinks
...
* lisp/wdired.el (wdired-get-filename): In some systems like BSD or
macOS, "ls -F" marks symlinks with a trailing "@". Add logic
accounting for this so that wdired-get-filename returns the correct
filename. This change also fixes test "wdired-test-bug34915" on macOS
and BSD systems (bug#34915).
2020-12-22 07:36:41 +01:00
Lars Ingebrigtsen
051d8f7535
Make string-pad take an optional START parameter
...
* lisp/emacs-lisp/subr-x.el (string-pad): Alter the calling
convention.
2020-12-22 06:59:25 +01:00
Lars Ingebrigtsen
9480169f1b
Change the string-limit parameter semantics
...
* lisp/emacs-lisp/subr-x.el (string-limit): Alter the calling
convention.
2020-12-22 06:54:32 +01:00
Lars Ingebrigtsen
d2b8611862
Further string-clean-whitespace tweaks
...
* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Put \r
back, which was mistakenly removed.
2020-12-22 04:24:25 +01:00
Dmitry Gutov
c69c65676d
(ruby-mode-set-encoding): Use 'save-restriction'
...
* lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
Use 'save-restriction' (bug#45349).
2020-12-22 03:15:45 +02:00
Basil L. Contovounesios
27fab4b140
Tiny string-clean-whitespace simplification
...
* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Streamline by
treating replacement string as being literal and having fixed case.
2020-12-21 22:36:55 +00:00
Lars Ingebrigtsen
7e86d3bb9b
Make string-chop-newline more efficient
...
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more
efficient.
2020-12-21 23:18:05 +01:00
Lars Ingebrigtsen
768522750d
Make string-clean-whitespace work on non-ASCII whitespace, too
...
* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Also clean
up non-ASCII whitespace.
2020-12-21 22:41:37 +01:00
Lars Ingebrigtsen
c9a95237a8
Add try-completion to the string shortdoc
...
* lisp/emacs-lisp/shortdoc.el (string): Mention try-completion here.
2020-12-21 22:08:56 +01:00
Lars Ingebrigtsen
f329a3180e
Add string-chop-newline
...
* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Add new function.
2020-12-21 22:05:37 +01:00
Basil L. Contovounesios
e967ba3018
; Fix recent string utility additions
...
* etc/NEWS: Fix typo.
* lisp/emacs-lisp/subr-x.el (string-limit): Fix typos in docstring.
Simplify.
(string-slice): Improve docstring wording.
(string-pad): Simplify.
2020-12-21 20:51:29 +00:00
Lars Ingebrigtsen
fd9431dde4
Fix shorter-than-length case for string-limit
...
* lisp/emacs-lisp/subr-x.el (string-limit): Fix
shorter-than-length case.
2020-12-21 20:42:17 +01:00
Andrea Corallo
9676e4d776
* Fix a test in auth-source-tests.el
...
* test/lisp/auth-source-tests.el
(auth-source-test-secrets-create-secret): Redefine `read-string'
respecting the original number of arguments.
2020-12-21 20:22:03 +01:00
Andrea Corallo
ebf8963a91
* Fix a bunch of known type specifiers
...
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fixes for:
=, string-search, substring.
2020-12-21 20:22:03 +01:00
Andrea Corallo
5376563517
Fix `comp-add-call-cstr' and add a test
...
* lisp/emacs-lisp/comp.el (comp-add-call-cstr): Fix it.
* test/src/comp-tests.el (assume-in-loop-1): New test.
* test/src/comp-test-funcs.el (comp-test-assume-in-loop-1-f): New
function.
2020-12-21 20:22:03 +01:00
Andrea Corallo
6f3570cd4a
Fix value type inference for doubly negate constraints
...
* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Do not propagate in
case of double negation.
* test/src/comp-test-funcs.el (comp-test-assume-double-neg-f):
New function.
* test/src/comp-tests.el (assume-double-neg): New test.
2020-12-21 20:22:03 +01:00
Andrea Corallo
9bbe6eab6c
Fix native compiler tests when they are bytecompiled
...
* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-ts)
(comp-cstr-typespec-test, comp-cstr-typespec-tests-alist): Eval
also at compile time.
* test/src/comp-tests.el (comp-tests-type-spec-tests)
(comp-tests-define-type-spec-test): Likewise.
2020-12-21 20:22:03 +01:00
Andrea Corallo
e0f20da6ec
Simplify correctly (or (integer 1 1) (not (integer 1 1))) as t
...
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Logic
update.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
2020-12-21 20:22:03 +01:00
Andrea Corallo
3540b1f167
* Guarantee fwprop convergence and termination
...
* lisp/emacs-lisp/comp.el (comp-emit-call-cstr): Have new-mvar as
LHS *and* RHS when constraining in and to ensure monotonicity and
fwprop convergence.
(comp-fwprop): Raise a warning for debug reasons in case fwprop
does not converge within 100 iterations.
2020-12-21 20:22:03 +01:00
Andrea Corallo
c70c08013f
* Allow for overlapping src and dst in cstr set operations
...
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem)
(comp-cstr-union-1, comp-cstr-intersection-no-mem)
(comp-cstr-intersection): Logic update.
2020-12-21 20:22:03 +01:00
Andrea Corallo
8e816b0ad5
Symplify type specifier (not t) as nil
...
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
Add logic.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests.
2020-12-21 20:22:03 +01:00
Andrea Corallo
07b75deea9
Enhance type inference constraining function arguments
...
* lisp/emacs-lisp/comp.el: Add some commentary.
(comp-cond-cstrs-target-mvar): Rename and update docstring.
(comp-add-cond-cstrs): Update to use
`comp-cond-cstrs-target-mvar'.
(comp-emit-call-cstr, comp-lambda-list-gen, comp-add-call-cstr):
New functions.
(comp-add-cstrs): Call `comp-add-call-cstr'.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Update two
type specifier tests.
2020-12-21 20:22:03 +01:00
Andrea Corallo
23791cf74d
* Allow for modifying insn-cell inside `comp-loop-insn-in-block'
...
* lisp/emacs-lisp/comp.el (comp-loop-insn-in-block): Update.
2020-12-21 20:22:02 +01:00
Andrea Corallo
02551085c1
* Rename comp-cond-cstr into comp-add-cstrs
...
* lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-target-mvar)
(comp-add-cond-cstrs, comp-add-cstrs): Rename comp-cond-cstr
-> comp-add-cstrs.
2020-12-21 20:22:02 +01:00
Andrea Corallo
d072ee9d34
* Two minors in comp.el
...
* lisp/emacs-lisp/comp.el (comp-known-func-cstr-h)
(comp-ret-type-spec): Style.
2020-12-21 20:22:02 +01:00
Andrea Corallo
7074988d13
* Add a type specifier test to comp-cstr-tests.el
...
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
2020-12-21 20:22:02 +01:00
Andrea Corallo
34c1d75a31
* Enumerate and split type specifier tests in comp-tests.el to ease debug
...
* test/src/comp-tests.el (comp-tests-type-spec-tests): Enumerate.
(comp-tests-define-type-spec-test): New function.
(comp-tests-define-type-spec-tests): New macro to expand tests.
2020-12-21 20:22:02 +01:00
Andrea Corallo
48d43f579e
* Improve constraint simplification logic in comp-cstr.el
...
* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors):
Simplify.
(comp-cstr-empty-p): New Funchion.
(comp-split-pos-neg): Minor.
(comp-normalize-typeset): Logic update.
(comp-union-typesets): Minor.
(comp-intersect-two-typesets): New functio.
(comp-intersect-typesets): Logic update.
(comp-range-union, comp-range-intersection): Minor.
(comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem)
(comp-cstr-intersection-homogeneous)
(comp-cstr-intersection-no-mem, comp-cstr-negation)
(comp-type-spec-to-cstr, comp-cstr-to-type-spec): Logic update.
* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors): Simplify.
2020-12-21 20:21:33 +01:00
Lars Ingebrigtsen
cf2e832185
Rename slice-string to string-slice
...
* lisp/emacs-lisp/subr-x.el (string-slice): Rename from slice-string.
* doc/lispref/strings.texi (Creating Strings): Ditto.
2020-12-21 20:18:57 +01:00
Lars Ingebrigtsen
b3dec31766
Add `string-pad'
...
* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/shortdoc.el (string): Add example.
* lisp/emacs-lisp/subr-x.el (string-pad): New function.
2020-12-21 20:01:28 +01:00
Andrea Corallo
a0c0daf7a1
* Fix a number of type specifier simplification tests
...
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Fix a number of tests.
2020-12-21 19:01:22 +01:00
Andrea Corallo
bad18f509d
* Improve comp-fwprop pass
...
Wire-up comp-cstr.el routines in fwprop and constraint mvars also on
the else side of branches.
* lisp/emacs-lisp/comp.el (comp-emit-assume)
(comp-cond-cstr-target-mvar, comp-cond-cstr-func)
(comp-fwprop-insn): Logic update.
(comp-mvar-value-vld-p, comp-mvar-propagate, comp-fwprop-call):
Handle neg slot.
2020-12-21 19:00:39 +01:00