1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-12 09:28:24 +00:00
Commit Graph

945 Commits

Author SHA1 Message Date
Lars Magne Ingebrigtsen
b96e6cde3e Renamed process-alive-p' to process-live-p' for consistency with other `-live-p' functions. 2011-06-15 19:30:41 +02:00
Stefan Monnier
ea9fafe093 * lisp/subr.el (make-progress-reporter): Add "..." by default.
Fixes: debbugs:8785
2011-06-02 15:04:44 -03:00
Stefan Monnier
2462470b9e Miscellaneous tweaks.
* lisp/emacs-lisp/cl-macs.el (dolist, dotimes): Use the same strategy for
lexical scoping as in subr.el's dolist and dotimes.
* lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf):
Silence compiler warning.
* lisp/thingatpt.el (forward-whitespace): Trivial coding style fix.
* lisp/subr.el (with-output-to-temp-buffer): Provide an edebug spec.
* lisp/international/ccl.el (ccl-compile): Trivial simplification.
* lisp/help-fns.el (help-do-arg-highlight): Silence compiler warning.
* lisp/emacs-lisp/testcover.el (testcover-end): Remove spurious
`printflag' argument.
* lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
Purecopy the whole obsolescence data.
2011-06-01 11:19:45 -03:00
Lars Magne Ingebrigtsen
bcd54f8370 Add the tiny convenience function `process-alive-p'. 2011-05-31 20:40:00 +02:00
Kevin Ryde
2b1e1a2263 * lisp/subr.el (def-edebug-spec): Doc fix (Bug#8430). 2011-05-28 15:36:02 -04:00
Juanma Barranquero
638f053a0e Add delayed warnings support.
* etc/NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'.

* lisp/subr.el (display-delayed-warnings): New function.
  (delayed-warnings-hook): New variable.

* src/keyboard.c (Qdelayed_warnings_hook): Define.
  (command_loop_1): Run `delayed-warnings-hook' if Vdelayed_warnings_list
  is non-nil.
  (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
  (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
2011-04-28 21:35:20 +02:00
Daniel Colascione
2a782793a8 * subr.el (shell-quote-argument): Use alternate escaping strategy
when we spot a variable reference in a string.
2011-04-27 00:56:55 -07:00
Daniel Colascione
8f91bf9345 Improve Windows quoting robustness 2011-04-26 03:44:03 -07:00
Juanma Barranquero
06b605171f lisp/*.el: Lexical-binding cleanup. 2011-04-19 15:44:55 +02:00
Chong Yidong
da91b5f294 Merge open-protocol-stream into open-network-stream.
* lisp/subr.el (open-network-stream): Move to net/network-stream.el.

* lisp/gnus/proto-stream.el: Move to net/network-stream.el.

* lisp/net/network-stream.el: Move from gnus/proto-stream.el.
Change prefix to network-stream throughout.
(open-protocol-stream): Merge into open-network-stream, leaving
open-protocol-stream as an alias.  Handle nil BUFFER args.

* lisp/gnus/nnimap.el (nnimap-open-connection-1): Pass explicit :end-of-command
parameter to open-protocol-stream.

* lisp/emacs-lisp/package.el (package--with-work-buffer): Recognize
https URLs.

* lisp/url/url-gw.el (url-open-stream): Use new open-network-stream
functionality to perform encryption.
2011-04-02 19:41:03 -04:00
Stefan Monnier
40d83b412f Merge from trunk 2011-03-31 00:24:03 -04:00
Stefan Monnier
f488fb6528 * lisp/subr.el (apply-partially): Use a non-nil static environment.
(--dolist-tail--, --dotimes-limit--): Don't declare dynamically bound.
(dolist): Use a more efficient form for lexical-binding.
(dotimes): Use a cleaner semantics for lexical-binding.
* lisp/emacs-lisp/edebug.el (edebug-eval-top-level-form):
Use eval-sexp-add-defvars.
2011-03-30 14:40:00 -04:00
Stefan Monnier
9dba2c6449 * lisp/subr.el (with-output-to-temp-buffer): Don't change current-buffer to
standard-output while running the body.
* lisp/Makefile.in (COMPILE_FIRST): Remove pcase; it's not so important.
* lisp/startup.el: Fix up warnings, move lambda expressions
outside of quote.
2011-03-29 23:27:56 -04:00
Stefan Monnier
cafdcef32d Merge from trunk 2011-03-21 12:42:16 -04:00
Stefan Monnier
78f64af0ae * subr.el (deferred-action-list, deferred-action-function): Mark obsolete. 2011-03-21 12:34:16 -04:00
Stefan Monnier
ca1055060d Remove bytecomp- prefix, plus misc changes.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Make it work to
inline lexbind interpreted functions into lexbind code.
(bytedecomp-bytes): Not a dynamic var any more.
(disassemble-offset): Get the bytes via an argument instead.
(byte-decompile-bytecode-1): Use push.
* lisp/emacs-lisp/bytecomp.el: Remove the bytecomp- prefix now that we use
lexical-binding.
(byte-compile-outbuffer): Rename from bytecomp-outbuffer.
* lisp/emacs-lisp/cl-macs.el (load-time-value):
* lisp/emacs-lisp/cl.el (cl-compiling-file): Adjust to new name.
* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Add byte-code-function-p.
(pcase--u1): Remove left-over code from early development.
Fix case of variable shadowing in guards and predicates.
(pcase--u1): Add a new `let' pattern.
* src/image.c (parse_image_spec): Use Ffunctionp.
* src/lisp.h: Declare Ffunctionp.
2011-03-16 16:08:39 -04:00
Stefan Monnier
49c5410a59 * lisp/subr.el (read-char-choice): Only show the cursor after the prompt,
not after the answer.
2011-03-14 22:42:31 -04:00
Stefan Monnier
23aba0ea0e * src/eval.c (Ffunction): Use simpler format for closures.
(Fcommandp, funcall_lambda):
* src/doc.c (Fdocumentation, store_function_docstring):
* src/data.c (Finteractive_form):
* lisp/help-fns.el (help-function-arglist):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/subr.el (apply-partially): Adjust to new closure format.
* lisp/emacs-lisp/disass.el (disassemble-internal): Catch closures.
2011-03-13 18:31:49 -04:00
Stefan Monnier
2ec42da9f0 Try and fix w32 build; misc cleanup.
* lisp/subr.el (apply-partially): Move from subr.el; don't use lexical-let.
(eval-after-load): Obey lexical-binding.
* lisp/simple.el (apply-partially): Move to subr.el.
* lisp/makefile.w32-in: Match changes in Makefile.in.
(BIG_STACK_DEPTH, BIG_STACK_OPTS, BYTE_COMPILE_FLAGS): New vars.
(.el.elc, compile-CMD, compile-SH, compile-always-CMD)
(compile-always-SH, compile-calc-CMD, compile-calc-SH): Use them.
(COMPILE_FIRST): Add pcase, macroexp, and cconv.
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Silence warning about
calling CL's `compiler-macroexpand'.
* lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): New function.
(byte-compile-initial-macro-environment)
(byte-compile-toplevel-file-form, byte-compile, byte-compile-sexp): Use it.
(byte-compile-eval, byte-compile-eval-before-compile): Obey lexical-binding.
(byte-compile--for-effect): Rename from `for-effect'.
(display-call-tree): Use case.
* lisp/emacs-lisp/byte-opt.el (for-effect): Don't declare as dynamic.
(byte-optimize-form-code-walker, byte-optimize-form):
Revert to old arg name.
* lisp/Makefile.in (BYTE_COMPILE_FLAGS): New var.
(compile-onefile, .el.elc, compile-calc, recompile): Use it.
2011-03-11 22:32:43 -05:00
Stefan Monnier
ba83908c4b Misc fixes, and use lexical-binding in more files.
* lisp/subr.el (letrec): New macro.
(with-wrapper-hook): Move from lisp/simple.el and don't use CL.
* simple.el (with-wrapper-hook): Move with-wrapper-hook to subr.el.
* lisp/help-fns.el (help-function-arglist): Handle subroutines as well.
(describe-variable): Use special-variable-p to filter completions.
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Don't expand `declare'
in defmacros.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form):
Handle `declare'.
* lisp/emacs-lisp/cl.el (pushnew): Silence unfixable warning.
* lisp/emacs-lisp/cl-macs.el (defstruct, define-compiler-macro):
Mark unused arg as unused.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Use memq.
* lisp/emacs-lisp/autoload.el (make-autoload): Don't assume the macro's
first sexp is a list.
(autoload-generate-file-autoloads): Improve error message.
* lisp/emacs-lisp/advice.el (ad-arglist): Use help-function-arglist
to understand the new byte-code arg format.
* lisp/vc/smerge-mode.el:
* lisp/vc/log-view.el:
* lisp/vc/log-edit.el:
* lisp/vc/cvs-status.el:
* lisp/uniquify.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/bibtex-style.el:
* lisp/reveal.el:
* lisp/newcomment.el:
* lisp/emacs-lisp/smie.el:
* lisp/abbrev.el: Use lexical-binding.
* src/eval.c (Fprog1, Fprog2): Simplify and use XCDR/XCAR.
(Fdefvar): Remove redundant SYMBOLP check.
(Ffunctionp): Don't signal an error for undefined aliases.
* doc/lispref/variables.texi (Converting to Lexical Binding): New node.
2011-03-11 15:04:22 -05:00
Stefan Monnier
9ace101ce2 * lisp/emacs-lisp/bytecomp.el: Use lexical-binding.
(byte-recompile-directory): Remove unused var `bytecomp-dest'.
(byte-recompile-file): Use derived-mode-p.
(byte-compile-from-buffer): Remove arg `bytecomp-filename'.
Use byte-compile-current-file instead.
(byte-compile-file): Adjust call accordingly.
(bytecomp-outbuffer): Move declaration before first use.
(for-effect): Declare dynamic.
(byte-compile-file-form-defmumble): Use byte-compile-current-file.
(byte-compile-top-level, byte-compile-out-toplevel, byte-compile-form):
Move dyn-binding of for-effect from function argument to let binding.
(byte-compile-out-toplevel): Don't both passing for-effect to
byte-optimize-lapcode.
(byte-compile-top-level-body, byte-compile-body):
Rename for-effect -> for-effect-arg so it's lexical.
* lisp/subr.el (functionp): Remove, now that it's in src/eval.c.
2011-03-10 14:40:48 -05:00
Stefan Monnier
3e21b6a72b Use offsets relative to top rather than bottom for stack refs
* lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-and-error-free-ops):
Remove interactive-p.
(byte-optimize-lapcode): Update optimizations now that stack-refs are
relative to the top rather than to the bottom.
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
Turn stack-ref-0 into dup.
(byte-compile-form): Don't indirect-function since it can signal
errors.
(byte-compile-stack-ref, byte-compile-stack-set): Adjust to stack-refs
being relative to top rather than to bottom in the byte-code.
(with-output-to-temp-buffer): Remove.
(byte-compile-with-output-to-temp-buffer): Remove.
* lisp/emacs-lisp/cconv.el: Use lexical-binding.
(cconv--lookup-let): Rename from cconv-lookup-let.
(cconv-closure-convert-rec): Fix handling of captured+mutated
arguments in defun/defmacro.
* lisp/emacs-lisp/eieio-comp.el (eieio-byte-compile-file-form-defmethod):
Rename from byte-compile-file-form-defmethod.
Don't byte-compile-lambda.
(eieio-byte-compile-defmethod-param-convert): Rename from
byte-compile-defmethod-param-convert.
* lisp/emacs-lisp/eieio.el (eieio-defgeneric-form-primary-only-one):
Call byte-compile rather than byte-compile-lambda.
* src/alloc.c (Fgarbage_collect): Don't mark the byte-stack redundantly.
* src/bytecode.c (exec_byte_code): Change stack_ref and stack_set to use
offsets relative to top rather than to bottom.
* lisp/subr.el (with-output-to-temp-buffer): New macro.
* lisp/simple.el (count-words-region): Don't use interactive-p.
2011-02-21 15:12:44 -05:00
Stefan Monnier
e0f57e6569 * lisp/subr.el (save-window-excursion): New macro, moved from C.
* lisp/emacs-lisp/lisp-mode.el (save-window-excursion): Don't touch.
* lisp/emacs-lisp/cconv.el (cconv-closure-convert-rec, cconv-analyse-form):
Don't handle save-window-excursion any more.
* lisp/emacs-lisp/bytecomp.el (interactive-p, save-window-excursion):
Don't use the byte-code any more.
(byte-compile-form): Check macro expansion was done.
(byte-compile-save-window-excursion): Remove.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Ignore save-window-excursion.  Don't macroepand any more.

* src/window.c (Fsave_window_excursion): Remove.  Moved to Lisp.
(syms_of_window): Don't defsubr it.
* src/window.h (Fsave_window_excursion): Don't declare it.
* src/bytecode.c (exec_byte_code): Inline Fsave_window_excursion.
2011-02-19 00:10:33 -05:00
Sam Steingold
e8e4d5c88e undo 2011-02-01T18:15:18Z!sds@gnu.org (purecopy-cons, purecopy-car) at Stefan Monnier's request 2011-02-01 16:37:12 -05:00
Sam Steingold
26d504d7f3 fix docstrings of purecopy-cons' & purecopy-car' per Chong Yidong's request 2011-02-01 14:17:10 -05:00
Sam Steingold
0b75349e7e * lisp/subr.el (purecopy-cons, purecopy-car): Add shortcuts.
* lisp/faces.el (face-x-resources): Use `purecopy-cons'.
* lisp/files.el (auto-mode-alist, interpreter-mode-alist): Use
`purecopy-car'.
* lisp/international/fontset.el (font-encoding-alist): Ditto.
* lisp/international/mule-conf.el (file-coding-system-alist): Ditto.
* lisp/international/mule.el (auto-coding-alist)
(auto-coding-regexp-alist): Ditto.
* lisp/mouse.el (mouse-buffer-menu-mode-groups): Use `purecopy-cons'.
* lisp/term/x-win.el (x-gtk-stock-map): Ditto.
2011-02-01 13:15:18 -05:00
Stefan Monnier
8f1d2ef658 Merge from trunk 2011-02-01 12:09:25 -05:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
7c82f3e23e Merge from emacs-23 2011-01-22 11:36:45 -08:00
Stefan Monnier
d5e632d853 * lisp/subr.el (shell-quote-argument): Properly quote \n.
Suggested by Flo <sensorflo@gmail.com>.

Fixes: debbugs:7687
2011-01-21 13:07:41 -05:00
Chong Yidong
9aea757bb0 Revert changes adding format args to yes-or-no-p and y-or-n-p.
See discussion on emacs-devel at
http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00388.html

* src/fns.c (Fyes_or_no_p): Revert 2011-01-07 change, removing ARGS.

* lisp/subr.el (y-or-n-p): Revert 2011-01-07 change, removing ARGS.

* lisp/files.el (find-alternate-file, basic-save-buffer)
(basic-save-buffer-2, revert-buffer, recover-file)
(kill-buffer-ask, abort-if-file-too-large)
(set-visited-file-name, write-file, backup-buffer)
(basic-save-buffer, save-some-buffers):
* lisp/dired-aux.el (dired-compress-file): Callers changed.
2011-01-19 21:55:36 -05:00
Glenn Morris
d52969e8af Merge from emacs-23 branch, up to 2010-05-20T21:33:58Z!juri@jurta.org.
Note:
emacs-23 2010-05-20T01:32:08Z!lekktu@gmail.com is rendered unnecessary by pre-existing 2010-05-20
trunk change.
2011-01-15 12:38:27 -08:00
Mark Diekhans
b024d9f02d Make last-resort backup file in .emacs.d (Bug#6953).
* lisp/files.el (backup-buffer): Make last-resort backup file in
.emacs.d.

* lisp/subr.el (locate-user-emacs-file): If .emacs.d does not exist,
make it with permission 700.

* doc/emacs/files.texi (Backup Names): Document the new location of the
last-resort backup file.
2011-01-14 21:32:19 -05:00
Chong Yidong
c88aaf48b2 * lisp/subr.el (event-start, event-end): Doc fix (Bug#7826). 2011-01-13 00:12:01 -05:00
Stefan Monnier
3fa173b4d9 * lisp/subr.el (eval-after-load): Fix timing for features.
(declare-function, undefined, insert-for-yank)
(replace-regexp-in-string): Follow checkdoc's recommendations.
* doc/lispref/loading.texi (Hooks for Loading): Adjust doc of eval-after-load.

Fixes: debbugs:7769
2011-01-10 22:23:04 -05:00
Chong Yidong
973f1f2a81 * lisp/subr.el (read-char-choice): Use read-key. Suggested by Stefan.
* src/fns.c (Fyes_or_no_p): Minor doc fix.
2011-01-09 09:26:29 -05:00
Chong Yidong
3d91e30286 Doc fix for y-or-n-p and yes-or-no-p.
* subr.el (y-or-n-p): Doc fix.
* fns.c (Fyes_or_no_p): Doc fix.
2011-01-08 16:17:58 -05:00
Chong Yidong
3ef01959de New function read-char-choice for reading a restricted set of chars.
* lisp/subr.el (read-char-choice): New function, factored out from
dired-query and hack-local-variables-confirm.

* lisp/dired-aux.el (dired-query):
* lisp/files.el (hack-local-variables-confirm): Use it.
2011-01-08 14:17:23 -05:00
Chong Yidong
8c51d2a2c2 Allow format args for y-or-n-p and yes-or-no-p.
* lisp/subr.el (y-or-n-p): Accept format string args.
* src/fns.c (Fyes_or_no_p): Accept format string args.
2011-01-07 12:34:02 -05:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Glenn Morris
68251e1661 Remove code and comments related to lib-src/fns-*.el; long removed.
* Makefile.in (install-arch-dep, uninstall): Remove code relating to the
long absent lib-src/fns-*.el.

* lisp/loadup.el (symbol-file-load-history-loaded): Remove; unused.
Remove related, old, commented-out code.

* lisp/subr.el (symbol-file-load-history-loaded)
  (load-symbol-file-load-history): Remove old, commented-out code.
2010-12-15 00:16:53 -08:00
Stefan Monnier
f49d1f52b2 Merge from emacs-23 2010-12-13 10:27:36 -05:00
Stefan Monnier
f07a954eeb Make the effect of (defvar foo) local.
* src/eval.c (apply_lambda): Make static.  Remove eval_flag arg.
(Fsetq): Don't check declared_special.
(Fdefun, Fdefmacro): Use Ffunction.
(Fdefvar): Don't set declared_special for (defvar foo).
(FletX): Check locally-special vars.  Only do specbind once.
(Flet): Check locally-special vars.
(Feval): Don't check declared_special.
(funcall_lambda): Check locally-special vars.
* src/lisp.h (apply_lambda): Remove extern declaration.
* src/lread.c (readevalloop): CSE.
* lisp/subr.el (with-lexical-binding): Remove.
2010-12-12 23:04:15 -05:00
Eli Zaretskii
11aad4e9f9 subr.el (posn-col-row): Evaluate header-line-format in the context of
the POSITION window's buffer.
2010-12-12 22:45:57 +02:00
Glenn Morris
5612fd086e Doc fixes.
* lisp/subr.el (member-ignore-case, run-mode-hooks, insert-for-yank-1)
(with-silent-modifications): Doc fixes.
2010-12-10 18:34:55 -08:00
Stefan Monnier
2c302df3a1 Merge from trunk 2010-12-10 19:13:08 -05:00
Chong Yidong
74194465d7 Doc fix for posn-* functions (Bug#7471).
* lisp/subr.el (posn-x-y, posn-object-x-y, posn-object-width-height):
Doc fix (Bug#7471).
2010-12-04 19:43:18 -05:00
Stefan Monnier
7f0ea0ffc9 * lisp/subr.el (with-demoted-errors): Distinguish symbols from strings. 2010-12-03 18:20:27 -05:00
Stefan Monnier
4a47c27573 Merge from emacs-23 2010-11-17 22:54:14 -05:00
Eli Zaretskii
e68afd742f subr.el (posn-col-row): Pay attention to header line. (Bug#7390) 2010-11-13 23:07:58 +02:00