1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-17 17:58:46 +00:00
Commit Graph

99855 Commits

Author SHA1 Message Date
Paul Eggert
163c5f3291 * fileio.c (Finsert_file_contents): Remove unnecessary code checking fd. 2011-04-02 01:43:04 -07:00
Paul Eggert
2a47c44da2 * fileio.c (Finsert_file_contents): Avoid signed integer overflow. 2011-04-02 01:00:56 -07:00
Paul Eggert
a37c69bff6 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
Check for integer overflow on size calculations.
2011-04-02 00:40:13 -07:00
Paul Eggert
328ab8e7b5 * buffer.c (Fprevious_overlay_change): Remove var that is set
but not used.
2011-04-02 00:36:27 -07:00
Paul Eggert
6b043475f6 * keyboard.c (timer_check_2): Mark vars as initialized. 2011-04-02 00:34:01 -07:00
Paul Eggert
8d84a6ebe0 * keyboard.c (timer_check_2): Don't assume timer-list and idle-timer-list are lists. 2011-04-02 00:21:52 -07:00
Jan Djärv
8c74fcbddb * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or later.
Fixes: debbugs:8403
2011-04-02 09:11:00 +02:00
Paul Eggert
03733ee728 Add Bug#. 2011-04-02 00:06:05 -07:00
Paul Eggert
e5a2a5cbf4 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
Remove vars that are set but not used.
2011-04-01 19:42:05 -07:00
Paul Eggert
a60e5f6862 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized. 2011-04-01 19:39:52 -07:00
Paul Eggert
35fa624fb2 * image.c (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable. 2011-04-01 19:38:27 -07:00
Paul Eggert
f661cb610a * image.c (lookup_image): Remove var that is set but not used. 2011-04-01 19:36:48 -07:00
Paul Eggert
f0397f5aa3 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
that are set but not used.
2011-04-01 19:25:18 -07:00
Paul Eggert
8664db0623 * xfns.c (make_invisible_cursor): Don't return garbage
if XCreateBitmapFromData fails.
2011-04-01 19:06:43 -07:00
Paul Eggert
6abdaa4a9f * xselect.c (x_get_local_selection, x_handle_property_notify):
Remove vars that are set but not used.

(make_invisible_cursor): Initialize a possibly-uninitialized variable.
2011-04-01 19:02:18 -07:00
Juanma Barranquero
9952e40bd8 lisp/url/url-cookie.el: Use dolist' rather than mapcar'. 2011-04-02 01:24:21 +02:00
Juanma Barranquero
26b51db565 lisp/progmodes/idlwave.el: Use dolist' rather than mapcar'. 2011-04-02 00:33:37 +02:00
Paul Eggert
0ce7538dd2 * xfns.c (x_create_tip_frame): Remove var that is set but not used. 2011-04-01 13:30:45 -07:00
Paul Eggert
8e48d7bc3f * make-docfile.c (IF_LINT): New macro, copied from emacsclient.c.
(write_c_args): Use it to suppress GCC warning.
2011-04-01 13:28:50 -07:00
Paul Eggert
6ddae4efd9 Merge from mainline. 2011-04-01 13:19:36 -07:00
Paul Eggert
0b918413f3 * xterm.c (scroll_bar_windows_size): Now size_t, not int.
(x_send_scroll_bar_event): Use size_t, not int, for sizes.
Check for overflow.
2011-04-01 13:14:03 -07:00
Paul Eggert
9ae848fc4a * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
Remove var that is set but not used.
2011-04-01 10:44:26 -07:00
Paul Eggert
a5a62657a2 * xfaces.c (realize_named_face): Remove vars that are set but not used.
(map_tty_color) [!defined MSDOS]: Likewise.
2011-04-01 10:41:46 -07:00
Paul Eggert
5c5cdd398e * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning. 2011-04-01 10:34:25 -07:00
Paul Eggert
66ebf9838b * coding.c: Remove vars that are set but not used.
(DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
All callers changed.
(decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
(decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
(decode_coding_charset): Remove vars that are set but not used.
2011-04-01 10:20:24 -07:00
Stefan Monnier
034086489c Merge from lexical-binding branch.
* doc/lispref/eval.texi (Eval): Discourage the use of `eval'.
Document its new `lexical' argument.

* doc/lispref/variables.texi (Defining Variables): Mention the new meaning of `defvar'.
(Lexical Binding): New sub-section.

* lisp/Makefile.in (BIG_STACK_DEPTH, BIG_STACK_OPTS, BYTE_COMPILE_FLAGS):
New variables.
(compile-onefile, .el.elc, compile-calc, recompile): Use them.
(COMPILE_FIRST): Add macroexp and cconv.
* lisp/makefile.w32-in: Mirror changes in Makefile.in.

* lisp/vc/cvs-status.el:
* lisp/vc/diff-mode.el:
* lisp/vc/log-edit.el:
* lisp/vc/log-view.el:
* lisp/vc/smerge-mode.el:
* lisp/textmodes/bibtex-style.el:
* textmodes/css.el:
* lisp/startup.el:
* lisp/uniquify.el:
* lisp/minibuffer.el: 
* lisp/newcomment.el: 
* lisp/reveal.el: 
* lisp/server.el: 
* lisp/mpc.el: 
* lisp/emacs-lisp/smie.el: 
* lisp/doc-view.el: 
* lisp/dired.el: 
* lisp/abbrev.el: Use lexical binding.

* lisp/custom.el (custom-initialize-default, custom-declare-variable):
Use `defvar'.

* lisp/files.el (lexical-binding): Declare safe.

* lisp/help-fns.el (help-split-fundoc): Return nil if there's nothing else
than the arglist.
(help-add-fundoc-usage): Don't add `Not documented'.
(help-function-arglist): Handle closures, subroutines, and new
byte-code-functions.
(help-make-usage): Remove leading underscores.
(describe-function-1): Handle closures.
(describe-variable): Use special-variable-p for completion.

* lisp/simple.el (with-wrapper-hook, apply-partially): Move to subr.el.

* lisp/subr.el (apply-partially): Use new closures rather than CL.
(--dolist-tail--, --dotimes-limit--): Don't declare dynamic.
(dolist, dotimes): Use slightly different expansion for lexical code.
(functionp): Move to C.
(letrec): New macro.
(with-wrapper-hook): Use it and apply-partially instead of CL.
(eval-after-load): Preserve lexical-binding.
(save-window-excursion, with-output-to-temp-buffer): Turn them
into macros.

* lisp/emacs-lisp/advice.el (ad-arglist): Use help-function-arglist.

* lisp/emacs-lisp/autoload.el (make-autoload): Don't burp on trivial macros.

* lisp/emacs-lisp/byte-opt.el: Use lexical binding.
(byte-inline-lapcode): Remove (to bytecomp).
(byte-compile-inline-expand): Pay attention to inlining to/from
lexically bound code.
(byte-compile-unfold-lambda): Don't handle byte-code-functions
any more.
(byte-optimize-form-code-walker): Don't handle save-window-excursion
any more and don't call compiler-macros.
(byte-compile-splice-in-already-compiled-code): Remove.
(byte-code): Don't inline any more.
(disassemble-offset): Receive `bytes' as argument rather than via
dynamic scoping.
(byte-compile-tag-number): Declare before first use.
(byte-decompile-bytecode-1): Handle new byte-codes, don't change
`return' even if make-spliceable.
(byte-compile-side-effect-and-error-free-ops): Add stack-ref, remove
obsolete interactive-p.
(byte-optimize-lapcode): Optimize new lap-codes.
Don't trip up on new form of `byte-constant' lap code.

* lisp/emacs-lisp/byte-run.el (make-obsolete): Don't set the `byte-compile'
handler any more.

* lisp/emacs-lisp/bytecomp.el: Use lexical binding instead of
a "bytecomp-" prefix.  Macroexpand everything as a separate phase.
(byte-compile-initial-macro-environment):
Handle declare-function here.
(byte-compile--lexical-environment): New var.
(byte-stack-ref, byte-stack-set, byte-discardN)
(byte-discardN-preserve-tos): New lap codes.
(byte-interactive-p): Don't use any more.
(byte-compile-push-bytecodes, byte-compile-push-bytecode-const2):
New macros.
(byte-compile-lapcode): Use them and handle new lap codes.
(byte-compile-obsolete): Remove.
(byte-compile-arglist-signature): Handle new byte-code arg"lists".
(byte-compile-arglist-warn): Check late def of inlinable funs.
(byte-compile-cl-warn): Don't silence warnings for compiler-macros
since they should have been expanded by now.
(byte-compile--outbuffer): Rename from bytecomp-outbuffer.
(byte-compile-from-buffer): Remove unused second arg.
(byte-compile-preprocess): New function.
(byte-compile-toplevel-file-form): New function to distinguish
file-form calls from outside from file-form calls from hunk-handlers.
(byte-compile-file-form): Simplify.
(byte-compile-file-form-defsubst): Remove.
(byte-compile-file-form-defmumble): Simplify now that
byte-compile-lambda always returns a byte-code-function.
(byte-compile): Preprocess.
(byte-compile-byte-code-maker, byte-compile-byte-code-unmake):
Remove, not used any more.
(byte-compile-arglist-vars, byte-compile-make-lambda-lexenv)
(byte-compile-make-args-desc): New funs.
(byte-compile-lambda): Handle lexical functions.  Always return
a byte-code-function.
(byte-compile-reserved-constants): New var, to make up room for
closed-over variables.
(byte-compile-constants-vector): Obey it.
(byte-compile-top-level): New args `lexenv' and `reserved-csts'.
(byte-compile-macroexpand-declare-function): New function.
(byte-compile-form): Call byte-compile-unfold-bcf to inline immediate
byte-code-functions.
(byte-compile-form): Check obsolescence here.
(byte-compile-inline-lapcode, byte-compile-unfold-bcf): New functions.
(byte-compile-variable-ref): Remove.
(byte-compile-dynamic-variable-op): New fun.
(byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
(byte-compile-variable-set): New funs.
(byte-compile-discard): Add 2 args.
(byte-compile-stack-ref, byte-compile-stack-set)
(byte-compile-make-closure, byte-compile-get-closed-var): New funs.
(byte-compile-funarg, byte-compile-funarg-2): Remove, handled in
macroexpand-all instead.
(byte-compile-quote-form): Remove.
(byte-compile-push-binding-init, byte-compile-not-lexical-var-p)
(byte-compile-bind, byte-compile-unbind): New funs.
(byte-compile-let): Handle let* and lexical binding.
(byte-compile-let*): Remove.
(byte-compile-catch, byte-compile-unwind-protect)
(byte-compile-track-mouse, byte-compile-condition-case):
Handle a new :fun-body form, used for lexical scoping.
(byte-compile-save-window-excursion)
(byte-compile-with-output-to-temp-buffer): Remove.
(byte-compile-defun): Simplify.
(byte-compile-stack-adjustment): New fun.
(byte-compile-out): Use it.
(byte-compile-refresh-preloaded): Don't reload byte-compiler files.

* lisp/emacs-lisp/cconv.el: New file.

* lisp/emacs-lisp/cl-extra.el (cl-macroexpand-all): Properly quote CL
closures.

* lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block)
(cl-byte-compile-throw): Remove.
(cl-block-wrapper, cl-block-throw): Use compiler-macros instead.

* lisp/emacs-lisp/cl.el (pushnew): Silence warning.

* lisp/emacs-lisp/disass.el (disassemble-internal): Handle new
`closure' objects.
(disassemble-1): Handle new byte codes.

* lisp/emacs-lisp/edebug.el (edebug-eval-defun)
(edebug-eval-top-level-form): Use eval-sexp-add-defvars.
(edebug-toggle): Avoid `eval'.

* lisp/emacs-lisp/eieio-comp.el: Remove.

* lisp/emacs-lisp/eieio.el (byte-compile-file-form-defmethod):
Don't autoload.
(eieio-defgeneric-form-primary-only-one): Use `byte-compile' rather
than the internal `byte-compile-lambda'.
(defmethod): Don't hide code under quotes.
(eieio-defmethod): New `code' argument.

* lisp/emacs-lisp/float-sup.el (pi): Don't declare as dynamically bound.

* lisp/emacs-lisp/lisp-mode.el (eval-last-sexp-1):
Use eval-sexp-add-defvars.
(eval-sexp-add-defvars): New fun.

* lisp/emacs-lisp/macroexp.el: Use lexical binding.
(macroexpand-all-1): Check obsolete macros.  Expand compiler-macros.
Don't convert ' to #' without checking that it's indeed quoting
a lambda.

* lisp/emacs-lisp/pcase.el: Don't use destructuring-bind.
(pcase--memoize): Rename from pcase-memoize.  Change weakness.
(pcase): Add `let' pattern.
Change memoization so it actually works.
(pcase-mutually-exclusive-predicates): Add byte-code-function-p.
(pcase--u1) <guard, pred>: Fix possible shadowing problem.
<let>: New case.

* src/alloc.c (Fmake_symbol): Init new `declared_special' field.

* src/buffer.c (defvar_per_buffer): Set new `declared_special' field.

* src/bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
New byte-codes.
(exec_byte_code): New function extracted from Fbyte_code to handle new
calling convention for byte-code-functions.  Add new byte-codes.

* src/callint.c (Fcall_interactively): Preserve lexical-binding mode for
interactive spec.

* src/doc.c (Fdocumentation, store_function_docstring):
* src/data.c (Finteractive_form): Handle closures.

* src/eval.c (Fsetq): Handle lexical vars.
(Fdefun, Fdefmacro, Ffunction): Make closures when needed.
(Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
(FletX, Flet): Obey lexical binding.
(Fcommandp): Handle closures.
(Feval): New `lexical' arg.
(eval_sub): New function extracted from Feval.  Use it almost
everywhere where Feval was used.  Look up vars in lexical env.
Handle closures.
(Ffunctionp): Move from subr.el.
(Ffuncall): Handle closures.
(apply_lambda): Remove `eval_flags'.
(funcall_lambda): Handle closures and new byte-code-functions.
(Fspecial_variable_p): New function.
(syms_of_eval): Initialize the Vinternal_interpreter_environment var,
but without exporting it to Lisp.

* src/fns.c (concat, mapcar1): Accept byte-code-functions.

* src/image.c (parse_image_spec): Use Ffunctionp.

* src/keyboard.c (eval_dyn): New fun.
(menu_item_eval_property): Use it.

* src/lisp.h (struct Lisp_Symbol): New field `declared_special'.

* src/lread.c (lisp_file_lexically_bound_p): New function.
(Fload): Bind Qlexical_binding.
(readevalloop): Remove `evalfun' arg.
Bind Qinternal_interpreter_environment.
(Feval_buffer): Bind Qlexical_binding.
(defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
Mark as dynamic.
(syms_of_lread): Declare `lexical-binding'.

* src/window.c (Ftemp_output_buffer_show): New fun.
(Fsave_window_excursion):
* src/print.c (Fwith_output_to_temp_buffer): Move to subr.el.
2011-04-01 13:19:52 -04:00
Stefan Monnier
7200d79c65 Miscellanous cleanups in preparation for the merge.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Remove debug statement.
* lisp/emacs-lisp/bytecomp.el (byte-compile-single-version)
(byte-compile-version-cond, byte-compile-delay-out)
(byte-compile-delayed-out): Remove, unused.
* src/bytecode.c (Fbyte_code): Revert to old calling convention.
* src/lisp.h (COMPILED_PUSH_ARGS): Remove, unused.
2011-04-01 11:16:50 -04:00
Julien Danjou
1c412c000a mm-view.el (mm-display-inline-fontify): Do not fontify with fundamental-mode. 2011-04-01 14:24:22 +00:00
Eli Zaretskii
0f0c1f27a9 Add a new command `info-display-manual'.
lisp/info.el (info-display-manual): New function.
2011-04-01 13:10:47 +03:00
Paul Eggert
1be4d76143 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
that is set but not used.
2011-04-01 00:18:17 -07:00
Paul Eggert
1f7196bf92 Add Bug#. 2011-04-01 00:15:34 -07:00
Paul Eggert
47553fa8f1 * print.c (print_object): Remove var that is set but not used. 2011-04-01 00:13:23 -07:00
Paul Eggert
fdb6180492 Fix dependencies. 2011-03-31 23:38:52 -07:00
Paul Eggert
d1fdcab742 Replace two copies of readlink code with single gnulib version. 2011-03-31 23:28:48 -07:00
Paul Eggert
63139bfa89 lib/stdio.in.h, m4/gnulib-common.m4: Regenerate from latest gnulib. 2011-03-31 23:07:33 -07:00
Juanma Barranquero
e2abce014d src/xdisp.c (redisplay_internal): Fix prototype. 2011-03-31 21:42:38 +02:00
Eli Zaretskii
d0f6953314 etc/NEWS: Reflect new behavior due to 2011-03-31T19:12:30Z!eliz@gnu.org. 2011-03-31 21:28:26 +02:00
Eli Zaretskii
63696a737c Fix bug #6671 with recentering and other scrolling problems.
src/xdisp.c (SCROLL_LIMIT): New macro.
 (try_scrolling): Use it when setting scroll_limit.  Limit
 scrolling to 100 screen lines.
 (redisplay_window): Even when falling back on "recentering",
 position point in the window according to scroll-conservatively,
 scroll-margin, and scroll-*-aggressively variables.
 (try_scrolling): When point is above the window, allow searching
 as far as scroll_max, or one screenful, to compute vertical
 distance from PT to the scroll margin position.  This prevents
 try_scrolling from unnecessarily failing when
 scroll-conservatively is set to a value slightly larger than the
 window height.  Clean up the case of PT below the margin at bottom
 of window: scroll_max can no longer be INT_MAX.  When aggressive
 scrolling is in use, don't let point enter the opposite scroll
 margin as result of the scroll.
 (syms_of_xdisp) <scroll-conservatively>: Document the
 threshold of 100 lines for never-recentering scrolling.

 doc/emacs/display.texi (Auto Scrolling): Document the limit of 100 lines
 for never-recentering scrolling with `scroll-conservatively'.
2011-03-31 21:12:30 +02:00
Stefan Monnier
c82b2579f0 * lisp/loadup.el: Load minibuffer after loaddefs, to use define-minor-mode. 2011-03-31 11:17:06 -04:00
Lars Magne Ingebrigtsen
d5b686dc30 gnus-sum.el (gnus-update-marks): Revert intersection change, which made marks not propagate, again. 2011-03-31 13:31:56 +00:00
Tassilo Horn
221ddf68cb * net/rcirc.el (rcirc-handler-001): Only authenticate, if there's
an entry for that server in rcirc-authinfo. (Bug#8385)
2011-03-31 14:19:17 +02:00
Glenn Morris
e040639fd9 * lisp/progmodes/f90.el (f90-find-tag-default): Handle multiple `%'. 2011-03-31 00:20:38 -07:00
Stefan Monnier
40d83b412f Merge from trunk 2011-03-31 00:24:03 -04:00
Glenn Morris
cba6e77ef3 * lisp/generic-x.el (etc-fstab-generic-mode): Add ext4, sysfs keywords. 2011-03-30 19:11:34 -07:00
Juanma Barranquero
e4cc2dfc38 src/xdisp.c: Remove unused parameters.
* dispextern.h (move_it_by_lines):
* xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
  since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
  (message_log_check_duplicate): Remove parameters `prev_bol' and
  `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
  (redisplay_internal): Remove parameter `preserve_echo_area',
  unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
* indent.c (Fvertical_motion):
* window.c (window_scroll_pixel_based, Frecenter):
  Don't pass `need_y_p' to `move_it_by_lines'.
2011-03-31 03:37:51 +02:00
Christoph Scholtes
6d0f1c9e55 * progmodes/python.el (python-default-interpreter)
(python-python-command-args, python-jython-command-args)
(python-which-shell, python-which-args, python-which-bufname)
(python-file-queue, python-comint-output-filter-function)
(python-toggle-shells, python-shell): Remove obsolete defcustoms,
variables and functions.
2011-03-30 16:44:07 -06:00
Stefan Monnier
3e2d70fd42 (completion-in-region): Pop down *Completions* automatically.
* lisp/minibuffer.el (completion-table-dynamic): Optimize `boundaries'.
(completion-in-region-mode): New minor mode.
(completion-in-region): Use it.
(completion-in-region--data, completion-in-region-mode-map): New vars.
(completion-in-region--postch): New function.
(completion--capf-misbehave-funs, completion--capf-safe-funs): New vars.
(completion--capf-wrapper): New function.
(completion-at-point): Use it to track well-behavedness of hook functions.
(completion-help-at-point): New command.
2011-03-30 18:25:57 -04:00
Jason Merrill
f3e4086c9d * lisp/vc/add-log.el (add-change-log-entry): Don't use whitespace
syntax class to search for whitespace on a single line
(Message-ID: <4D938140.4030905@redhat.com>).
2011-03-30 17:56:04 -04:00
Eli Zaretskii
09725d2628 Documentation parts of the scroll fix.
src/xdisp.c (syms_of_xdisp) <scroll-conservatively>: Document the
 threshold of 100 lines for never-recentering scrolling.
 doc/emacs/display.texi (Auto Scrolling): Document the limit of 100
 lines for never-recentering scrolling with `scroll-conservatively'.
2011-03-30 22:59:42 +02:00
Stefan Monnier
44f230aa04 * src/eval.c (struct backtrace): Don't cheat with negative numbers, but do
steal a few bits to be more compact.
(interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
Remove unneeded casts.
2011-03-30 15:18:12 -04:00