emacs/lisp/emacs-lisp
Mattias Engdegård 537f78b537 Warn about unmatchable constant args to eq, memq etc
Add a byte-compiler warning about attempts to compare literal values
with undefined identity relation to other values.  For example:

  (eq x 2.0)
  (memq x '("a" (b) [c]))

Such incomparable values include all literal conses, strings, vectors,
records and (except for eql and memql) floats and bignums.
The warning currently applies to eq, eql, memq, memql, assq, rassq,
remq and delq.

* lisp/emacs-lisp/bytecomp.el (bytecomp--dodgy-eq-arg)
(bytecomp--value-type-description, bytecomp--arg-type-description)
(bytecomp--warn-dodgy-eq-arg, bytecomp--check-eq-args)
(bytecomp--check-memq-args): New.
(eq, eql, memq, memql, assq, rassq, remq, delq):
Set compiler-macro property.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
Amend doc string.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--with-warning-test): Fix text-quoting-style and expand
re-warning so that it doesn't need to be a literal.
(bytecomp-warn-dodgy-args-eq, bytecomp-warn-dodgy-args-memq):
New tests.
2022-12-14 19:30:16 +01:00
..
advice.el (compiled-function-p): New function (bug#56648) 2022-08-14 12:30:05 -04:00
avl-tree.el
backquote.el
backtrace.el ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
benchmark.el ; Silence byte-compiler in benchmark.el 2022-10-07 23:15:13 +02:00
bindat.el Bindat (src, strz): Operate on vectors too 2022-10-21 11:26:36 -04:00
byte-opt.el ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
byte-run.el Warn about unmatchable constant args to eq, memq etc 2022-12-14 19:30:16 +01:00
bytecomp.el Warn about unmatchable constant args to eq, memq etc 2022-12-14 19:30:16 +01:00
cconv.el cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695 2022-10-28 11:33:24 -04:00
chart.el ; Fix typos (don't abbreviate "with" or "without") 2022-12-01 16:36:09 +01:00
check-declare.el
checkdoc.el ; Improve checkdoc.el commentary section 2022-12-10 23:55:00 +01:00
cl-extra.el ; Fix typos 2022-12-13 18:44:41 +01:00
cl-generic.el cl-generic: Fix advertised-calling-convention declarations 2022-10-16 12:01:47 -04:00
cl-indent.el
cl-lib.el Delete many items obsolete since 24.3 2022-09-09 11:27:30 +02:00
cl-macs.el * lisp/emacs-lisp/cl-macs.el (cl-flet): Optimize a bit more 2022-12-02 19:15:46 -05:00
cl-preloaded.el Merge remote-tracking branch 'origin/master' into feature/tree-sitter 2022-08-29 11:41:10 -07:00
cl-print.el
cl-seq.el cl-reduce doc string improvement 2022-08-18 15:07:08 +02:00
comp-cstr.el ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
comp.el ; Remove debugging leftover message 2022-12-03 22:06:34 +02:00
copyright.el
crm.el Pacify recent unused/ignored lexvar warnings 2022-10-26 16:35:59 +03:00
cursor-sensor.el
debug-early.el
debug.el Obsolete unused variable in debug.el 2022-09-20 12:40:14 +02:00
derived.el
disass.el
easy-mmode.el Fix gud-minor-mode-menu 2022-12-03 11:32:00 +02:00
easymenu.el Fix easy menu separator in oldXMenu 2022-11-25 00:53:16 +01:00
edebug.el Abolish max-specpdl-size (bug#57911) 2022-09-19 19:30:03 +02:00
eieio-base.el * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): Simplify. 2022-07-31 12:04:17 +02:00
eieio-core.el Fix overly wide docstrings generated by eieio 2022-10-02 17:28:04 +02:00
eieio-custom.el
eieio-datadebug.el
eieio-opt.el New function substitute-quotes 2022-09-10 07:37:36 +02:00
eieio-speedbar.el
eieio.el Fix more overly long docstrings in eieio 2022-10-03 00:04:23 +02:00
eldoc.el Improve and extend documentation of ElDoc 2022-10-21 16:10:08 +03:00
elint.el
elp.el ; Delete not-useful comments referring to Emacs 19. 2022-08-19 18:05:51 +02:00
ert-x.el Activate direct asynchronous processes for Tramp container methods 2022-11-21 14:49:54 +01:00
ert.el Improve robustness of server.el tests 2022-11-26 13:40:33 -08:00
ewoc.el
faceup.el
find-func.el
float-sup.el
generate-lisp-file.el Inhibit nativecomp of loaddefs files 2022-09-03 14:23:26 +02:00
generator.el
generic.el
gv.el Audit some plist uses with new predicate argument 2022-10-22 19:33:12 +03:00
helper.el Don't show status message in Helper-describe-bindings 2022-08-11 14:35:23 +02:00
hierarchy.el ; Fix typos 2022-11-18 16:02:19 +01:00
icons.el Fix the width of margins for icons in outline-minor-mode (bug#59719) 2022-12-02 09:54:22 +02:00
inline.el
let-alist.el
lisp-mnt.el
lisp-mode.el Restore font-lock-type-face for lisp mode &symbols 2022-12-04 19:50:45 +02:00
lisp.el In end-of-defun, terminate early if no further defun exists 2022-11-10 15:00:29 -08:00
loaddefs-gen.el Fix generation of autoloads on MS-Windows 2022-11-26 12:59:06 +02:00
macroexp.el * lisp/emacs-lisp/macroexp.el (macroexp--compiler-macro): Soften message 2022-09-03 11:03:32 -04:00
map-ynp.el
map.el Audit some plist uses with new predicate argument 2022-10-22 19:33:12 +03:00
memory-report.el Use file-size-human-readable in memory-report--format 2022-10-15 03:02:17 +02:00
multisession.el Fix error editing multisession variables (bug#59710) 2022-12-02 14:25:35 +01:00
nadvice.el Don't bug out in advice--make-docstring when there's not doc string 2022-10-04 12:50:17 +02:00
oclosure.el ; Normalize GPLv3 license statements in new files 2022-12-09 00:13:00 +01:00
package-vc.el Ensure 'package-vc--version' always returns a version 2022-12-10 09:48:02 +01:00
package-x.el
package.el Fix error message when installing non-existent package 2022-12-11 19:02:44 +01:00
pcase.el ; Fix typos 2022-11-23 05:49:22 +01:00
pp.el
radix-tree.el
range.el
re-builder.el * lisp/emacs-lisp/re-builder.el: Cosmetic changes 2022-10-28 09:36:40 -04:00
regexp-opt.el Abolish max-specpdl-size (bug#57911) 2022-09-19 19:30:03 +02:00
regi.el ; * lisp/emacs-lisp/regi.el: Delete incorrect "last modified" comment. 2022-07-30 11:36:36 +02:00
ring.el * lisp/emacs-lisp/ring.el (ring): Define as a type 2022-08-14 12:30:06 -04:00
rmc.el ; Fix typos 2022-11-18 16:02:19 +01:00
rx.el Fix pcase rx patterns using rx-let bindings (bug#59814) 2022-12-11 16:49:06 +01:00
seq.el ; * lisp/emacs-lisp/seq.el (seq-filter): Fix typo in doc string. 2022-11-17 08:48:14 +02:00
shadow.el
shortdoc.el * lisp/outline.el (outline-search-function): New variable (bug#53981). 2022-11-21 09:56:06 +02:00
shorthands.el
smie.el ; Fix typos 2022-11-11 15:52:37 +01:00
subr-x.el Fix 'add-display-text-property' when OBJECT is non-nil 2022-12-06 14:41:36 +02:00
syntax.el
tabulated-list.el ; tabulated-list.el: Remove duplicate obsolete declaration 2022-12-10 21:31:59 +01:00
tcover-ses.el ; Fix typos 2022-11-18 16:02:19 +01:00
testcover.el Remove a nil cl-case case 2022-09-13 18:24:14 +02:00
text-property-search.el Fix 'text-property-search-backward' with 1-char long properties 2022-11-03 11:25:50 +02:00
thunk.el
timer-list.el
timer.el time-convert): Deprecate calls without an explicit FORM arg 2022-08-05 18:46:31 -04:00
tq.el
trace.el ; Delete LCD Archive entries 2022-07-28 15:07:34 +02:00
unsafep.el
vtable.el Fix vtable-insert-object line insertion 2022-10-08 15:26:01 +02:00
warnings.el Fix variable types in warnings-suppress 2022-08-15 09:36:06 +02:00