Commit graph

4788 commits

Author SHA1 Message Date
Paul Eggert
9b0ffdbadd Spelling fixes
* doc/misc/calc.texi (Predefined Units): Use the bland modern
scientific style for spelling the units “ampere” and
“angstrom” rather than the older style “Ampere” and
“Ångstrom”.  The latter spelling was wrong anyway (it should
have been “Ångström”).
* lisp/emacs-lisp/ert.el (ert--explain-equal-rec):
Fix misspelling of ‘atom’ in code.
2015-12-07 08:38:05 -08:00
Artur Malabarba
aac3c8a38f * lisp/emacs-lisp/package.el: Don't install bad signatures (bug#22089)
(package--with-response-buffer): NOERROR and ERROR-FORM only
handle connection errors.
(bad-signature): New error type.
(package--check-signature-content): Use it.
(package--check-signature): Properly distinguish connection errors
from bad-signature errors.  Do the check for
`package-check-signature' `allow-unsigned' here instead of forcing
the callbacks to do it.  Add a new argument, UNWIND.
(package--download-one-archive, package-install-from-archive):
Update usage of `package--check-signature'.
2015-12-05 16:42:04 +00:00
Stefan Monnier
c2917b02bf * lisp/emacs-lisp/ert.el: Prefer pcase over cl-typecase
* lisp/emacs-lisp/ert.el (ert--should-error-handle-error)
(ert--explain-format-atom, ert--explain-equal-rec)
(ert--print-backtrace, ert-test-result-type-p, ert-select-tests)
(ert--insert-human-readable-selector): Prefer pcase over cl-typecase.
2015-12-04 12:59:21 -05:00
Stefan Monnier
3a9df7589a * lisp/emacs-lisp/cl-macs.el (character): Can't be negative
Fixes (bug#21701)
2015-12-04 08:28:39 -05:00
Glenn Morris
9bfcd87c04 ; Auto-commit of loaddefs files. 2015-12-04 07:20:41 -05:00
Stefan Monnier
7d611e25ff * lisp/emacs-lisp/smie.el (smie-next-sexp): Fix BOB "token" 2015-12-03 15:22:14 -05:00
Artur Malabarba
1e1aabbc09 Fix some file headers for the purpose of `package--builtins'
* lisp/emacs-lisp/cl-preloaded.el
* lisp/emacs-lisp/eieio-compat.el
* lisp/net/sasl-scram-rfc.el: Add a "Package:" header

* lisp/ielm.el: Fix summary line.
2015-12-03 16:13:57 +00:00
Artur Malabarba
50dce3c422 * lisp/emacs-lisp/package.el (package-unpack): Load before compiling
Reload any previously loaded package files before compiling
the package (also reload the same files after compiling).
This ensures that we have the most recent definitions during
compilation, and avoids generating bad elc files when a macro
changes and it is used in a different file from the one it's
defined in.
2015-12-03 16:13:57 +00:00
Artur Malabarba
67c6906a5f * lisp/emacs-lisp/package.el: Refactor package activation code
(package-activate): Move code that activates dependencies into
package-activate-1.
(package--load-files-for-activation): New function.
(package-activate-1): Add code for (optionally) activating
dependencies, and move file-loading code into
`package--load-files-for-activation'.
2015-12-03 16:13:57 +00:00
Stephen Leake
0af2c269b1 Fix bug#22069 in cl-generic.el
* lisp/emacs-lisp/cl-generic.el (cl-no-method): Remove %S; this string is
not run thru `format'.
2015-12-02 06:40:27 -06:00
Artur Malabarba
628d0063f8 * lisp/emacs-lisp/package.el: Update header comments 2015-12-01 15:11:33 +00:00
Paul Eggert
36649e0150 Spelling and grammar fixes 2015-11-29 21:52:17 -08:00
Alan Mackenzie
5cf012a3a8 Byte compiler: Catch missing argument to `funcall'. Fixes bug#22051.
* lisp/emacs-lisp/bytecomp.el (byte-compile-funcall): When there's no argument
to `funcall', (i) Output an error message; (ii) Generate code to signal a
`wrong-number-of-arguments' error.
2015-11-29 16:17:07 +00:00
Eli Zaretskii
165d6e3fdd Add ':version' tag to 'checkdoc-package-keywords-flag'
* lisp/emacs-lisp/checkdoc.el (checkdoc-package-keywords-flag):
Add a ':version' tag.
2015-11-27 12:32:44 +02:00
Alan Mackenzie
af40b7689a Byte Compiler: generate code to adjust stack count after call to `signal'.
Corrects change from earlier today.

* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): supply the current value of
`byte-compile--for-effect' as argument to `byte-compile-form'.
2015-11-26 20:57:34 +00:00
Alan Mackenzie
5d93a89e80 Byte compiler: on setq with an odd number of arguments, generate a `signal'
* lisp/emacs-lisp/cconv.el (cconv-convert): Don't transform `setq' form when
it has an odd number of arguments, to allow bytecomp to handle the error.

* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): In a `setq' form with an
odd number of arguments, generate a `signal' instead of the normal code.
2015-11-26 10:36:32 +00:00
Alan Mackenzie
acb96f2718 Squashed commit of the following:
commit e1ecf76585bef2eb87995f7a7f92cc12003a6f70
Author: Alan Mackenzie <acm@muc.de>
Date:   Tue Nov 24 16:50:09 2015 +0000

    Byte compile: minor amendments.

    * lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
    add a comment to explain the binding of variables around a subsidiary
    compilation.
    (byte-compile-new-defuns): Amend the doc string.

commit c537bfed1dda1593d218956ff00c6105a3ff0316
Author: Alan Mackenzie <acm@muc.de>
Date:   Sat Nov 21 18:43:57 2015 +0000

    Byte compiler: fix spurious warnings "might not be defined at runtime".

    Also initialize byte-compile-noruntime-functions between runs.

    * lisp/emacs-lisp/bytecomp.el (byte-compile-new-defuns): New variable.
    (byte-compile-initial-macro-environment): For eval-when-compile: bind
    byte-compile-unresolved-functions and byte-compile-new-defuns around
    byte-compile-top-level, to prevent spurious entries being made.
    (byte-compile-warn-about-unresolved-functions): Check whether function is
    in byte-compile-new-defuns before emitting a warning about it.
    (byte-compile-from-buffer): Initialize new variable and
    byte-compile-noruntime-functions to nil.
    (byte-compile-file-form-require): record all new functions defined by a
    `require' in byte-compile-new-defuns.
    (byte-compile-file-form-defmumble): record the new alias in
    byte-compile-new-defuns.
2015-11-24 17:37:49 +00:00
Alan Mackenzie
a67cc630db Byte compile: Output an error, not a warning, for odd number of args to setq
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Amend.
2015-11-24 12:40:39 +00:00
Johan Bockgård
e395cafbc1 * lisp/emacs-lisp/nadvice.el (add-function): Fix debug spec.
(remove-function): Ditto. (Bug#20376)
2015-11-23 21:01:02 +01:00
Alan Mackenzie
b6bc4ab20c Signal an error when `setf' gets an odd number of arguments.
* lisp/emacs-lisp/gv.el (setf): Amend.
2015-11-23 17:13:55 +00:00
Stefan Monnier
9f1a5113e1 * lisp/emacs-lisp/smie.el (smie-backward-sexp): Handle BOB better. 2015-11-23 11:26:16 -05:00
Alan Mackenzie
5454708346 Expunge occurrences of `setq' with an odd number of arguments.
* lisp/apropos.el (apropos-documentation):
* lisp/obsolete/complete.el (PC-include-file-all-completions):
* lisp/progmodes/compile.el (compilation-goto-locus):
* lisp/vc/vc-cvs.el (vc-cvs-parse-root): (twice)
Insert missing nil at end of `setq' forms.

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-autoload): Remove an
erroneous trailing variable name from a setq, thus allowing a compilation
properly to track functions not defined at runtime.
2015-11-23 14:49:23 +00:00
Alan Mackenzie
c89b5a0f8a Issue a warning from the byte compiler on a malformed `setq' form.
Partly fixes bug#20241.
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Issue a warning when a
`setq' form with an odd number of arguments is compiled.
2015-11-23 14:25:15 +00:00
Alan Mackenzie
74e5d4e21e Don't let cconv_convert insert a nil argument into a `setq' form.
Fixes bug#21983.
* lisp/emacs-lisp/cconv.el (cconv-convert): Don't silently insert a nil last
argument into a `setq' when there're an odd number of args.  This enables the
byte compiler to issue a message in this case.
2015-11-23 14:10:36 +00:00
Artur Malabarba
2e6d7d1e34 * lisp/emacs-lisp/package.el (package--with-response-buffer):
Ensure we're at the start of the buffer before searching for
the end of headers.
2015-11-18 10:28:33 +00:00
Paul Eggert
ac16149ba4 Fix docstring quoting problems with ‘ '’
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes.  The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.
2015-11-17 15:29:35 -08:00
Johan Bockgård
c4b20fc936 pcase.el: Fix edebugging of backquoted cons patterns
* lisp/emacs-lisp/pcase.el (pcase-QPAT): Fix edebugging of backquoted
cons patterns. (Bug#21920)
2015-11-16 23:48:25 +01:00
Artur Malabarba
31fc056791 * lisp/emacs-lisp/package.el (package--with-response-buffer): Missing require 2015-11-16 13:53:45 +00:00
Artur Malabarba
63acb2e868 * lisp/emacs-lisp/nadvice.el (add-function): Escape quote 2015-11-16 09:49:00 +00:00
Artur Malabarba
d99ccd6dd1 Backport: * lisp/emacs-lisp/package.el: Fix a decoding issue.
* lisp/url/url-handlers.el (url-insert-file-contents): Move some code to
`url-insert-buffer-contents'.
(url-insert-buffer-contents): New function

(package--with-response-buffer): Use `url-insert-buffer-contents'.
The previous code had some issues with decoding. Refactoring that
function allows us to use the decoding from url-handlers while still
treating both sync and async requests the same.
2015-11-15 21:32:47 +00:00
Artur Malabarba
e7f2c91bd1 Backport: * lisp/emacs-lisp/package.el: Refactor -with-work-buffer-async.
(package--with-work-buffer-async): Reimplement as
`package--with-response-buffer'.
(package--with-work-buffer): Mark obsolete.
(package--with-response-buffer): New macro. This is a more self
contained and less contrived version of
`package--with-work-buffer-async'.  It uses keyword arguments,
doesn't have async on the name, doesn't fallback on
`package--with-work-buffer', and has _much_ simpler error
handling.  On master, this macro will soon be part of another
library (either standalone or inside url.el), which is why this
commit is not to be merged back.

(package--check-signature, package--download-one-archive)
(package-install-from-archive, describe-package-1): Use it.

(package--download-and-read-archives): Let
`package--download-one-archive' take care of calling
`package--update-downloads-in-progress'.
2015-11-14 16:06:01 +00:00
Nicolas Petton
51d840a8a1 Rename seq-p and map-p to seqp and mapp
* lisp/emacs-lisp/seq.el (seqp): New name.
* lisp/emacs-lisp/map.el (mapp): New name.
* doc/lispref/sequences.texi: Update the documentation for seqp.
* test/automated/map-tests.el: Update the tests for mapp.
2015-11-11 18:20:03 +01:00
Paul Eggert
c92dbd6d0c Spelling fixes
* lisp/net/soap-inspect.el (soap-inspect-xs-simple-type):
Fix misspelling in output.
2015-11-10 10:23:00 -08:00
Artur Malabarba
cbaa04014e * lisp/emacs-lisp/map.el (map-merge-with): New function
* test/automated/map-tests.el (test-map-merge-with): New test
2015-11-10 13:04:30 +00:00
Dmitry Gutov
0be6fb8e17 Merge branch 'project-next' 2015-11-10 02:47:46 +02:00
Artur Malabarba
b74c8847e8 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix a bug
The defsubst was being created as:
    (cl-defsubst name (args) ("DOC") ...)

* test/automated/cl-lib-tests.el (cl-lib-struct-constructors): Add test
2015-11-07 13:55:16 +00:00
Dmitry Gutov
977697203f Rename "search path" to "library roots"
* lisp/emacs-lisp/cl-seq.el (cl-set-difference): Retain the order
of the elements from CL-LIST1.

* test/automated/cl-lib-tests.el (cl-lib-test-set-functions):
Update WRT to the above change.

* lisp/progmodes/project.el (project-search-path-function): Rename
to project-library-roots-function, update the documentation and
references.
(project-search-path): Likewise, to project-library-roots.
(project-roots): Clarify documentation.
(project-vc-search-path): Likewise, to project-vc-library-roots.
(project-library-roots): In addition to the renames, thread the
results through file-name-as-directory.
(project-prune-directories): Accept a variable number of
arguments.  Rename to project-combine-directories.
(project-subtract-directories): New function.

* lisp/progmodes/elisp-mode.el (elisp--xref-find-references):
Append project-roots and project-library-roots together.

* lisp/progmodes/etags.el (etags--xref-find-references): Ditto.
2015-11-06 15:37:24 +02:00
Glenn Morris
6540f6c586 ; Auto-commit of loaddefs files. 2015-11-05 06:17:56 -05:00
Stefan Monnier
54e2ed97bf * lisp/emacs-lisp/eieio-compat.el: Typo caught by tests
(eieio--generic-static-object-generalizer): Fix typo.
* test/automated/eieio-tests.el: Byte-compile it again.
It looks like the underlying cause of bug#17852 was fixed in the mean time.
2015-11-04 09:42:20 -05:00
Michael Heerdegen
335cb1ee15 * lisp/emacs-lisp/pcase.el (pcase): Tweak docstring. 2015-11-03 23:59:42 +01:00
Eli Zaretskii
553d7e9b38 Avoid errors in redisplay--pre-redisplay-functions
* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect): Don't
use 'bobp', instead compare window-point with 1.  (Bug#21730)
2015-10-31 15:31:17 +02:00
Stefan Monnier
84dcdbeb74 * lisp/emacs-lisp/cl-generic.el: Add (major-mode MODE) context
(cl--generic-derived-specializers): New function.
(cl--generic-derived-generalizer): New generalizer.
(cl-generic-generalizers): New specializer (derived-mode MODE).
(cl--generic-split-args): Apply the rewriter, if any.
(cl-generic-define-context-rewriter): New macro.
(major-mode): Use it to define a new context-rewriter, so we can write
`(major-mode MODE)' instead of `(major-mode (derived-mode MODE))'.

* lisp/frame.el (window-system): New context-rewriter so we can write
`(window-system VAL)' instead of (window-system (eql VAL)).
(cl--generic-split-args): Apply the rewriter, if any.
(frame-creation-function): Use the new syntax.

* lisp/term/x-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-selection-owner-p)
(gui-backend-selection-exists-p, gui-backend-get-selection):
* lisp/term/w32-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-get-selection)
(gui-backend-selection-owner-p, gui-backend-selection-exists-p):
* lisp/term/pc-win.el (gui-backend-get-selection)
(gui-backend-selection-exists-p, gui-backend-selection-owner-p)
(gui-backend-set-selection, window-system-initialization)
(frame-creation-function, handle-args-function):
* lisp/term/ns-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-selection-exists-p)
(gui-backend-get-selection):
* lisp/startup.el (handle-args-function):
* lisp/term/xterm.el (gui-backend-get-selection)
(gui-backend-set-selection): Use the new syntax.
2015-10-29 11:06:31 -04:00
Stefan Monnier
be81cc2707 * lisp/emacs-lisp/smie.el: Use declare' for pure'
(smie-precs->prec2, smie-merge-prec2s, smie-bnf->prec2, smie-prec2->grammar):
Use `declare'.
2015-10-29 10:35:08 -04:00
Stefan Monnier
aa1c4ae271 * lisp/emacs-lisp/cl-generic.el: Accomodate future changes
(cl--generic-generalizer): Add `name' field.
(cl-generic-make-generalizer): Add corresponding `name' argument.
(cl-generic-define-generalizer): New macro.
(cl--generic-head-generalizer, cl--generic-eql-generalizer)
(cl--generic-struct-generalizer, cl--generic-typeof-generalizer)
(cl--generic-t-generalizer): Use it.
(cl-generic-ensure-function): Add `noerror' argument.
(cl-generic-define): Use it so we don't follow aliases.
(cl-generic-define-method): Preserve pre-existing ordering of methods.
(cl--generic-arg-specializer): New function.
(cl--generic-cache-miss): Use it.
(cl-generic-generalizers): Only fset a temporary definition
during bootstrap.
(cl--generic-struct-tag, cl--generic-struct-specializers):
Allow extra arguments.

* lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-generalizer)
(eieio--generic-static-object-generalizer): Use cl-generic-define-generalizer.
(eieio--generic-static-symbol-specializers): Allow extra arguments.

* lisp/emacs-lisp/eieio-core.el (eieio--generic-generalizer)
(eieio--generic-subclass-generalizer): Use cl-generic-define-generalizer.
(eieio--generic-subclass-specializers): Allow extra arguments.
2015-10-29 10:33:36 -04:00
Stefan Monnier
c0d866dd69 * lisp/emacs-lisp/bytecomp.el (compile-defun): Add defvars in scope. 2015-10-29 10:31:40 -04:00
Stefan Monnier
d7a67c5a2f (internal--syntax-propertize): Save match-data here (bug#21766)
* lisp/emacs-lisp/syntax.el (internal--syntax-propertize): Save match-data.
* lisp/simple.el (delete-trailing-whitespace): Undo last change.
2015-10-28 22:18:47 -04:00
Stefan Monnier
d5ee655c17 * lisp/emacs-lisp/macroexp.el: Tweak macroexp-if optimizations
(macroexp-unprogn): Make sure we never return an empty list.
(macroexp-if): Remove unused (and unsafe) optimization.
Optimize (if A T (if B T E)) into (if (or A B) T E) instead, which does
occur occasionally.
2015-10-28 13:59:42 -04:00
Artur Malabarba
7dfe247864 * lisp/emacs-lisp/seq.el (seq-mapn): New function
* doc/lispref/sequences.texi (Sequence Functions): Document seq-mapn
2015-10-28 15:40:23 +00:00
Nicolas Petton
61b63f460d * lisp/emacs-lisp/thunk.el (thunk-delay): Fix the macro. 2015-10-28 09:56:03 +01:00
Nicolas Petton
22579baf62 * lisp/emacs-lisp/map.el: Better docstrings. 2015-10-26 22:23:02 +01:00