Barry O'Reilly [Wed, 11 Sep 2013 05:03:23 +0000 (01:03 -0400)]
Change comparison functions =, <, >, <=, >= to take many arguments.
* src/data.c: Change comparison functions' interface and
implementation
* src/lisp.h: Make arithcompare available for efficient two arg
comparisons
* src/bytecode.c: Use arithcompare
* src/fileio.c: Use new interface
* test/automated/data-tests.el: New tests for comparison functions
* etc/NEWS
Stefan Monnier [Wed, 11 Sep 2013 03:31:56 +0000 (23:31 -0400)]
Use define-derived-mode (and derived-mode-p).
* lisp/play/snake.el (snake-mode):
* lisp/play/mpuz.el (mpuz-mode):
* lisp/play/landmark.el (lm-mode):
* lisp/play/blackbox.el (blackbox-mode):
* lisp/play/5x5.el (5x5-mode):
* lisp/obsolete/options.el (Edit-options-mode):
* lisp/net/quickurl.el (quickurl-list-mode):
* lisp/net/newst-treeview.el (newsticker-treeview-mode):
* lisp/mail/rmailsum.el (rmail-summary-mode):
* lisp/mail/mspools.el (mspools-mode):
* lisp/locate.el (locate-mode):
* lisp/ibuffer.el (ibuffer-mode):
* lisp/emulation/ws-mode.el (wordstar-mode):
* lisp/emacs-lisp/debug.el (debugger-mode):
* lisp/array.el (array-mode):
* lisp/net/eudc.el (eudc-mode): Use define-derived-mode.
* lisp/net/mairix.el (mairix-searches-mode-font-lock-keywords):
Move initialization into declaration.
(mairix-searches-mode): Use define-derived-mode.
* lisp/net/eudc-hotlist.el (eudc-hotlist-mode): Use define-derived-mode.
(eudc-edit-hotlist): Use dolist.
* lisp/man.el (Man-mode-syntax-table): Rename from man-mode-syntax-table.
(Man-mode): Use define-derived-mode.
* lisp/info.el (Info-edit-mode-map): Rename from Info-edit-map.
(Info-edit-mode): Use define-derived-mode.
(Info-cease-edit): Use Info-mode.
* lisp/eshell/esh-mode.el (eshell-mode-syntax-table): Move initialization
into declaration.
(eshell-mode): Use define-derived-mode.
* lisp/chistory.el (command-history-mode-map): Rename from
command-history-map.
(command-history-mode): Use define-derived-mode.
* lisp/calc/calc.el (calc-trail-mode-map): New var.
(calc-trail-mode): Use define-derived-mode.
(calc-trail-buffer): Set calc-main-buffer manually.
* lisp/bookmark.el (bookmark-insert-annotation): New function.
(bookmark-edit-annotation): Use it.
(bookmark-edit-annotation-mode): Make it a proper major mode.
(bookmark-send-edited-annotation): Use derived-mode-p.
* lisp/arc-mode.el (archive-mode): Move kill-all-local-variables a tiny bit
closer to its ideal place. Use \' to match EOS.
* lisp/cedet/semantic/grammar.el (semantic-grammar-mode): Use define-derived-mode.
(semantic-grammar-mode-syntax-table): Rename from
semantic-grammar-syntax-table.
(semantic-grammar-mode-map): Rename from semantic-grammar-map.
* lisp/cedet/data-debug.el (data-debug-mode-map): Rename from data-debug-map.
(data-debug-mode): Use define-derived-mode.
* lisp/gnus/score-mode.el (gnus-score-mode-map): Move initialization
into declaration.
(gnus-score-mode): Use define-derived-mode.
* lisp/gnus/gnus-srvr.el (gnus-browse-mode): Use define-derived-mode.
* lisp/gnus/gnus-kill.el (gnus-kill-file-mode-map): Move initialization
into declaration.
(gnus-kill-file-mode): Use define-derived-mode.
(gnus-kill-file-edit-file, gnus-kill-file-enter-kill, gnus-kill):
Use derived-mode-p.
* lisp/gnus/gnus-group.el (gnus-group-mode): Use define-derived-mode.
(gnus-group-setup-buffer, gnus-group-name-at-point)
(gnus-group-make-web-group, gnus-group-enter-directory)
(gnus-group-suspend): Use derived-mode-p.
* lisp/gnus/gnus-cus.el (gnus-custom-mode): Use define-derived-mode.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode): Use define-derived-mode.
* lisp/gnus/gnus-art.el (gnus-article-mode): Use define-derived-mode.
(gnus-article-setup-buffer, gnus-article-prepare)
(gnus-article-prepare-display, gnus-sticky-article)
(gnus-kill-sticky-article-buffer, gnus-kill-sticky-article-buffers)
(gnus-bind-safe-url-regexp, gnus-article-check-buffer)
(gnus-article-read-summary-keys): Use derived-mode-p.
Review and drop old frame resize hack.
* frame.h (struct frame): Remove force_flush_display_p.
* dispnew.c (update_frame): Adjust user and don't call
flush_frame here. The comment has said that there was an issues
with redisplaying fringes, but I don't see any differences with
and without this hack. Hopefully we can continue without it.
* xdisp.c (clear_garbaged_frames): Adjust user and do not clear
current frame matrices twice if resized_p is set.
Do not populate pure Xism x_sync to other ports.
* frame.h (x_sync): Move under HAVE_X_WINDOWS.
* frame.c (other_visible_frames) [HAVE_X_WINDOWS]: Use as such.
* nsfns.m, w32xfns.c (x_sync): Remove no-op.
* w32term.h (x_sync): Remove prototype.
Cleanup frame flushing.
* dispextern.h (struct redisplay_interface): Drop
flush_display_optional because flush_display is enough
for X and flushing via RIF is just a no-op for others.
* frame.h (flush_frame): New function.
* dispnew.c (update_frame):
* minibuf.c (read_minibuf):
* xdisp.c (echo_area_display, redisplay_preserve_echo_area):
Use it.
* keyboard.c (detect_input_pending_run_timers): Do not flush
all frames but selected one in redisplay_preserve_echo_area.
* nsterm.m (ns_flush): Remove no-op.
(ns_redisplay_interface): Adjust user.
* w32term.h (x_flush): Remove no-op.
(w32_redisplay_interface): Adjust user.
* xterm.c (x_flush): Simplify because we do not flush all
frames at once any more. Adjust comment.
(x_redisplay_interface): Adjust user.
* configure.ac (LDFLAGS_NOCOMBRELOC): New variable.
(LDFLAGS): Move nocombreloc option from here...
(LD_SWITCH_SYSTEM_TEMACS): ... to here.
This is an essential option that should not be in LDFLAGS,
because the user may override that at build time; eg
http://bugs.debian.org/684788. temacs is the only thing
that actually needs this option; this is where it was orginally:
http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-03/msg00170.html
Michael Albinus [Sun, 8 Sep 2013 15:04:10 +0000 (17:04 +0200)]
Improve compatibility with older Emacsen, and XEmacs.
* net/tramp.el (tramp-find-method, tramp-find-user): Call `propertize'
only if it is bound. It isn't for XEmacs.
(with-tramp-progress-reporter): Do not let-bind `result'. This
yields to scoping errors in XEmacs.
(tramp-handle-make-auto-save-file-name): New function, moved from
tramp-sh.el.
* net/tramp-adb.el (tramp-adb-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
(tramp-adb--gnu-switches-to-ash): Use
`tramp-compat-replace-regexp-in-string'.
* net/tramp-cache.el (tramp-cache-print): Call
`substring-no-properties' only if it is bound. It isn't for XEmacs.
* net/tramp-cmds.el (tramp-bug): Call `propertize' only if it is
bound. It isn't for XEmacs.
* net/tramp-compat.el (tramp-compat-copy-file): Catch
`wrong-number-of-arguments' error.
(tramp-compat-replace-regexp-in-string): New defun.
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
(tramp-gvfs-handle-copy-file): Use `tramp-compat-funcall' for
`copy-file'.
(tramp-gvfs-file-gvfs-monitor-file-process-filter)
(tramp-gvfs-file-name): Use `tramp-compat-replace-regexp-in-string'.
(tramp-synce-list-devices): Use `push' instead of `pushnew'.
* net/tramp-gw.el (tramp-gw-open-network-stream): Use
`tramp-compat-replace-regexp-in-string'.
* net/tramp-sh.el (tramp-sh-file-name-handler-alist): Call
`tramp-handle-make-auto-save-file-name'.
(tramp-sh-handle-make-auto-save-file-name): Move to tramp.el.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
(tramp-sh-file-inotifywait-process-filter): Use
`tramp-compat-replace-regexp-in-string'.
(tramp-compute-multi-hops): Use `push' instead of `pushnew'.
* net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
(tramp-smb-handle-copy-directory): Call
`tramp-compat-replace-regexp-in-string'.
(tramp-smb-get-file-entries): Use `push' instead of `pushnew'.
(tramp-smb-handle-copy-file): Improve error message.
(tramp-smb-handle-rename-file): Rename directly only in case
`newname' does not exist yet. This is a restriction of smbclient.
(tramp-smb-maybe-open-connection): Rerun the function only when
`auth-sources' is non-nil.
Alan Mackenzie [Sat, 7 Sep 2013 14:33:50 +0000 (14:33 +0000)]
Correctly fontify Java class constructors.
* progmodes/cc-langs.el (c-type-decl-suffix-key): Now matches ")"
in Java Mode.
(c-recognize-typeless-decls): Set the Java value to t.
* progmodes/cc-engine.el (c-forward-decl-or-cast-1): While
handling a "(", add a check for, effectively, Java, and handle a
"typeless" declaration there.
Paul Eggert [Sat, 7 Sep 2013 00:20:56 +0000 (17:20 -0700)]
Port --without-x --enable-gcc-warnings to Fedora 19.
* configure.ac (WERROR_CFLAGS): Omit redundant use of
-Wmissing-field-initializers, -Wswitch, -Wtype-limits,
-Wunused-parameter. If there is no window system, also omit
-Wsuggest-attribute=const and -Wsuggest-attribute=noreturn; this
is needed for Fedora 19.
* src/gfilenotify.c (globals_of_gfilenotify):
Call g_type_init only if using an older glib version that needs it.
Stefan Monnier [Fri, 6 Sep 2013 22:46:44 +0000 (18:46 -0400)]
* lisp/minibuffer.el: Make minibuffer-complete call completion-in-region
rather than other way around.
(completion--some, completion-pcm--find-all-completions):
Don't delay signals when debugging.
(minibuffer-completion-contents): Beware fields within the
minibuffer contents.
(completion-all-sorted-completions): Use defvar-local.
(completion--do-completion, completion--cache-all-sorted-completions)
(completion-all-sorted-completions, minibuffer-force-complete):
Add args `beg' and `end'.
(completion--in-region-1): New fun, extracted from minibuffer-complete.
(minibuffer-complete): Use completion-in-region.
(completion-complete-and-exit): New fun, extracted from
minibuffer-complete-and-exit.
(minibuffer-complete-and-exit): Use it.
(completion--complete-and-exit): Rename from
minibuffer--complete-and-exit.
(completion-in-region--single-word): New function, extracted from
minibuffer-complete-word.
(minibuffer-complete-word): Use it.
(display-completion-list): Make `common-substring' argument obsolete.
(completion--in-region): Call completion--in-region-1 instead of
minibuffer-complete.
(completion-help-at-point): Pass boundaries to
minibuffer-completion-help as args rather than via an overlay.
(completion-pcm--string->pattern): Use `any-delim'.
(completion-pcm--optimize-pattern): New function.
(completion-pcm--pattern->regex): Handle `any-delim'.
* lisp/icomplete.el (icomplete-forward-completions)
(icomplete-backward-completions, icomplete-completions):
Adjust calls to completion-all-sorted-completions and
completion--cache-all-sorted-completions.
(icomplete-with-completion-tables): Default to t.
* lisp/emacs-lisp/crm.el (crm--current-element): Rename from
crm--select-current-element. Don't put an overlay but return the
boundaries instead.
(crm--completion-command): Take two new args to bind to the boundaries.
(crm-completion-help): Adjust accordingly.
(crm-complete): Use completion-in-region.
(crm-complete-word): Use completion-in-region--single-word.
(crm-complete-and-exit): Use completion-complete-and-exit.
Juri Linkov [Fri, 6 Sep 2013 20:43:49 +0000 (23:43 +0300)]
* lisp/info.el (Info-display-images-node): When image file doesn't exist
display text version of the image if it's provided in the Info file.
Otherwise, display the location of missing image from SRC attribute.
Add help-echo text property from ALT attribute.
Stefan Monnier [Fri, 6 Sep 2013 15:37:01 +0000 (11:37 -0400)]
* lisp/abbrev.el (edit-abbrevs-mode): Use define-derived-mode.
(edit-abbrevs-mode-map): Rename from edit-abbrevs-map.
* lisp/epa.el (epa--encode-coding-string, epa--decode-coding-string)
(epa--select-safe-coding-system, epa--derived-mode-p): Make it obvious
that it's defined.
(epa-key-list-mode, epa-key-mode, epa-info-mode):
Use define-derived-mode.
* lisp/epg.el (epg-start-encrypt): Minor CSE simplification.
William Xu [Fri, 6 Sep 2013 15:02:40 +0000 (11:02 -0400)]
* lisp/arc-mode.el: Add support for 7za.
(archive-7z-program): New var.
(archive-zip-extract, archive-zip-expunge, archive-zip-update)
(archive-zip-update-case, archive-7z-extract, archive-7z-expunge)
(archive-7z-update, archive-zip-extract, archive-7z-summarize): Use it.
Attempt to make redisplay more selective when changing cursor type.
* frame.h (struct frame): New bitfield cursor_type_changed.
* xdisp.c (cursor_type_changed): Remove.
(try_cursor_movement, redisplay_window, try_window_id)
(set_frame_cursor_types, try_window_reusing_current_matrix):
Adjust to use per-frame bitfield.
(redisplay_internal): Look for cursor type change on each visible
frame and consider all frames if cursor type has been changed on
the frame other than selected. If cursor type has been changed on
selected frame only, do not use fast update.
Attempt to make redisplay more selective when changing fonts.
* frame.h (struct frame): New bitfield fonts_changed.
* dispextern.h (fonts_changed_p, adjust_glyphs): Remove declaration.
(adjust_frame_glyphs): Add prototype.
* dispnew.c (fonts_changed_p): Remove.
(adjust_glyphs): Remove becase we do not
adjust matrices on all frames at once any more.
(adjust_frame_glyphs): Block and unblock input here.
(adjust_glyph_matrix): Use fonts_changed.
(change_frame_size_1): Use adjust_frame_glyphs.
* font.c (font_open_entity): Use fonts_changed.
* frame.c (set_menu_bar_lines, Fmake_terminal_frame):
* w32fns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
* window.c (Fdelete_other_windows_internal, Fwindow_resize_apply)
(Fsplit_window_internal, Fdelete_window_internal, grow_mini_window)
(shrink_mini_window, Fresize_mini_window_internal)
(window_scroll_pixel_based, Fset_window_configuration)
(apply_window_adjustment, Fset_window_vscroll):
* xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
Use adjust_frame_glyphs.
* xdisp.c (redisplay_tool_bar, redisplay_window, try_window)
(try_window_reusing_current_matrix, try_window_id, display_line)
(IT_EXPAND_MATRIX_WIDTH): Use fonts_changed.
(redisplay_internal): Consider fonts_changed and adjust frame
matrices for each frame only if the frame is visible. If font
has been changed on some frame during full redisplay, retry
only visible frames where the font has been actually changed.
Cache current header and mode line height for each window.
* window.h (struct window): New fields mode_line_height
and header_line_height.
* window.c (make_window): Initialize them.
* dispextern.h (CURRENT_MODE_LINE_HEIGHT)
(CURRENT_HEADER_LINE_HEIGHT): Use them. Adjust comment.
(current_mode_line_height, current_header_line_height):
Remove declaration.
* xdisp.c (current_mode_line_height, current_header_line_height):
Remove.
(pos_visible_p, init_xdisp): Adjust user.
(redisplay_window): Invalidate mode_line_height and
header_line_height if current and desired matrices do not agree.
Make --without-x compatible with --enable-gcc-warnings.
* configure.ac: If both --without-x and --enable-gcc-warnings are
specified, use -Wno-unused-variable, -Wno-unused-but-set-variable
and -Wno-unused-but-set-parameter.
* src/font.c (register_font_driver): Move check under HAVE_WINDOW_SYSTEM.
* src/font.h (struct font_driver): Move draw, get_bitmap and free_bitmap
members under HAVE_WINDOW_SYSTEM.
* src/keyboard.c (make_lispy_focus_out): Likewise.
(record_menu_key): Move under HAVE_MENUS.
* src/xdisp.c (toplevel): Move hourglass_shown_p, hourglass_atimer and
THIN_SPACE_WIDTH under HAVE_WINDOW_SYSTEM.
(syms_of_xdisp): Adjust user.
(window_box_edges): Define only if HAVE_WINDOW_SYSTEM.
(start_hourglass, cancel_hourglass):
* src/xfaces.c (toplevel): Likewise with PT_PER_INCH,
clear_font_table_count, CLEAR_FONT_TABLE_COUNT
and CLEAR_FONT_TABLE_NFONTS.
(set_font_frame_param, clear_face_gcs, realize_non_ascii_face):
Declare only if HAVE_WINDOW_SYSTEM.
(lface_same_font_attributes_p, clear_face_gcs): Define only
if HAVE_WINDOW_SYSTEM.
* lisp/international/mule-cmds.el: Require CL.
(find-coding-systems-for-charsets): Avoid add-to-list.
(sanitize-coding-system-list): New function, extracted from
select-safe-coding-system-interactively.
(select-safe-coding-system-interactively): Use it.
(read-input-method-name): Accept symbols for `default'.
* lisp/progmodes/python.el (python-nav-beginning-of-block): Remove unused
var `block-regexp'.
(python-nav--forward-sexp): Remove unused var `re-search-fn'.
(python-fill-string): Remove unused var `marker'.
(python-skeleton-add-menu-items): Remove unused var `items'.
Paul Eggert [Wed, 4 Sep 2013 06:45:44 +0000 (23:45 -0700)]
Makefile improvements.
* Makefile.in (lib): Depend on am--refresh, to avoid a race.
(src): Remove duplicate dependency on FRC.
Invoke just one submake, not two. Avoid the need for 'pwd'.
* lwlib/Makefile.in (all): Put this first. Don't use double-colon
rules, as they are not portable according to POSIX. Mark as phony.
* oldXMenu/Makefile.in (all, tags): Don't use double-colon rules, as they
are not portable according to POSIX. Mark as phony.
* src/Makefile.in (config.status): Don't use double-colon rules, as
they are not portable according to POSIX. Fix shell typo with `;
I guess this rule has never been tested?
(VCSWITNESS): New macro, to override any environment var.
* xterm.h (struct x_display_info): Do not track X connection
fd separately because it is always available from Display.
* xterm.c (x_term_init, x_delete_terminal, x_delete_display):
Adjust users.
* buffer.c (drop_overlay):
* fileio.c (restore_point_unwind): Prefer unchain_marker to
Fset_marker (X, Qnil, ...) (which is the same but a bit slower).