Paul Eggert [Mon, 29 Dec 2014 20:37:53 +0000 (12:37 -0800)]
system-name's returned value can vary
Also, the system-name variable is now obsolete.
Fixes Bug#19438.
* doc/lispref/os.texi (System Environment):
* etc/NEWS: Document this.
* doc/misc/efaq.texi:
(Displaying the current file name in the titlebar):
* lisp/desktop.el (desktop-save-frameset):
* lisp/dnd.el (dnd-get-local-file-uri):
* lisp/gnus/message.el (message-make-fqdn):
* lisp/gnus/nnvirtual.el (nnvirtual-retrieve-headers)
(nnvirtual-update-xref-header):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1):
* lisp/org/org-clock.el (org-clock-save):
* src/filelock.c (current_lock_owner):
* src/xrdb.c (get_environ_db):
* src/xterm.c (same_x_server):
* src/xterm.c (x_term_init):
Prefer (system-name) to system-name, and avoid naming
locals 'system-name'.
* doc/misc/smtpmail.texi (Server workarounds): Fix grammar.
* lisp/startup.el (system-name): Now an obsolete variable.
* src/editfns.c (cached_system_name): New static var.
(init_and_cache_system_name): New function.
(init_editfns, Fsystem_name): Use it.
(syms_of_editfns): Initialize it and Vsystem_name to the same value.
* src/sysdep.c [HAVE_SOCKETS]: Don't include <sys/socket.h>, <netdb.h>.
(h_errno) [TRY_AGAIN && !HAVE_H_ERRNO]: Remove decl.
(init_system_name) [HAVE_SOCKETS]: Don't canonicalize the name.
Don't create a new string if the current value is already correct.
Dmitry Gutov [Mon, 29 Dec 2014 02:21:51 +0000 (04:21 +0200)]
Unbreak jumping to an alias's definition
* lisp/emacs-lisp/find-func.el (find-function-library): Return a pair
(ORIG-FUNCTION . LIBRARY) instead of just its second element.
(find-function-noselect): Use it.
* lisp/progmodes/elisp-mode.el (elisp--xref-identifier-file): Rename to
`elisp--xref-identifier-location', incorporate logic from
`elisp--xref-find-definitions', use the changed
`find-function-library' return value.
Juri Linkov [Mon, 29 Dec 2014 00:52:38 +0000 (02:52 +0200)]
More fixes to support multi-line search in comint
* lisp/comint.el (comint-history-isearch-message): Use field-beginning
instead of comint-line-beginning-position - that's more fixes for
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00305.html
(comint-history-isearch-message): Fix args of isearch-message-prefix.
Paul Eggert [Fri, 26 Dec 2014 17:32:06 +0000 (09:32 -0800)]
Wrap dll functions more simply
* decompress.c, gnutls.c, image.c, xml.c:
If WINDOWSNT, use '#define FOO fn_FOO' to wrap dll functions,
rather than the inverse when not WINDOWSNT. This isolates the
fn_* business into the WINDOWSNT-specific section of the code,
which makes it easier to maintain the generic code.
* decompress.c (DEF_ZLIB_FN, LOAD_ZLIB_FN):
* gnutls.c (DEF_GNUTLS_FN, LOAD_GNUTLS_FN):
* image.c (DEF_IMGLIB_FN, LOAD_IMGLIB_FN):
* xml.c (DEF_XML2_FN, LOAD_XML2_FN):
Remove. All uses replaced by DEF_DLL_FN.
* w32.h (DEF_DLL_FN, LOAD_DLL_FN): New macros.
Paul Eggert [Sun, 28 Dec 2014 07:44:25 +0000 (23:44 -0800)]
Port memory-full checking to GnuTLS 3.3
Instead of using gnutls_global_set_mem_functions, check every call
to a GnuTLS function that might return an indication of memory
exhaustion. Suggested by Dmitry Antipov in:
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02056.html
* src/gnutls.c (gnutls_global_set_mem_functions) [WINDOWSNT]: Remove.
(init_gnutls_functions): Do not load gnutls_global_set_mem_functions.
(fn_gnutls_global_set_mem_functions) [!WINDOWSNT]: Remove.
All uses removed.
(check_memory_full): New function.
(emacs_gnutls_handshake, emacs_gnutls_handle_error)
(gnutls_make_error, Fgnutls_boot): Use it.
(emacs_gnutls_global_init): Avoid gnutls_global_set_mem_functions.
Juri Linkov [Sun, 28 Dec 2014 00:48:05 +0000 (02:48 +0200)]
Use diff faces for compare-windows
* lisp/vc/compare-w.el: Require diff-mode for diff faces.
(compare-windows-removed, compare-windows-added): New faces
inheriting from diff faces.
(compare-windows): Define obsolete face alias.
(compare-windows-highlight): Replace face `compare-windows' with
new faces `compare-windows-added' and `compare-windows-removed'.
(compare-windows-get-recent-window): Signal an error when
no other window is found.
This commit adds native readline completion that fallbacks to the old
mechanism when it cannot be used for the current interpreter.
* lisp/progmodes/python.el (python-shell-completion-native-disabled-interpreters)
(python-shell-completion-native-enable)
(python-shell-completion-native-output-timeout): New defcustoms.
(python-shell-completion-native-interpreter-disabled-p)
(python-shell-completion-native-try)
(python-shell-completion-native-setup)
(python-shell-completion-native-turn-off)
(python-shell-completion-native-turn-on)
(python-shell-completion-native-turn-on-maybe)
(python-shell-completion-native-turn-on-maybe-with-msg)
(python-shell-completion-native-toggle): New functions.
(python-shell-completion-native-get-completions): New function.
(python-shell-completion-at-point): Use it.
* test/automated/python-tests.el
(python-shell-completion-native-interpreter-disabled-p-1): New
test.
python.el: Enhance shell user interaction and deprecate python-shell-get-or-create-process.
* lisp/progmodes/python.el
(python-shell-get-process-or-error): New function.
(python-shell-with-shell-buffer): Use it.
(python-shell-send-string, python-shell-send-region)
(python-shell-send-buffer, python-shell-send-defun)
(python-shell-send-file, python-shell-switch-to-shell): Use it.
Add argument MSG to display user-friendly message when no process
is running.
(python-shell-switch-to-shell): Call pop-to-buffer with NORECORD.
(python-shell-make-comint): Rename argument SHOW from POP. Use
display-buffer instead of pop-to-buffer.
(run-python): Doc fix. Return process.
(python-shell-get-or-create-process): Make obsolete.
Paul Eggert [Sat, 27 Dec 2014 20:00:29 +0000 (12:00 -0800)]
Fix parse_settings to match internal documentation
* xsettings.c (parse_settings): Return the number of settings seen.
Count the settings changes accurately.
(read_settings): Don't confuse number of settings changes with
the return code from XGetWindowProperty.
Eli Zaretskii [Sat, 27 Dec 2014 19:46:03 +0000 (21:46 +0200)]
Fix compilation of lib-src executables on MS-Windows.
lib-src/Makefile.in (etags_libs, ebrowse${EXEEXT}, profile${EXEEXT})
(make-docfile${EXEEXT}, movemail${EXEEXT})
(update-game-score${EXEEXT}): Put $(NTLIB) before $(LOADLIBES),
since GCC sometimes calls stpcpy when it sees strcpy, under
optimization switches. Reported by Dani Moncayo <dmoncayo@gmail.com>.
216c6aa * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use `tramp-rsh-end-of-line', it ought to be more robust. 20cfd24 Improve indexing on the chapter/section/subsection levels. 14c3739 * lisp/progmodes/js.el (js-syntax-propertize): "return" can't be divided. ea78112 * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use "\n" as end-of-line delimeter for passwords, when running on MS Windows. 012479a * lisp/progmodes/sh-script.el: Don't set global indent-line-function 75e114f Fix line numbers on Python shell. d0fd23c doc/emacs/buffers.texi (Kill Buffer): Improve indexing. 8e818d1 Keep maximized when going fullscreen. 749813e python.el: Fix electric colon behavior 936d5e5 Fix last patch. 74d3b20 Fixes: debbugs:18623
Dmitry Gutov [Sat, 27 Dec 2014 14:06:37 +0000 (16:06 +0200)]
elisp-xref-find: Don't create buffers eagerly
* lisp/emacs-lisp/find-func.el (find-function-library): New function,
extracted from `find-function-noselect'.
* lisp/progmodes/elisp-mode.el (elisp--identifier-location): Fold back
into `elisp--company-location'.
(elisp--identifier-completion-table): Rename to
`elisp--identifier-completion-table', and do not include just any
symbols with a property list.
(elisp-completion-at-point): Revert the 2014-12-25 change.
(elisp--xref-identifier-file): New function.
(elisp--xref-find-definitions): Use it.
* lisp/progmodes/xref.el (xref-elisp-location): New class.
(xref-make-elisp-location): New function.
(xref-location-marker): New implementation.
Eli Zaretskii [Sat, 27 Dec 2014 12:07:06 +0000 (14:07 +0200)]
Fix composition of characters from Syriac and Arabis scripts.
lisp/language/misc-lang.el (composition-function-table): Add Syriac
characters and also ZWJ/ZWNJ. See
http://lists.gnu.org/archive/html/help-gnu-emacs/2014-12/msg00248.html
for the details.
Juri Linkov [Sat, 27 Dec 2014 00:54:56 +0000 (02:54 +0200)]
Avoid duplicate calls of window-height in with-displayed-buffer-window
* lisp/minibuffer.el (minibuffer-completion-help):
Use shrink-window-if-larger-than-buffer in window-height
when temp-buffer-resize-mode is nil.
* lisp/window.el (with-displayed-buffer-window): Remove window-height
from the action alist in the temp-buffer-window-show call
when window-height is handled explicitly afterwards.
Juri Linkov [Sat, 27 Dec 2014 00:38:34 +0000 (02:38 +0200)]
Support subdirectories when saving places in dired.
* lisp/saveplace.el (toggle-save-place, save-place-to-alist)
(save-places-to-alist, save-place-dired-hook):
Use dired-current-directory instead of dired-directory.
(save-place-dired-hook): Add check for alist to make the new
format future-proof to allow other possible formats.
Dmitry Gutov [Fri, 26 Dec 2014 16:34:47 +0000 (18:34 +0200)]
Add basic xref apropos implementation to elisp-mode
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
Filter out nil results.
(elisp--xref-find-apropos): New function.
(elisp-xref-find): Use it.
* lisp/progmodes/xref.el (xref--show-xrefs): Use `user-error'.
Eli Zaretskii [Fri, 26 Dec 2014 09:52:24 +0000 (11:52 +0200)]
MS-Windows followup to stpcpy changes.
src/w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead
of strcat.
src/w32menu.c (add_menu_item): Use stpcpy instead of strcat.
src/w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of
strcat.
nt/gnulib.mk (stpcpy, string): Sync with the latest change in
lib/gnulib.mk.
Dmitry Gutov [Thu, 25 Dec 2014 20:08:19 +0000 (22:08 +0200)]
Consolidate cross-referencing commands
Move autoloaded bindings for `M-.', `M-,', `C-x 4 .' and
`C-x 5 .' from etags.el to xref.el.
* progmodes/xref.el: New file.
* progmodes/elisp-mode.el (elisp--identifier-types): New variable.
(elisp--identifier-location): New function, extracted from
`elisp--company-location'.
(elisp--company-location): Use it.
(elisp--identifier-completion-table): New variable.
(elisp-completion-at-point): Use it.
(emacs-lisp-mode): Set the local values of `xref-find-function'
and `xref-identifier-completion-table-function'.
(elisp-xref-find, elisp--xref-find-definitions)
(elisp--xref-identifier-completion-table): New functions.
* progmodes/etags.el (find-tag-marker-ring): Mark obsolete in
favor of `xref--marker-ring'.
(tags-lazy-completion-table): Autoload.
(tags-reset-tags-tables): Use `xref-clear-marker-stack'.
(find-tag-noselect): Use `xref-push-marker-stack'.
(pop-tag-mark): Make an alias for `xref-pop-marker-stack'.
(etags--xref-limit): New constant.
(etags-xref-find, etags--xref-find-definitions): New functions.
Eli Zaretskii [Thu, 25 Dec 2014 15:38:15 +0000 (17:38 +0200)]
Fix rendering of composed caharacters on the mode line. (Bug#19435)
src/xdisp.c (set_iterator_to_next) <GET_FROM_STRING>: Limit search in
composition_compute_stop_pos to the number of characters in the
string.
<GET_FROM_BUFFER, GET_FROM_STRING>: Simplify code.
src/composite.c (composition_compute_stop_pos): If no composition
was found in a string before ENDPOS, and ENDPOS is the string end,
no need to back up to a safe point.
src/dispextern.h (struct it) <end_charpos>: Improve commentary.
Martin Rudalics [Thu, 25 Dec 2014 13:13:26 +0000 (14:13 +0100)]
Make `resize-mini-windows' customizable and update documentation for it.
* cus-start.el (resize-mini-windows): Make it customizable.
* minibuf.texi (Minibuffer Windows): Add descriptions of
`resize-mini-windows' and `max-mini-window-height'.
Martin Rudalics [Wed, 24 Dec 2014 18:37:45 +0000 (19:37 +0100)]
Handle glitch in delayed autoselection of windows.
* window.el (mouse-autoselect-window-position-1): New variable.
(mouse-autoselect-window-cancel)
(mouse-autoselect-window-select, handle-select-window): With
delayed autoselection select window only if mouse moves after
selecting its frame.
Jan D [Wed, 24 Dec 2014 11:24:14 +0000 (12:24 +0100)]
Backport: Memory leak fix and 19133 fix.
Fixes: debbugs:19133
* nsimage.m (allocInitFromFile:): Initialize bmRep.
(dealloc): Release bmRep.
(setPixmapData): Make bmRep local so class member is not
set.