Paul Eggert [Sun, 23 Aug 2015 20:50:59 +0000 (13:50 -0700)]
Fix minor glitches from ‘format’ reversion
* doc/lispref/strings.texi (Formatting Strings):
After reversion, ‘text-quoting-style’ is documented in ‘Keys in
Documentation’, not below.
* src/syntax.c (Finternal_describe_syntax_value):
Prefer AUTO_STRING to build_string where either will do, as
AUTO_STRING is a bit faster.
python.el: Defer shell setup code until first interactive prompt
* lisp/progmodes/python.el
(python-shell-comint-watch-for-first-prompt-output-filter): New
function.
(inferior-python-mode): Use it.
(python-shell-first-prompt-hook): New hook.
(python-shell-send-setup-code)
(python-shell-completion-native-turn-on-maybe-with-msg): Attach to
this hook instead of inferior-python-hook.
Nicolas Petton [Sun, 23 Aug 2015 19:09:01 +0000 (21:09 +0200)]
Remove the calls to `seq-into` from `seq-concatenate`
Since most new types of seq would have to be defined as sequences (cons
cells or CL structs, mostly), there is no need to convert the seqs to
sequences (which can be a fairly expensive operation).
* lisp/emacs-lisp/seq.el (seq-concatenate): Do not ensure that seqs are
sequences.
Nicolas Petton [Fri, 14 Aug 2015 20:33:10 +0000 (22:33 +0200)]
Make seq.el more extensible by using cl-defmethod
* lisp/emacs-lisp/seq.el: Define seq.el functions using cl-defmethod to
make it easier to extend seq.el with new "seq types".
* test/automated/seq-tests.el (test-setf-seq-elt): New test.
* lisp/emacs-lisp/cl-extra.el (cl-subseq): Move back the definition of
subseq in cl-extra.el, and use it in seq.el.
Xue Fuqiao [Sun, 23 Aug 2015 11:45:54 +0000 (19:45 +0800)]
; * doc/lispintro/emacs-lisp-intro.texi (Buffer Size & Locations):
; Markup fix. ("point" is not a variable, so "@code{point}" should
; be either "point" or @code{(point)} here.)
python.el: fallback completion, ffap and eldoc setup enhancements
Setup codes are now sent continuously so that the current frame is
always taken into account. This allows working within debuggers
and always keeping a fresh version of setup codes that will return
proper results.
* lisp/progmodes/python.el (python-shell-setup-codes): Cleanup.
(python-shell-send-setup-code): Send code only when
python-shell-setup-codes is non-nil.
(python-shell-completion-string-code): Cleanup trailing newline.
(python-shell-completion-get-completions): Always use
python-shell-completion-setup-code.
(python-ffap-setup-code): Work with any object, not only modules.
(python-ffap-string-code): Cleanup trailing newline.
(python-ffap-module-path): Always use python-ffap-setup-code.
(python-eldoc-string-code): Cleanup trailing newline.
(python-eldoc--get-doc-at-point): Always use
python-eldoc-setup-code. Return non-nil only if docstring is
found.
* lisp/progmodes/python.el (python-shell-completion-native-setup):
Make completer print real candidates and just return dummy ones to
avoid input modification.
(python-shell-completion-native-get-completions): Set
comint-redirect-insert-matching-regexp to non-nil and make
comint-redirect-finished-regexp match the last dummy candidate.
Use python-shell-accept-process-output to wait for the full list
of candidates.
Eli Zaretskii [Sat, 22 Aug 2015 19:14:56 +0000 (22:14 +0300)]
Fix invocation of programs via cmdproxy.exe
* src/w32proc.c (sys_spawnve): Use exec-directory, not
invocation-directory, for finding cmdproxy.exe. When Emacs is
run from the source tree, look for cmdproxy.exe in the same source
tree. (Bug#21323)
Simen Heggestøyl [Sat, 22 Aug 2015 17:13:10 +0000 (19:13 +0200)]
Handle comments inside unquoted URIs in css-mode
* lisp/textmodes/css-mode.el (css--uri-re): New defconst.
(css-syntax-propertize-function): New defconst.
(css--font-lock-keywords): Handle parens around unquoted URIs.
(css-mode): Set `syntax-propertize-function'.
Eli Zaretskii [Sat, 22 Aug 2015 14:16:58 +0000 (17:16 +0300)]
Support invocation of Hunspell with multiple dictionaries
* lisp/textmodes/ispell.el (ispell-parse-hunspell-affix-file): Support
lists of dictionaries of the form "DICT1,DICT2,...".
(ispell-hunspell-add-multi-dic): New command. (Bug#20495)
python.el: Enhancements to process environment setup.
* lisp/progmodes/python.el (python-shell-process-environment)
(python-shell-extra-pythonpaths, python-shell-exec-path)
(python-shell-virtualenv-root): Update docstring. Remove :safe.
(python-shell-setup-codes): Remove :safe.
(python-shell-remote-exec-path): New defcustom.
(python-shell--add-to-path-with-priority): New macro.
(python-shell-calculate-pythonpath): Give priority to
python-shell-extra-pythonpaths. Update docstring.
(python-shell-calculate-process-environment): Give priority to
python-shell-process-environment. Update docstring.
(python-shell-calculate-exec-path): Give priority to
python-shell-exec-path and calculated virtualenv bin directory.
Update docstring.
(python-shell-tramp-refresh-remote-path): New function.
(python-shell-with-environment): Use it when working remotely and
do not modify tramp-remote-path. Allow nesting.
(python-shell-calculate-command): Remove useless
python-shell-with-environment call.
* doc/lispref/frames.texi (Frame Font): Document that
set-frame-font with the last argument 't' will also make the font
the default for the future GUI frames.
Eli Zaretskii [Fri, 21 Aug 2015 12:55:05 +0000 (15:55 +0300)]
Clarify documentation of 'get-buffer-window-list'
* doc/lispref/windows.texi (Buffers and Windows): Mention that the
current window, if relevant, will be the first in the list
returned by 'get-buffer-window-list'.
Paul Eggert [Fri, 21 Aug 2015 12:02:51 +0000 (05:02 -0700)]
Follow user preference in calendar diagnostics
Respect text-quoting-style preference in diagnostic formats by
using curved quotes (which are translated as per text-quoting-style)
instead of grave accent and apostrophe (which are not).
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
Use curved quotes in diagnostic format strings.
* lisp/calendar/icalendar.el (icalendar-import-format-sample):
* test/automated/icalendar-tests.el (icalendar--import-format-sample):
Just use straight quoting for simple test case.
Tassilo Horn [Fri, 21 Aug 2015 07:38:01 +0000 (09:38 +0200)]
Add TeX defaults for prettify-symbol-mode
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Rename
from tex-prettify-symbols-alist.
(tex--prettify-symbols-compose-p): New function.
(tex-common-initialization): Use them as prettify-symbols-alist
and prettify-symbols-compose-predicate.
Tassilo Horn [Thu, 20 Aug 2015 07:58:28 +0000 (09:58 +0200)]
Generalize prettify-symbols to arbitrary modes
* lisp/progmodes/prog-mode.el
(prettify-symbols-default-compose-p): New function.
(prettify-symbols-compose-predicate): New variable.
(prettify-symbols--compose-symbol): Use it.
Alan Mackenzie [Wed, 19 Aug 2015 16:47:10 +0000 (16:47 +0000)]
Make electric-pair-mode, delete-selection-mode and CC Mode cooperate.
Fixes debbugs#21275.
In Emacs >= 25, let electric-pair-mode take precedence over
delete-selection-mode.
delsel.el (delete-selection-uses-region-p): New function, previously a
lambda expression in a property value for `self-insert-command'.
(top-level) Set the `delete-selection' property of `self-insert-command'
to `delete-selection-uses-region-p'.
progmodes/cc-cmds.el (top-level): Give the `delete-selection' property
for c-electric-\(brace\|paren\) the value `delete-selection-uses-region-p'
when the latter function exists.
Paul Eggert [Wed, 19 Aug 2015 16:40:33 +0000 (09:40 -0700)]
Fix key binding quoting in tutorial *Help*
* lisp/tutorial.el (tutorial--describe-nonstandard-key):
When generating help for custom key bindings, use the user-preferred
quoting style rather than hardcoding the grave style.
Eli Zaretskii [Wed, 19 Aug 2015 15:04:22 +0000 (18:04 +0300)]
Improve and future-proof OTF fonts support in w32uniscribe.c
* src/w32uniscribe.c (uniscribe_otf_capability): Add commentary
about the expected results and why the new Uniscribe APIs are not
used in this function.
(ScriptGetFontScriptTags_Proc, ScriptGetFontLanguageTags_Proc)
(ScriptGetFontFeatureTags_Proc): New function typedefs.
(uniscribe_new_apis): New static variable.
(uniscribe_check_features): New function, implements OTF features
verification while correctly accounting for features in the list
after the nil member, if any.
(uniscribe_check_otf_1): New function, retrieves the features
supported by the font for the requested script and language using
the Uniscribe APIs available from Windows Vista onwards.
(uniscribe_check_otf): If the new Uniscribe APIs are available,
use them in preference to reading the font data directly. Call
uniscribe_check_features to verify that the requested features are
supported, replacing the original incomplete code.
(syms_of_w32uniscribe): Initialize function pointers for the new
Uniscribe APIs. (Bug#21260)
(otf_features): Scan the script, langsys, and feature arrays back
to front, so that the result we return has them in alphabetical
order, like ftfont.c does.
* src/w32fns.c (syms_of_w32fns) <w32-disable-new-uniscribe-apis>:
New variable for debugging w32uniscribe.c code.
Remove usage of `isearch-lax-whitespace' inside the `iearch-word'
clause of `isearch-search-fun-default'. That lax variable does not
refer to lax-whitespacing. Related to (bug#21777).
This reverts commit a5bdb872edb9f031fe041faf9a8c0be432e5f64c.
* character-fold.el (character-fold-search): Set to nil
Default to nil for now, until someone implements proper
lax-whitespacing with char-fold searching.
Martin Rudalics [Wed, 19 Aug 2015 09:20:44 +0000 (11:20 +0200)]
Move window edge functions to Elisp.
* src/window.c (Fwindow_edges, Fwindow_pixel_edges)
(Fwindow_absolute_pixel_edges, Fwindow_inside_edges)
(Fwindow_inside_pixel_edges, Fwindow_inside_absolute_pixel_edges):
Move to window.el.
(calc_absolute_offset): Remove.
* lisp/frame.el (frame-edges): New function.
* lisp/window.el (window-edges, window-pixel-edges)
(window-absolute-pixel-edges): Move here from window.c.
(window-body-edges, window-body-pixel-edges)
(window-absolute-body-pixel-edges): Move here from window.c and
rename "inside" to "body". Keep old names as aliases.
(window-absolute-pixel-position): New function.
Martin Rudalics [Wed, 19 Aug 2015 06:49:41 +0000 (08:49 +0200)]
In w32fns.c condition TITLEBAR_INFO declaration on WINDOWS version.
* src/w32fns.c (TITLEBAR_INFO): Make it a typedef so MinGW64
builds can use the declaration from the system headers.
(GetTitleBarInfo_Proc, Fx_frame_geometry): Adapt to new
definition of TITLEBAR_INFO.
Suggested by Eli Zaretskii <eliz@gnu.org>
Paul Eggert [Wed, 19 Aug 2015 06:04:58 +0000 (23:04 -0700)]
Use new q ‘format’ flag when fixing quotes in C
* src/image.c (image_size_error): New function. All uses of
image_error with "Invalid image size ..." changed to use it.
* src/image.c (image_size_error, xbm_load_image, xbm_load)
(xpm_load, xpm_load_image, xpm_load, pbm_load, png_load_body)
(jpeg_load_body, tiff_load, gif_load, imagemagick_load_image)
(imagemagick_load, svg_load, svg_load_image, gs_load)
(x_kill_gs_process):
* src/lread.c (load_warn_old_style_backquotes):
* src/xfaces.c (load_pixmap):
* src/xselect.c (x_clipboard_manager_error_1):
Use %qs, not uLSQM and uRSQM.
* src/syntax.c (Finternal_describe_syntax_value):
Prefer Fsubstitute_command_keys to Fformat, as this lets
us use AUTO_STRING.
* src/xdisp.c (vadd_to_log): Use AUTO_STRING on the format argument,
as it's now guaranteed to be ASCII.
* src/xselect.c (x_clipboard_manager_error_2):
Avoid grave accent in low-level stderr diagnostic.
Daiki Ueno [Wed, 19 Aug 2015 02:40:17 +0000 (11:40 +0900)]
pinentry.el: Add debugging support
* lisp/net/pinentry.el (pinentry-debug): New variable.
(pinentry-debug-buffer): New variable.
(pinentry--process-filter): Send input to the debug buffer, if
`pinentry-debug' is set.
Paul Eggert [Tue, 18 Aug 2015 23:24:27 +0000 (16:24 -0700)]
Fix multibyte confusion in diagnostics
* src/print.c (print_error_message):
Don't assume that the caller's name is unibyte.
* src/xdisp.c (vadd_to_log):
Don't assume that the formatted diagnostic is unibyte.
Paul Eggert [Tue, 18 Aug 2015 23:17:30 +0000 (16:17 -0700)]
Fix file name encodings in diagnostics
Also, close some minor races when opening image files, by opening
them once instead of multiple times.
* src/gtkutil.c (xg_get_image_for_pixmap):
* src/image.c (xpm_load, tiff_load, gif_load, imagemagick_load)
(svg_load):
* src/nsimage.m (allocInitFromFile:):
* src/xfns.c (xg_set_icon):
Encode file name, since x_find_image_file no longer does that.
* src/image.c (x_find_image_fd): New function.
(x_find_image_file): Use it. Do not encode resulting file name,
since callers sometimes need it decoded.
(slurp_file): File arg is now a fd, not a file name.
All callers changed. This saves us having to open the file twice.
(xbm_load, xpm_load, pbm_load, png_load_body, jpeg_load_body)
(svg_load):
Use x_find_image_fd and fdopen to save a file-open.
Report file name that failed.
* src/lread.c (openp): If PREDICATE is t, open the file in binary mode.
Dmitry Gutov [Tue, 18 Aug 2015 20:31:52 +0000 (23:31 +0300)]
Allow blink-matching-paren to jump off screen
* doc/emacs/programs.texi (Matching): Mention the
`blink-matching-paren' value `jump-offscreen'.
* lisp/simple.el (blink-matching-paren): New possible value.
(blink-matching-paren-on-screen): Clarify the docstring.
(blink-matching-open): Handle `jump-offscreen' (bug#21286).
Paul Eggert [Tue, 18 Aug 2015 06:46:38 +0000 (23:46 -0700)]
Clarify what happens to match data on failure
Problem reported by Ernesto Alfonso (Bug#21279).
* doc/lispref/searching.texi (Regexp Search, Simple Match Data):
Document more carefully what happens to match data after a failed
search.
* src/search.c (Fmatch_beginning, Fmatch_end): Document that
the return value is undefined if the last search failed.
(Fmatch_data): Simplify doc string line 1.
Daiki Ueno [Tue, 18 Aug 2015 06:02:41 +0000 (15:02 +0900)]
Revert "pinentry.el: Support external passphrase cache"
This reverts commit e086e55a664ec27fbca7b3231c4b32cb78a89337.
pinentry.el shouldn't directly interact with the secrets service,
but ask the caller to cache the passphrase.
Daiki Ueno [Tue, 18 Aug 2015 02:55:26 +0000 (11:55 +0900)]
pinentry.el: Support external passphrase cache
* lisp/net/pinentry.el (pinentry-use-secrets): New user option.
(pinentry--allow-external-password-cache): New local variable.
(pinentry--key-info): New local variable.
(secrets-enabled, secrets-search-items, secrets-get-secret):
Declare.
(pinentry--send-passphrase): New function, split from
`pinentry--process-filter'.
(pinentry--process-filter): Use secrets.el to retrieve passphrase
from login keyring.
Daiki Ueno [Tue, 18 Aug 2015 02:09:29 +0000 (11:09 +0900)]
pinentry.el: Popup window for multiline prompt
* lisp/net/pinentry.el (pinentry): New custom group.
(pinentry-popup-prompt-window): New user option.
(pinentry-prompt-window-height): New user option.
(pinentry--prompt-buffer): New variable.
(pinentry-prompt-mode-map): New variable.
(pinentry-prompt-mode): New function.
(pinentry--prompt): New function.
(pinentry--process-filter): Use `pinentry--prompt' instead of
`read-passwd' and `y-or-n-p'.