1. 09 Jun, 2019 2 commits
  2. 30 May, 2019 1 commit
    • Noam Postavsky's avatar
      Warn about wrong number of args for subrs (Bug#35767) · 134edc10
      Noam Postavsky authored
      * lisp/emacs-lisp/bytecomp.el (byte-compile-callargs-warn): Don't
      assume byte-compile-fdefinition will return non-nil.
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn-wrong-args)
      (bytecomp-warn-wrong-args-subr): New tests.
      134edc10
  3. 27 May, 2019 1 commit
    • Mattias Engdegård's avatar
      Correctly eliminate duplicate cases in switch compilation · 68b374a6
      Mattias Engdegård authored
      Fix code mistakes that prevented the correct elimination of duplicated
      cases when compiling a `cond' form to a switch bytecode, as in
      
        (cond ((eq x 'a) 1)
              ((eq x 'b) 2)
              ((eq x 'a) 3)   ; should be elided
              ((eq x 'c) 4))
      
      Sometimes, this caused the bytecode to use the wrong branch (bug#35770).
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-vars): Return obj2 eval'ed.
      (byte-compile-cond-jump-table-info):
      Discard redundant condition.  Use `obj2' as evaluated.
      Discard duplicated cases instead of failing the table generation.
      * test/lisp/emacs-lisp/bytecomp-tests.el (toplevel): Require subr-x.
      (byte-opt-testsuite-arith-data, bytecomp-test--switch-duplicates): Test.
      68b374a6
  4. 19 Apr, 2019 1 commit
    • Philipp Stephani's avatar
      Make warning about unescaped character literals more helpful. · 0b4b380c
      Philipp Stephani authored
      See Bug#31676.
      
      * lisp/emacs-lisp/byte-run.el
      (byte-run--unescaped-character-literals-warning): New defun.
      
      * src/lread.c (load_warn_unescaped_character_literals): Use new defun.
      (syms_of_lread): Define symbol for new defun.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Use new
      defun.
      
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
      test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
      0b4b380c
  5. 01 Jan, 2019 1 commit
  6. 16 Jun, 2018 2 commits
    • Paul Eggert's avatar
      Fix byte compilation of (eq foo 'default) · e1284341
      Paul Eggert authored
      Backport from master.
      Do not use the symbol ‘default’ as a special marker.
      Instead, use a value that cannot appear in the program,
      improving on a patch proposed by Robert Cochran (Bug#31718#14).
      * lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
      New constant.
      (byte-compile-cond-jump-table-info)
      (byte-compile-cond-jump-table): Use it instead of 'default.
      * test/lisp/emacs-lisp/bytecomp-tests.el:
      (byte-opt-testsuite-arith-data): Add a test for the bug.
      e1284341
    • Paul Eggert's avatar
      Fix byte compilation of (eq foo 'default) · 9af399fd
      Paul Eggert authored
      Do not use the symbol ‘default’ as a special marker.
      Instead, use a value that cannot appear in the program,
      improving on a patch proposed by Robert Cochran (Bug#31718#14).
      * lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
      New constant.
      (byte-compile-cond-jump-table-info)
      (byte-compile-cond-jump-table): Use it instead of 'default.
      * test/lisp/emacs-lisp/bytecomp-tests.el:
      (byte-opt-testsuite-arith-data): Add a test for the bug.
      9af399fd
  7. 27 Mar, 2018 1 commit
  8. 23 Mar, 2018 1 commit
    • Paul Eggert's avatar
      Avoid Fortran-style floating-point optimization · 42e7e267
      Paul Eggert authored
      When optimizing arithmetic operations, avoid optimizations that
      are valid for mathematical numbers but invalid for floating-point.
      For example, do not optimize (+ 1 v 0.5) to (+ v 1.5), as they may
      not be the same due to rounding errors.  In general,
      floating-point numbers cannot be constant-folded, since that would
      make .elc files platform-dependent.
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-associative-math):
      Do not optimize floats.
      (byte-optimize-nonassociative-math, byte-optimize-approx-equal)
      (byte-optimize-delay-constants-math, byte-compile-butlast)
      (byte-optimize-logmumble):
      Remove; no longer used.
      (byte-optimize-minus): Do not optimize (- 0 x) to (- x).
      (byte-optimize-multiply): Do not optimize (* -1 x) to (- x).
      (byte-optimize-divide): Do not optimize (/ x -1) to (- x).
      (logand, logior, logxor): Optimize with byte-optimize-predicate
      instead of with byte-optimize-logmumble.
      * test/lisp/emacs-lisp/bytecomp-tests.el:
      (byte-opt-testsuite-arith-data): Add a couple of test cases.
      42e7e267
  9. 07 Jan, 2018 1 commit
  10. 01 Jan, 2018 1 commit
  11. 09 Dec, 2017 1 commit
    • Philipp Stephani's avatar
      Raise an error when detecting old-style backquotes. · 8b819723
      Philipp Stephani authored
      They have been deprecated for a decade now.
      
      * src/lread.c (Fload): Don't use record_unwind_protect to warn about
      old-style backquotes any more.  They now generate a hard error.
      (read1): Signal an error when detecting old-style backquotes.  Remove
      unused label.
      (syms_of_lread): Remove unused internal variable
      'lread--old-style-backquotes'.
      (load_error_old_style_backquotes): Rename from
      'load_warn_oldstyle_backquotes'.  Signal an error.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove check
      from byte compiler.  It isn't triggered any more.
      
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Adapt
      unit test.
      
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--old-style-backquotes)
      (bytecomp-tests-function-put): Adapt unit tests.
      
      * etc/NEWS: Document change.
      8b819723
  12. 21 Oct, 2017 1 commit
  13. 09 Oct, 2017 1 commit
  14. 08 Oct, 2017 1 commit
    • Philipp Stephani's avatar
      Raise an error when detecting old-style backquotes. · 9613690f
      Philipp Stephani authored
      They have been deprecated for a decade now.
      
      * src/lread.c (Fload): Don't use record_unwind_protect to warn about
      old-style backquotes any more.  They now generate a hard error.
      (read1): Signal an error when detecting old-style backquotes.  Remove
      unused label.
      (syms_of_lread): Remove unused internal variable
      'lread--old-style-backquotes'.
      (load_error_old_style_backquotes): Rename from
      'load_warn_oldstyle_backquotes'.  Signal an error.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove check
      from byte compiler.  It isn't triggered any more.
      
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Adapt
      unit test.
      
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--old-style-backquotes)
      (bytecomp-tests-function-put): Adapt unit tests.
      
      * etc/NEWS: Document change.
      9613690f
  15. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  16. 14 Aug, 2017 1 commit
    • Glenn Morris's avatar
      Clean up temp files after some tests · 4fe9a9ef
      Glenn Morris authored
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--with-temp-file): Also delete .elc file if present.
      * test/lisp/progmodes/etags-tests.el
      (etags-buffer-local-tags-table-list): Delete temp file at end.
      4fe9a9ef
  17. 07 Aug, 2017 1 commit
    • Stefan Monnier's avatar
      Let `define-symbol-prop' take effect during compilation · cc30d77e
      Stefan Monnier authored
      * src/fns.c (syms_of_fns): New variable `overriding-plist-environment'.
      (Fget): Consult it.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Let-bind
      it to nil.
      (byte-compile-define-symbol-prop): New function, handles compilation
      of top-level `define-symbol-prop' and `function-put' calls by putting
      the symbol setting into `overriding-plist-environment'.
      Co-authored-by: default avatarNoam Postavsky <npostavs@gmail.com>
      cc30d77e
  18. 13 May, 2017 2 commits
    • Philipp's avatar
      Make `old-style-backquotes' variable internal · a1d46159
      Philipp authored
      * src/lread.c (load_warn_old_style_backquotes, Fload, read1)
      (syms_of_lread): Rename `old-style-backquotes' to
      `lread--old-style-backquotes', and clarify that it's for internal
      use only.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename
      variable.
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
      unit test.
      * emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--old-style-backquotes): Add unit test.
      a1d46159
    • Philipp Stephani's avatar
      Improve unescaped character literal warnings · 16004397
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals)
      (syms_of_lread):
      lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve
      formatting of unescaped character literal warnings.
      
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
      test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
      16004397
  19. 01 May, 2017 1 commit
    • Philipp Stephani's avatar
      Warn about missing backslashes during load · c2bbdc33
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals, Fload, read1)
      (syms_of_lread): Warn if unescaped character literals are
      found (Bug#20152).
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for
      unescaped character literals during byte compilation.
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals): New
      unit test.
      (lread-tests--with-temp-file, lread-tests--last-message): Helper
      functions for unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): New unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file):
      Helper macro for unit test.
      c2bbdc33
  20. 22 Apr, 2017 1 commit
  21. 15 Feb, 2017 1 commit
  22. 13 Feb, 2017 1 commit
  23. 07 Feb, 2017 1 commit
  24. 24 Sep, 2016 4 commits
  25. 24 Nov, 2015 1 commit
    • Phillip Lord's avatar
      Rename all test files to reflect source layout. · 22bbf7ca
      Phillip Lord authored
       * CONTRIBUTE,Makefile.in,configure.ac: Update to reflect
         test directory moves.
       * test/file-organisation.org: New file.
       * test/automated/Makefile.in
         test/automated/data/decompress/foo.gz
         test/automated/data/epg/pubkey.asc
         test/automated/data/epg/seckey.asc
         test/automated/data/files-bug18141.el.gz
         test/automated/data/flymake/test.c
         test/automated/data/flymake/test.pl
         test/automated/data/package/archive-contents
         test/automated/data/package/key.pub
         test/automated/data/package/key.sec
         test/automated/data/package/multi-file-0.2.3.tar
         test/automated/data/package/multi-file-readme.txt
         test/automated/data/package/newer-versions/archive-contents
         test/automated/data/package/newer-versions/new-pkg-1.0.el
         test/automated/data/package/newer-versions/simple-single-1.4.el
         test/automated/data/package/package-test-server.py
         test/automated/data/package/signed/archive-contents
         test/automated/data/package/signed/archive-contents.sig
         test/automated/data/package/signed/signed-bad-1.0.el
         test/automated/data/package/signed/signed-bad-1.0.el.sig
         test/automated/data/package/signed/signed-good-1.0.el
         test/automated/data/package/signed/signed-good-1.0.el.sig
         test/automated/data/package/simple-depend-1.0.el
         test/automated/data/package/simple-single-1.3.el
         test/automated/data/package/simple-single-readme.txt
         test/automated/data/package/simple-two-depend-1.1.el
         test/automated/abbrev-tests.el
         test/automated/auto-revert-tests.el
         test/automated/calc-tests.el
         test/automated/icalendar-tests.el
         test/automated/character-fold-tests.el
         test/automated/comint-testsuite.el
         test/automated/descr-text-test.el
         test/automated/electric-tests.el
         test/automated/cl-generic-tests.el
         test/automated/cl-lib-tests.el
         test/automated/eieio-test-methodinvoke.el
         test/automated/eieio-test-persist.el
         test/automated/eieio-tests.el
         test/automated/ert-tests.el
         test/automated/ert-x-tests.el
         test/automated/generator-tests.el
         test/automated/let-alist.el
         test/automated/map-tests.el
         test/automated/advice-tests.el
         test/automated/package-test.el
         test/automated/pcase-tests.el
         test/automated/regexp-tests.el
         test/automated/seq-tests.el
         test/automated/subr-x-tests.el
         test/automated/tabulated-list-test.el
         test/automated/thunk-tests.el
         test/automated/timer-tests.el
         test/automated/epg-tests.el
         test/automated/eshell.el
         test/automated/faces-tests.el
         test/automated/file-notify-tests.el
         test/automated/auth-source-tests.el
         test/automated/gnus-tests.el
         test/automated/message-mode-tests.el
         test/automated/help-fns.el
         test/automated/imenu-test.el
         test/automated/info-xref.el
         test/automated/mule-util.el
         test/automated/isearch-tests.el
         test/automated/json-tests.el
         test/automated/bytecomp-tests.el
         test/automated/coding-tests.el
         test/automated/core-elisp-tests.el
         test/automated/decoder-tests.el
         test/automated/files.el
         test/automated/font-parse-tests.el
         test/automated/lexbind-tests.el
         test/automated/occur-tests.el
         test/automated/process-tests.el
         test/automated/syntax-tests.el
         test/automated/textprop-tests.el
         test/automated/undo-tests.el
         test/automated/man-tests.el
         test/automated/completion-tests.el
         test/automated/dbus-tests.el
         test/automated/newsticker-tests.el
         test/automated/sasl-scram-rfc-tests.el
         test/automated/tramp-tests.el
         test/automated/obarray-tests.el
         test/automated/compile-tests.el
         test/automated/elisp-mode-tests.el
         test/automated/f90.el
         test/automated/flymake-tests.el
         test/automated/python-tests.el
         test/automated/ruby-mode-tests.el
         test/automated/subword-tests.el
         test/automated/replace-tests.el
         test/automated/simple-test.el
         test/automated/sort-tests.el
         test/automated/subr-tests.el
         test/automated/reftex-tests.el
         test/automated/sgml-mode-tests.el
         test/automated/tildify-tests.el
         test/automated/thingatpt.el
         test/automated/url-future-tests.el
         test/automated/url-util-tests.el
         test/automated/add-log-tests.el
         test/automated/vc-bzr.el
         test/automated/vc-tests.el
         test/automated/xml-parse-tests.el
         test/BidiCharacterTest.txt
         test/biditest.el
         test/cedet/cedet-utests.el
         test/cedet/ede-tests.el
         test/cedet/semantic-ia-utest.el
         test/cedet/semantic-tests.el
         test/cedet/semantic-utest-c.el
         test/cedet/semantic-utest.el
         test/cedet/srecode-tests.el
         test/cedet/tests/test.c
         test/cedet/tests/test.el
         test/cedet/tests/test.make
         test/cedet/tests/testdoublens.cpp
         test/cedet/tests/testdoublens.hpp
         test/cedet/tests/testfriends.cpp
         test/cedet/tests/testjavacomp.java
         test/cedet/tests/testnsp.cpp
         test/cedet/tests/testpolymorph.cpp
         test/cedet/tests/testspp.c
         test/cedet/tests/testsppcomplete.c
         test/cedet/tests/testsppreplace.c
         test/cedet/tests/testsppreplaced.c
         test/cedet/tests/testsubclass.cpp
         test/cedet/tests/testsubclass.hh
         test/cedet/tests/testtypedefs.cpp
         test/cedet/tests/testvarnames.c
         test/etags/CTAGS.good
         test/etags/ETAGS.good_1
         test/etags/ETAGS.good_2
         test/etags/ETAGS.good_3
         test/etags/ETAGS.good_4
         test/etags/ETAGS.good_5
         test/etags/ETAGS.good_6
         test/etags/a-src/empty.zz
         test/etags/a-src/empty.zz.gz
         test/etags/ada-src/2ataspri.adb
         test/etags/ada-src/2ataspri.ads
         test/etags/ada-src/etags-test-for.ada
         test/etags/ada-src/waroquiers.ada
         test/etags/c-src/a/b/b.c
         test/etags/c-src/abbrev.c
         test/etags/c-src/c.c
         test/etags/c-src/dostorture.c
         test/etags/c-src/emacs/src/gmalloc.c
         test/etags/c-src/emacs/src/keyboard.c
         test/etags/c-src/emacs/src/lisp.h
         test/etags/c-src/emacs/src/regex.h
         test/etags/c-src/etags.c
         test/etags/c-src/exit.c
         test/etags/c-src/exit.strange_suffix
         test/etags/c-src/fail.c
         test/etags/c-src/getopt.h
         test/etags/c-src/h.h
         test/etags/c-src/machsyscalls.c
         test/etags/c-src/machsyscalls.h
         test/etags/c-src/sysdep.h
         test/etags/c-src/tab.c
         test/etags/c-src/torture.c
         test/etags/cp-src/MDiagArray2.h
         test/etags/cp-src/Range.h
         test/etags/cp-src/burton.cpp
         test/etags/cp-src/c.C
         test/etags/cp-src/clheir.cpp.gz
         test/etags/cp-src/clheir.hpp
         test/etags/cp-src/conway.cpp
         test/etags/cp-src/conway.hpp
         test/etags/cp-src/fail.C
         test/etags/cp-src/functions.cpp
         test/etags/cp-src/screen.cpp
         test/etags/cp-src/screen.hpp
         test/etags/cp-src/x.cc
         test/etags/el-src/TAGTEST.EL
         test/etags/el-src/emacs/lisp/progmodes/etags.el
         test/etags/erl-src/gs_dialog.erl
         test/etags/f-src/entry.for
         test/etags/f-src/entry.strange.gz
         test/etags/f-src/entry.strange_suffix
         test/etags/forth-src/test-forth.fth
         test/etags/html-src/algrthms.html
         test/etags/html-src/index.shtml
         test/etags/html-src/software.html
         test/etags/html-src/softwarelibero.html
         test/etags/lua-src/allegro.lua
         test/etags/objc-src/PackInsp.h
         test/etags/objc-src/PackInsp.m
         test/etags/objc-src/Subprocess.h
         test/etags/objc-src/Subprocess.m
         test/etags/objcpp-src/SimpleCalc.H
         test/etags/objcpp-src/SimpleCalc.M
         test/etags/pas-src/common.pas
         test/etags/perl-src/htlmify-cystic
         test/etags/perl-src/kai-test.pl
         test/etags/perl-src/yagrip.pl
         test/etags/php-src/lce_functions.php
         test/etags/php-src/ptest.php
         test/etags/php-src/sendmail.php
         test/etags/prol-src/natded.prolog
         test/etags/prol-src/ordsets.prolog
         test/etags/ps-src/rfc1245.ps
         test/etags/pyt-src/server.py
         test/etags/tex-src/gzip.texi
         test/etags/tex-src/nonewline.tex
         test/etags/tex-src/testenv.tex
         test/etags/tex-src/texinfo.tex
         test/etags/y-src/atest.y
         test/etags/y-src/cccp.c
         test/etags/y-src/cccp.y
         test/etags/y-src/parse.c
         test/etags/y-src/parse.y
         test/indent/css-mode.css
         test/indent/js-indent-init-dynamic.js
         test/indent/js-indent-init-t.js
         test/indent/js-jsx.js
         test/indent/js.js
         test/indent/latex-mode.tex
         test/indent/modula2.mod
         test/indent/nxml.xml
         test/indent/octave.m
         test/indent/pascal.pas
         test/indent/perl.perl
         test/indent/prolog.prolog
         test/indent/ps-mode.ps
         test/indent/ruby.rb
         test/indent/scheme.scm
         test/indent/scss-mode.scss
         test/indent/sgml-mode-attribute.html
         test/indent/shell.rc
         test/indent/shell.sh
         test/redisplay-testsuite.el
         test/rmailmm.el
         test/automated/buffer-tests.el
         test/automated/cmds-tests.el
         test/automated/data-tests.el
         test/automated/finalizer-tests.el
         test/automated/fns-tests.el
         test/automated/inotify-test.el
         test/automated/keymap-tests.el
         test/automated/print-tests.el
         test/automated/libxml-tests.el
         test/automated/zlib-tests.el: Files Moved.
      22bbf7ca
  26. 21 Jun, 2015 1 commit
  27. 01 Jan, 2015 2 commits
  28. 08 Nov, 2014 1 commit
  29. 22 May, 2014 2 commits
  30. 22 Apr, 2014 1 commit
    • Daniel Colascione's avatar
      Correctly macroexpand top-level forms during eager macroexpand · 12b1389c
      Daniel Colascione authored
      * lisp/emacs-lisp/byte-run.el (eval-when-compile, eval-and-compile):
      Improve docstrings.
      
      * lisp/emacs-lisp/macroexp.el (internal-macroexpand-for-load): Add
      `full-p' parameter; when nil, call `macroexpand' instead of
      `macroexpand-all'.
      
      * src/lread.c (readevalloop_eager_expand_eval): New function
      that can recurse into toplevel forms.
      (readevalloop): Call it.
      * src/lisp.h: Declare Qprogn.
      * src/callint.c (Qprogn): No longer static.
      
      * test/automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
      Add compile flag.
      (test-byte-comp-macro-expansion)
      (test-byte-comp-macro-expansion-eval-and-compile)
      (test-byte-comp-macro-expansion-eval-when-compile)
      (test-byte-comp-macro-expand-lexical-override): Use it.
      (test-eager-load-macro-expansion)
      (test-eager-load-macro-expansion-eval-and-compile)
      (test-eager-load-macro-expansion-eval-when-compile)
      (test-eager-load-macro-expand-lexical-override): New tests.
      12b1389c
  31. 21 Apr, 2014 1 commit
  32. 01 Jan, 2014 1 commit