aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Don’t assume -g3 in .gdbinitPaul Eggert2017-08-281-2/+15
| | | | | * src/.gdbinit (EMACS_INT_WIDTH, USE_LSB_TAG): Use reasonable defaults if not in the symbol table.
* Fix previous xterm.h change for non-gtk buildsGlenn Morris2017-08-271-0/+2
| | | | * src/xterm.h (GTK_CHECK_VERSION) [!USE_GTK]: Define it.
* Fix GdkSettings-related deprecation warningsPhilipp Stephani2017-08-271-0/+6
| | | | | | * src/gtkutil.c (xg_initialize): Don’t set deprecated and ignored gtk-menu-bar-accel setting in new versions of GTK+. Use g_object_set instead of deprecated gtk_settngs_set_string_property otherwise.
* Always use gtk_window_move in new versionsPhilipp Stephani2017-08-272-1/+8
| | | | | | | | | | | * src/gtkutil.c (my_log_handler): Don’t define in new versions of GTK+. (xg_set_geometry): Always use gtk_window_move in new versions of GTK+. * src/xterm.c (syms_of_xterm): Document that x-gtk-use-window-move is ignored. * lisp/subr.el (x-gtk-use-window-move): Make obsolete.
* Remove use of a deprecated GTK+ function in new versionsPhilipp Stephani2017-08-271-0/+4
| | | | | * src/gtkutil.c (xg_make_tool_item): Use gtk_widget_set_focus_on_click if available
* Stop using deprecated GdkScreen monitor functions in newer GDKPhilipp Stephani2017-08-271-3/+30
| | | | | * src/xfns.c (Fx_display_monitor_attributes_list): Use GdkMonitor objects instead of the deprecated GdkScreen functions in GDK 3.22+
* Use GdkSeat in new GDK versionsPhilipp Stephani2017-08-271-0/+5
| | | | | * src/gtkutil.c (xg_event_is_for_scrollbar): Use GdkSeat instead of GdkDeviceManager in GDK 3.20+
* * src/xterm.c (XTflash): Don’t use gdk_cairo_create in GDK 3.22+Philipp Stephani2017-08-271-0/+11
|
* Remove call of deprecated GDK functionPhilipp Stephani2017-08-271-7/+12
| | | | | * src/xterm.h (XSync): Don’t call gdk_window_process_all_updates in GDK 3.22 or later.
* Do not munge contents of local symbolic linksPaul Eggert2017-08-261-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This lets Emacs deal with arbitrary local symlinks without mishandling their contents (Bug#28156). For example, (progn (shell-command "ln -fs '~' 'x'") (rename-file "x" "/tmp/x")) now consistently creates a symbolic link from '/tmp/x' to '~'. Formerly, it did that only if the working directory was on the same filesystem as /tmp; otherwise, it expanded the '~' to the user's home directory. * lisp/dired.el (dired-get-filename): Use files--name-absolute-system-p instead of rolling our own code. * lisp/files.el (files--name-absolute-system-p): New function. (file-truename, file-chase-links): Use it to avoid mishandling symlink contents that begin with ~. (copy-directory, move-file-to-trash): Use concat rather than expand-file-name, to avoid mishandling symlink contents that begin with ~. * src/fileio.c (Fmake_symbolic_link): Do not expand leading "~" in the target unless interactive. Strip leading "/:" if interactive. (emacs_readlinkat): Do not prepend "/:" to the link target if it starts with "/" and contains ":" before NUL. * test/src/fileio-tests.el (try-link): Rename from try-char, and accept a string instead of a char. All uses changed. (fileio-tests--symlink-failure): Also test leading ~, and "/:", to test the new behavior.
* Improve doc for file-name-absolute-p.Paul Eggert2017-08-261-2/+2
|
* Fix file-attributes race on GNU hostsPaul Eggert2017-08-253-25/+67
| | | | | | | | | | | | | * doc/lispref/files.texi (File Attributes): Document file-attributes atomicity. * etc/NEWS: Document the fix. * src/dired.c (file_attributes): New args DIRNAME and FILENAME, for diagnostics. All callers changed. On platforms like GNU/Linux that support O_PATH, fix a race condition in file-attributes and similar functions, so that these functions do not return nonsense if a directory entry is replaced while getting its attributes. On non-GNU platforms, do a better (though not perfect) job of detecting the race, and return nil if detected.
* Simplify expand_and_dir_to_filePaul Eggert2017-08-253-59/+30
| | | | | | * src/fileio.c (expand_and_dir_to_file): Simplify by omitting 2nd argument, since in practice it always has the default value. All callers changed. Prefer C99 style decls in nearby code.
* ; * src/w32.c (faccessat): Fix last change. (Bug#28207)Eli Zaretskii2017-08-251-1/+1
|
* Fix file-name completion on network sharesEli Zaretskii2017-08-251-1/+3
| | | | | * src/w32.c (faccessat): Don't assume that F_OK is non-zero. (Bug#28207)
* Prefer ‘double’ for FP temps in xterm.cPaul Eggert2017-08-241-23/+29
| | | | | | | * src/xterm.c (xm_scroll_callback, xaw_jump_callback) (x_set_toolkit_scroll_bar_thumb) (x_set_toolkit_horizontal_scroll_bar_thumb): Prefer ‘double’ to ‘float’ for individual local floating-point temporaries.
* Minor improvements for tramp-interrupt-process, documentationMichael Albinus2017-08-241-2/+2
| | | | | | | | | | | | | * doc/lispref/processes.texi (Signals to Processes): * etc/NEWS: Document interrupt-process-functions. * lisp/net/tramp.el (tramp-interrupt-process): Test also for `process-live-p'. * src/process.c (Vinterrupt_process_functions): Fix docstring. * test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process): Extend test.
* Fix a comment whitespace typo.Reuben Thomas2017-08-231-1/+1
| | | | | src/fileio.c: A double space was added after "..", used in a code example. Make it a single space.
* Use lisp type in log message (bug#28176)Alan Third2017-08-231-1/+2
| | | | * src/nsimage.m (ns_load_image): Use make_number on index.
* Fix PNGs on macOS (bug#28176)Alan Third2017-08-231-26/+40
| | | | | | | | * src/nsimage.m (ns_load_image): Remove index check. (EmacsImage::getAnimatedBitmapImageRep): New function. (EmacsImage::getMetadata): Use getAnimatedBitmapImageRep. (EmacsImage::setFrame): Use getAnimatedBitmapImageRep and check index is valid.
* Add ability to change macOS WM theme (bug#27973)Alan Third2017-08-235-0/+122
| | | | | | | | | | | | | | | | | | | | | | | * src/frame.c (make_frame, frame_parms, syms_of_frame) [NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar options. * src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to represent NSAppearance options. (struct frame) [NS_IMPL_COCOA]: Add ns_appearance and ns_transparent_titlebar frame parameters. * src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add ns_set_appearance and ns_set_transparent_titlebar handlers. (Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar frame parameters. (Qdark): Add new symbol for use with ns-appearance. * src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar) [NS_IMPL_COCOA]: Add prototypes. * src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar) [NS_IMPL_COCOA]: New functions. (initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and ns-transparent-titlebar frame parameters. * doc/lispref/frames.texi (Window Management Parameters): Document ns-apperance and ns-transparent-titlebar.
* ; * src/w32.c: Fix a typo in a comment.Eli Zaretskii2017-08-221-1/+1
|
* Avoid losing the buffer restriction in flyspell-modeEli Zaretskii2017-08-211-0/+3
| | | | | | * src/intervals.c (get_local_map): Don't allow C-g to quit as long as we have the buffer widened, to make sure the restriction is preserved. (Bug#28161)
* Fix the 'versionclean' target in src/MakefileSven Joachim2017-08-211-1/+1
| | | | | * src/Makefile.in (versionclean): Don't accidentally remove emacs-module.h. (Bug#28169)
* Implement `interrupt-process-functions'Michael Albinus2017-08-211-3/+30
| | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-interrupt-process): Rename from `tramp-advice-interrupt-process'. Adapt according to changed API. (top): Add it to `interrupt-process-functions'. * src/process.c (Finternal_default_interrupt_process): New defun. (Finterrupt_process): Change implementation, based on Vinterrupt_process_functions. (Vinterrupt_process_functions): New defvar. * test/lisp/net/tramp-tests.el (tramp-test40-unload): Do not test removal of advice.
* Avoid floating-point exceptions while drawing underwaveEli Zaretskii2017-08-212-4/+8
| | | | | | | * src/w32term.c (x_get_scale_factor): * src/xterm.c (x_get_scale_factor): Don't let the scale factors become less than 1. Reported by Yuri D'Elia <wavexx@thregr.org> in http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html.
* Fix recently-introduced file descriptor leakPaul Eggert2017-08-181-0/+4
| | | | | * src/fileio.c (Fmake_temp_file_internal): Don’t leak a file descriptor if write_region signals an error.
* Improve make-temp-file performance on local filesPaul Eggert2017-08-182-7/+17
| | | | | | | * lisp/files.el (make-temp-file): Let make-temp-file-internal do the work of inserting the text. * src/fileio.c (Fmake_temp_file_internal): New arg TEXT. All callers changed.
* Implement HiDPI support for underwave on MS-WindowsEli Zaretskii2017-08-182-4/+24
| | | | | | | * src/w32term.c (x_get_scale_factor): New function. (w32_draw_underwave): Use it. * src/xterm.c (x_draw_underwave): Offset the wave starting point to make it identical with original code.
* Support HiDPI displays for wave style underlinesStephen Pegoraro2017-08-181-5/+25
| | | | | | | | * src/xterm.c (x_draw_underwave): Compute height, length and thickness based on scale factor. (x_get_scale_factor): New function. Copyright-paperwork-exempt: yes
* Support Posix semantics of 'rename' on MS-WindowsEli Zaretskii2017-08-171-6/+34
| | | | | | * src/w32.c (sys_rename_replace): Support Posix semantics of 'rename': return an error if OLD is a directory while NEW is not, or vice versa.
* * src/w32.c (sys_rename_replace): Support renaming a directory.Eli Zaretskii2017-08-171-6/+16
|
* Merge from Gnulib; use ‘open’ for O_CLOEXECPaul Eggert2017-08-162-11/+1
| | | | | | | | | | | | | | | | | | | | | | This incorporates: 2017-08-15 renameat: ensure declaration in <stdio.h> on NetBSD 2017-08-15 extensions: enable NetBSD specific extensions 2017-08-14 open: support O_CLOEXEC 2017-08-13 reallocarray: new module * admin/merge-gnulib (AVOIDED_MODULES): Remove ‘open’, since it now supports O_CLOEXEC and this simplifies Emacs. * build-aux/config.guess, lib/fcntl.in.h, lib/stdio.in.h: * lib/stdlib.in.h, m4/extensions.m4, m4/stdlib_h.m4: Copy from Gnulib. * lib/cloexec.c, lib/cloexec.h, lib/open.c: * m4/mode_t.m4, m4/open-cloexec.m4, m4/open.m4: New files, copied from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib-src/etags.c (O_CLOEXEC) [WINDOWSNT]: Remove, as Gnulib does this for us. * src/filelock.c (create_lock_file): * src/sysdep.c (emacs_open, emacs_pipe): Don’t worry about O_CLOEXEC == 0, as Gnulib no longer sets it to 0.
* Allow use of run-time OS version checks on macOS (bug#27810)Alan Third2017-08-165-138/+211
| | | | | | | | | | | | | | | | | | | | | | * src/nsterm.h (NSWindowTabbingMode): Define in pre-Sierra macOS. (MAC_OS_X_VERSION_10_6, MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8, MAC_OS_X_VERSION_10_9, MAC_OS_X_VERSION_10_12, HAVE_NATIVE_FS): Remove defines. (NSWindowStyleMaskFullScreen, NSWindowCollectionBehaviorFullScreenPrimary, NSApplicationPresentationFullScreen, NSApplicationPresentationAutoHideToolbar): Define in macOS 10.6. * src/nsterm.m (colorForEmacsRed, colorUsingDefaultColorSpace, check_native_fs, ns_read_socket, ns_select, runAlertPanel, initFrameFromEmacs, windowDidMiniaturize, windowDidEnterFullScreen, windowDidExitFullScreen, isFullscreen, updateCollectionBehavior, toggleFullScreen, constrainFrameRect, scrollerWidth, syms_of_nsterm): Allow use of run-time checks and replace version check macros. * src/nsfns.m (ns_screen_name): Use run-time OS version checks. * src/macfont.m (macfont_draw): Use run-time OS version checks. * src/nsmenu.m (menuWillOpen): Use run-time OS version checks. Co-authored-by: Charles A. Roelli <charles@aurox.ch>
* Add multiframe image support to NS port (bug#21714)Alan Third2017-08-162-0/+62
| | | | | | | * src/nsimage.m (ns_load_image): Handle multiple frames. (EmacsImage::getMetadata, EmacsImage::setFrame): New functions. * src/nsterm.h (EmacsImage::getMetadata, EmacsImage::setFrame): New function prototypes.
* Fix the MS-Windows buildEli Zaretskii2017-08-151-1/+4
| | | | | * src/fileio.c (Frename_file): Don't use ENOTSUP if it is equal to ENOSYS. (Bug#28097) (Bug#27986)
* Improve rename-file port to macOSPaul Eggert2017-08-141-1/+1
| | | | | | * src/fileio.c (Frename_file): On macOS, renameat_noreplace can fail with errno == ENOTSUP on file systems where it is not supported, according to the Apple documentation.
* Improve rename-file behavior on macOSPaul Eggert2017-08-142-2/+6
| | | | | | | | Problem reported by Philipp Stephani (Bug#27986). * src/fileio.c (Frename_file): Worry about file name case sensitivity only if CYGWIN or DOS_NT. * src/sysdep.c (renameat_noreplace): Use renameatx_np on macOS, since this provides the necessary atomicity guarantees.
* Implement renameat_noreplace for MS-WindowsEli Zaretskii2017-08-141-0/+4
| | | | | * src/sysdep.c (renameat_noreplace) [WINDOWSNT]: Implement minimal emulation for MS-Windows. (Bug#27986)
* Fix 'rename' on MS-WindowsEli Zaretskii2017-08-141-4/+4
| | | | | * src/w32.c (sys_rename_replace): Use the FORCE argument only if the primitive rename errors out with EEXIST.
* Fix vertical cursor motion across too wide imagesEli Zaretskii2017-08-131-2/+2
| | | | | | * src/indent.c (Fvertical_motion): If lines are truncated and we end up beyond the right margin of the window, don't assume we are in the next screen line, unless VPOS actually says so. (Bug#28071)
* Fix make-temp-file bug with ""/"."/".." prefixPaul Eggert2017-08-121-5/+4
| | | | | | | | | | | | | | | | | The bug with "." and ".." has been present for a while; I introduced the bug with "" earlier today in my patch for Bug#28023. * lisp/files.el (make-temp-file): Do not use expand-file-name if PREFIX is empty or "." or "..", as it does the wrong thing. Compute absolute-prefix here ... (files--make-magic-temp-file): ... instead of here ... * src/fileio.c (Fmake_temp_file_internal): ... or here. * lisp/files.el (make-temp-file): If the prefix is empty, append "/" to the absolute prefix so that the new files are children rather than siblings of temporary-file-directory. This fixes a bug introduced in the previous change. * test/lisp/files-tests.el (files-test-make-temp-file-empty-prefix): New test, for the bug.
* Improve make-temp-file performance on local filesPaul Eggert2017-08-124-135/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | For the motivation behind this patch, please see Bug#28023 and: http://emacshorrors.com/posts/make-temp-name.html Although, given the recent changes to Tramp, the related security problem in make-temp-file is already fixed, make-temp-file still has several unnecessary system calls. In the typical case on GNU/Linux, this patch replaces 8 syscalls (symlink, open, close, readlinkat, uname, getpid, unlink, umask) by 2 (open, close). * admin/merge-gnulib (GNULIB_MODULES): Add tempname, now that Emacs is using it directly. * configure.ac (AUTO_DEPEND): Remove AC_SYS_LONG_FILE_NAMES; no longer needed. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lisp/files.el (files--make-magic-temp-file): Rename from make-temp-file. (make-temp-file): Use make-temp-file-internal for non-magic file names. * src/fileio.c: Include tempname.h. (make_temp_name_tbl, make_temp_name_count) (make_temp_name_count_initialized_p, make_temp_name): Remove. (Fmake_temp_file_internal): New function. (Fmake_temp_name): Use it. * src/filelock.c (get_boot_time): Use Fmake_temp_file_internal instead of make_temp_name.
* Fix completion on directory names on MS-DOS/MS-WindowsEli Zaretskii2017-08-122-4/+32
| | | | | | | * src/msdos.c (faccessat): * src/w32.c (faccessat): Support relative file names, and add D_OK to 'mode' if the argument is a directory. This unbreaks file-name completion when the completion result is a directory.
* Implement EXCL of write-region for TrampMichael Albinus2017-08-123-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region) * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Implement MUSTBENEW. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-add-name-to-file) (tramp-do-copy-or-rename-file) * lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link): Adapt error message for `file-already-exists'. * src/lisp.h: * src/eval.c (call8): New function. * src/fileio.c (write_region): Pass also lockname and mustbenew to the file name handler. * test/lisp/net/tramp-tests.el (tramp-test10-write-region): Add tests for MUSTBENEW.
* Use Gnulib 'tempname' on MS-WindowsEli Zaretskii2017-08-122-61/+1
| | | | | | | | | | | | | | | | | | | * lib-src/ntlib.h (mkdir, open): Remove redefinitions. They are now in nt/inc/ms-w32.h. * lib-src/ntlib.c (sys_mkdir, sys_open): New functions. (mkostemp): Remove. * src/w32.c (mkostemp): Remove. (sys_mkdir): Accept a second (unused) argument. * src/fileio.c (Fmake_directory_internal): Remove the WINDOWSNT specific call to mkdir. (Bug#28023) * nt/inc/ms-w32.h (mkdir): Remove from "#ifdef emacs" and redefine to accept 2 arguments. (open): Remove from "#ifdef emacs". * nt/mingw-cfg.site (ac_cv_func_mkostemp): Remove. * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_mkostemp) (OMIT_GNULIB_MODULE_tempname): Remove.
* Improve performance for rename-file etc.Paul Eggert2017-08-111-61/+66
| | | | | | | | | | | | | | | | Although this does not fix Bug#27986, it is a step forward. I plan to propose a more-significant patch later. * lisp/files.el (directory-name-p): Move from here ... * src/fileio.c (Fdirectory_name_p): ... to here. (directory_like, cp_like_target): New static functions. (Fcopy_file, Frename_file, Fadd_name_to_file) (Fmake_symbolic_link): Use them, to avoid directory-testing syscalls on file names that must be directories if they exist. Omit unnecessary initializations and CHECK_STRING calls. (Frename_file): Don't call file_name_case_insensitive_p twice on the same file. Compare both file names expanded, instead of the old name expanded and the new one unexpanded.
* Fix crashing emacs-module tests on MS-WindowsEli Zaretskii2017-08-091-0/+8
| | | | | | | | | | | | * src/w32fns.c (syms_of_w32fns) <w32-disable-abort-dialog>: New variable. (emacs_abort): If w32-disable-abort-dialog is non-nil, abort right away, without displaying the Abort dialog, which waits for the user. * test/src/emacs-module-tests.el (module--test-assertion): Run the inferior Emacs with the w32 abort dialog disabled. Expect the status of the aborted Emacs sub-process to be 3 on MS-Windows and 2 on MS-DOS.
* Document make-temp-name magic limitationsPaul Eggert2017-08-081-1/+2
| | | | | | * doc/lispref/files.texi (Unique File Names): * src/fileio.c (Fmake_temp_name): Document that make-temp-name does not guarantee uniqueness on magic file names.
* Let `define-symbol-prop' take effect during compilationStefan Monnier2017-08-071-0/+11
| | | | | | | | | | | | * src/fns.c (syms_of_fns): New variable `overriding-plist-environment'. (Fget): Consult it. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Let-bind it to nil. (byte-compile-define-symbol-prop): New function, handles compilation of top-level `define-symbol-prop' and `function-put' calls by putting the symbol setting into `overriding-plist-environment'. Co-authored-by: Noam Postavsky <npostavs@gmail.com>