Dmitry Antipov [Thu, 7 Feb 2013 16:09:04 +0000 (20:09 +0400)]
* coding.c (Fdefine_coding_system_internal): Use AREF where
argument is known to be a vector.
* fns.c (Flocale_info): Likewise for ASET.
* xselect.c (selection_data_to_lisp_data): Likewise for ASET.
* w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
* src/nsmenu.m (update_frame_tool_bar): Check for negative tool bar
height.
* src/nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
(EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
updateCollectionBehaviour.
* src/nsterm.m (NEW_STYLE_FS): Remove.
(ns_last_use_native_fullscreen): New variable.
(x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
(x_set_window_size): Do not take title bar and tool bar into account
if isFullscreen returns YES.
(ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
(check_native_fs): New function.
(ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
(ns_term_init): Remove NEW_STYLE_FS.
(updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
and tool bar if isFullscreen returns NO.
(windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
(initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
with HAVE_NATIVE_FS.
(window:willUseFullScreenPresentationOptions:): New method.
(windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
Hide toolbar if not enabled.
(windowDidExitFullScreen:): Call updateCollectionBehaviour.
Restore tool bar if enabled, hide it otherwise (Bug#13444).
(fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
(toggleFullScreen:): If fs_is_native, call toggleFullScreen on
window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
(syms_of_nsterm): Add ns-use-native-fullscreen.
Eli Zaretskii [Mon, 4 Feb 2013 15:39:55 +0000 (17:39 +0200)]
Fix bugs #13623 and 13626 caused by changes in 2013-02-01T07:23:18Z!dmantipov@yandex.ru.
src/xdisp.c (window_buffer_changed): region_showing can be negative,
which still means region is being displayed.
(redisplay_internal): Resurrect code that forced redisplay of the
whole window when showing region and the mark has changed. Record
the new mark position to allow redisplay optimizations.
(display_line): If it->region_beg_charpos is non-zero, set the
window's region_showing member to -1.
src/window.h (struct window) <region_showing>: Declare ptrdiff_t,
not bitfield of 1 bit.
Chong Yidong [Mon, 4 Feb 2013 12:02:25 +0000 (20:02 +0800)]
Merge FFAP's URI-detection code into thingatpt.el.
* lisp/ffap.el: Require thingatpt.
(ffap-url-at-point): Delegate URI detection to thing-at-point.
All URI-valid characters are now recognized.
(ffap-string-at-point): Use use-region-p.
(ffap-url-regexp): Extra character is handled by thing-at-point.
(ffap-string-at-point-mode-alist): Allow parentheses.
(ffap-newsgroup-regexp, ffap-newsgroup-heads, ffap-newsgroup-p):
Convert to aliases; code moved to thingatpt.el.
(ffap-gnus-hook): Use setq-local.
* lisp/thingatpt.el: Rewrite the URL detection routines, absorbing some
code from ffap.el.
(thing-at-point-beginning-of-url-regexp): New var.
(thing-at-point-uri-schemes): Update list of URI schemes.
(thing-at-point-url-regexp): Variable deleted.
(thing-at-point-markedup-url-regexp): Disallow newlines.
(thing-at-point-newsgroup-regexp)
(thing-at-point-newsgroup-heads)
(thing-at-point-default-mail-uri-scheme): New variables.
(thing-at-point-bounds-of-url-at-point): Rewrite. Use ffap's
method to find the possible bounds of the URI at point. New
optional argument to find ill-formed URIs.
(thing-at-point-url-at-point): Rewrite. New arguments for finding
ill-formed URIs. Use thing-at-point-bounds-of-url-at-point, and
the scheme-adding heuristics from ffap-url-at-point.
(thing-at-point--bounds-of-well-formed-url): New function. Do
parens matching to decide whether to include parens in the URI
Eric M. Ludlam [Sun, 3 Feb 2013 20:04:46 +0000 (21:04 +0100)]
Update EDE documentation (bug #11441).
* doc/misc/ede.texi (Creating a project): Make ede-new doc less
specific, and only about items it supports, indicating that there
might be more. Remove refs to simple project and direct automake
from ede new.
(Simple projects): Re-write to not talk about ede-simple-project
which is deprecated, and instead use the term to mean projects
that don't do much management, just project wrapping. Add
ede-generic-project link.
(ede-generic-project): New node (bug#11441).
Michael Albinus [Sun, 3 Feb 2013 16:49:37 +0000 (17:49 +0100)]
* net/tramp.el (tramp-debug-message): Extend function exclude list.
(tramp-backtrace): New defun.
(tramp-handle-insert-file-contents): Use `visit' when inserting
the local copy.
* net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime): Use
`remote-file-name-inhibit-cache'.
Paul Eggert [Sat, 2 Feb 2013 19:18:00 +0000 (11:18 -0800)]
Avoid file time stamp bug on MS-Windows.
* fileio.c (Fwrite_region): Don't use the heuristic on empty files,
as FAT32 doesn't update time stamps when truncating them.
Also, check that a file time stamp is not a multiple of 100 ns;
this should catch all instances of the problem on MS-Windows,
as its native file system resolution is 100 ns or worse, and
checking for a non-multiple of 100 ns should impose only a small
overhead on systems with ns resolution.
Alan Mackenzie [Sat, 2 Feb 2013 18:24:10 +0000 (18:24 +0000)]
Fix bug in the state cache mechanism. Remove 'BOD "strategy". Refactor.
cc-engine.el (c-get-fallback-scan-pos): Remove.
(c-parse-state-get-strategy): Don't return 'BOD any more.
(c-append-lower-brace-pair-to-state-cache): Extra parameter HERE instead
of narrowing. Widen to top of buffer before searching backwards for a
brace pair.
(c-state-push-any-brace-pair): Add HERE parameter to function call.
(c-append-to-state-cache): Extra parameter HERE in place of narrowing.
Narrow to parameter HERE, in place of being called narrowed.
(c-remove-stale-state-cache): Extra parameter HERE in place of narrowing.
Check there's an open brace in the cache before searching for its match.
(c-invalidate-state-cache-1): Add HERE parameter to function call.
(c-parse-state-1): Don't narrow here for 'forward strategy, instead
passing extra parameter HERE to several functions. Remove 'BOD strategy.
Eli Zaretskii [Sat, 2 Feb 2013 17:14:24 +0000 (19:14 +0200)]
Avoid encoding file names run through dostounix_filename on MS-Windows.
src/w32.c (normalize_filename): Accept an additional argument
MULTIBYTE; if non-zero, traverse the file name by bytes and don't
downcase it even if w32-downcase-file-names is non-nil.
(dostounix_filename): Accept an additional argument MULTIBYTE and
pass it to normalize_filename.
(emacs_root_dir): Adjust.
src/msdos.h (dostounix_filename): Adjust prototype.
src/w32.h (dostounix_filename): Adjust prototype.
src/msdos.c (dostounix_filename): Accept an additional argument and
ignore it.
(init_environment): Adjust callers of dostounix_filename.
src/fileio.c (Ffile_name_directory, file_name_as_directory)
(directory_file_name, Fexpand_file_name)
(Fsubstitute_in_file_name): [DOS_NT] Adjust call to
dostounix_filename.
[WINDOWSNT]: Downcase file names if w32-downcase-file-names is
non-nil.
(Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
variables, as egetenv is case-insensitive for DOS_NT.
src/dired.c (file_name_completion): Don't call Fdirectory_file_name
with an encoded file name.
src/w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust
calls to dostounix_filename.
src/w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
src/unexw32.c (unexec): Adjust call to dostounix_filename.
src/termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
src/emacs.c (decode_env_path) [DOS_NT]: Adjust call to
dostounix_filename.
src/callproc.c (Fcall_process) [MSDOS]: Adjust call to
dostounix_filename.
Stefan Monnier [Fri, 1 Feb 2013 23:40:55 +0000 (18:40 -0500)]
* lisp/mouse.el (mouse-drag-track): Always deactivate the mark before
running the final event's command since that command is in charge of
activating the mark if needed.
Juri Linkov [Fri, 1 Feb 2013 23:38:41 +0000 (01:38 +0200)]
* lisp/replace.el (perform-replace): Move let-bindings of isearch-*
variables deeper to the loop that searches for the next match.
Add bindings for `isearch-nonincremental' and `isearch-adjusted'.
Use `isearch-search-fun-default' instead of `isearch-search-fun'.
* lisp/isearch.el (isearch-search-fun-default): Check for null
first element of isearch-cmds as a precaution when it's used
with inactive isearch.
Paul Eggert [Fri, 1 Feb 2013 20:51:12 +0000 (12:51 -0800)]
Fix timestamp bug when write-region appends nothing.
* fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
the file's time stamp doesn't change if Emacs happens to write nothing
to the file, and on a buggy file system this could cause Emacs to
incorrectly infer that the file system doesn't have the bug.
Avoid this problem by inhibiting the inference in this case.
Eli Zaretskii [Fri, 1 Feb 2013 10:15:36 +0000 (12:15 +0200)]
Make sure program names are encoded before using them to invoke subprocesses.
src/callproc.c (Fcall_process): Make sure program name in PATH and
new_argv[0] is encoded, if needed. Otherwise, un-encoded string
is passed to exec/spawnve, which fails unless the file-name
encoding is UTF-8.
Alex Harsanyi [Fri, 1 Feb 2013 07:28:10 +0000 (08:28 +0100)]
* net/soap-client.el (soap-invoke): Encode the string for
`url-request-data' as UTF-8. Fixes
<http://code.google.com/p/emacs-soap-client/issues/detail?id=16>.
Paul Eggert [Fri, 1 Feb 2013 06:30:51 +0000 (22:30 -0800)]
Use fdopendir, fstatat and readlinkat, for efficiency.
On my host, this speeds up directory-files-and-attributes by a
factor of 3, when applied to Emacs's src directory.
These functions are standardized by POSIX and are common these
days; fall back on a (slower) gnulib implementation if the host
is too old to supply them.
* .bzrignore: Add lib/dirent.h.
* lib/Makefile.am (libgnu_a_SOURCES): Add openat-die.c, save-cwd.c.
* lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib,
incorporating: 2013-01-29 careadlinkat: do not provide careadlinkatcwd.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openat-priv.h:
* lib/openat-proc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4:
* m4/fstatat.m4: New files, from gnulib.
* lib/openat-die.c, lib/save-cwd.c, lib/save-cwd.h: New files.
These last three are specific to Emacs and are not copied from gnulib.
They are simpler than the gnulib versions and are tuned for Emacs.
* admin/merge-gnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat.
(GNULIB_TOOL_FLAGS): Do not avoid at-internal, openat-h.
Avoid dup, open, opendir.
* nt/inc/sys/stat.h (fstatat):
* nt/inc/unistd.h (readlinkat): New decls.
* src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
* src/dired.c: Include <fcntl.h>.
(open_directory): New function, which uses open and fdopendir
rather than opendir. DOS_NT platforms still use opendir, though.
(directory_files_internal, file_name_completion): Use it.
(file_attributes): New function, with most of the old Ffile_attributes.
(directory_files_internal, Ffile_attributes): Use it.
(file_attributes, file_name_completion_stat): First arg is now fd,
not dir name. All uses changed. Use fstatat rather than lstat +
stat.
(file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
* src/fileio.c: Include <allocator.h>, <careadlinkat.h>.
(emacs_readlinkat): New function, with much of the old
Ffile_symlink_p, but with an fd argument for speed.
It uses readlinkat rather than careadlinkatcwd, so that it
need not assume the working directory.
(Ffile_symlink_p): Use it.
* src/filelock.c (current_lock_owner): Use emacs_readlinkat
rather than emacs_readlink.
* src/lisp.h (emacs_readlinkat): New decl.
(READLINK_BUFSIZE, emacs_readlink): Remove.
* src/sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
(emacs_norealloc_allocator, emacs_readlink): Remove.
This stuff is moved to fileio.c.
* src/w32.c (fstatat, readlinkat): New functions.
(careadlinkat): Don't check that fd == AT_FDCWD.
(careadlinkatcwd): Remove; no longer needed.
Michael Albinus [Thu, 31 Jan 2013 08:33:03 +0000 (09:33 +0100)]
* net/tramp.el (tramp-tramp-file-p): Comment check for
`string-as-unibyte'. The function does not exist on XEmacs, and
likely we need another approach.
* net/tramp-sh.el (tramp-compute-multi-hops): Check, whether
`tramp-gw-*' variables are bound.
Glenn Morris [Thu, 31 Jan 2013 06:35:45 +0000 (22:35 -0800)]
Reduce delay between backing up a file and saving new version
* lisp/files.el (basic-save-buffer-2):
Choose coding system for writing the file before backing it up.
* src/fileio.c (choose_write_coding_system): Make it callable from Lisp.
(Fwrite_region): If coding-system-for-write is set, don't call
choose_write_coding_system.
Move the last piece of choose_write_coding_system here.
(syms_of_fileio): Add choose-write-coding-system.
Stefan Monnier [Thu, 31 Jan 2013 01:58:24 +0000 (20:58 -0500)]
* lisp/progmodes/opascal.el: Rename from delphi.el. Use lexical-binding.
(opascal-newline-always-indents): Remove custom.
(opascal-tab, opascal-newline): Remove commands.
(opascal-new-comment-line): Insert "\n" instead of calling newline.
(opascal-mode-map): Keep default bindings for RET and TAB and DEL.
(opascal-save-match-data): Remove, use save-match-data instead.
(opascal-save-state): Use with-silent-modifications.
Juri Linkov [Wed, 30 Jan 2013 23:50:11 +0000 (01:50 +0200)]
* lisp/frame.el (toggle-frame-maximized, toggle-frame-fullscreen):
Use fullboth as an alias for fullscreen. Suggested by Jan Djärv in
<http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00203.html>.
Stefan Monnier [Wed, 30 Jan 2013 20:46:10 +0000 (15:46 -0500)]
* lisp/progmodes/make-mode.el (makefile-backslash-region): Don't compute
column if we're just deleting the backslashes.
(makefile-fill-paragraph): Use eolp.
Glenn Morris [Wed, 30 Jan 2013 17:14:24 +0000 (09:14 -0800)]
mouse-drag-line changes for mouse-1 in header-line
* lisp/mouse.el (mouse-drag-line): Avoid pushing same event onto
unread-command-events twice in some cases. This tries to implement
the 2012-07-26 changes in a different way.