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'.
Paul Eggert [Mon, 17 Aug 2015 19:00:54 +0000 (12:00 -0700)]
Curved quotes in --batch diagnostics in non-UTF-8
When run with --batch, check that curved quotes are compatible with
the system locale before outputting them in diagnostics.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00594.html
* lisp/startup.el (command-line): Set internal--text-quoting-flag
after the standard display table is initialized.
* src/doc.c (default_to_grave_quoting_style): New function.
(text_quoting_style): Use it.
(text_quoting_flag): New static var, visible to Lisp as
internal--text-quoting-flag.
* src/emacs.c: Include <wchar.h> if available.
(using_utf8): New function.
(main): Use it to initialize text_quoting_flag.
* src/regex.h (btowc) [WIDE_CHAR_SUPPORT && emacs]:
Don't define, as it's not needed and it clashes with wchar.h.
Eli Zaretskii [Mon, 17 Aug 2015 16:58:28 +0000 (19:58 +0300)]
Improve fontset support for latest OTF script tags
* lisp/international/fontset.el (otf-script-alist): Add some
missing script tags.
(setup-default-fontset): Include settings for v2 versions of the
script tags used by some modern OTF/TTF fonts.
Paul Eggert [Sun, 16 Aug 2015 15:34:44 +0000 (08:34 -0700)]
Convert lisp/term/x-win.el to UTF-8
* lisp/term/x-win.el: Convert to UTF-8. This doesn't affect
runtime behavior, and the file is multilingual so compile-time
appearance shouldn't be an issue.
* admin/notes/unicode: Document this.
Wilson Snyder [Sun, 16 Aug 2015 12:44:16 +0000 (08:44 -0400)]
Update verilog-mode.el to 2015-05-14-6232468-vpo-GNU.
* losp/progmodes/verilog-mode.el: Fix some non-automated indent
issues and comments, bug943. (verilog-type-font-keywords): Cycle
delay operators like ##1 and ##[0:$] are now highlighted in their
entirety similarly to the # delay-control operator. Likewise, the
followed-by operators #-# and #=# are no longer partially
highlighed. (verilog-backward-syntactic-ws-quick,
verilog-skip-backward-comments): Minor performance improvements to
buffer traversal functions for reduced latency. (verilog-calc-1,
verilog-in-deferred-immediate-final-p): When the keyword 'final'
follows 'assert/assume/cover', then it is part of a deferred
immediate assertion item and should not be treated as a final
construct for indentation. Reported by Yuri Sugihara.
(verilog-do-indent): Virtual task/function/class definition lines
should not be considered as declarations. Reported by Enzo Chi.
(verilog-do-indent): Do not falsely indent to '=' of
property/sequence operators on subsequent lines of a multi-line
statement. (verilog-assignment-operator-re): Fix '!==' operator
and add support for '<->', ':/', '#-#', and '#=#' operators.
(verilog-calculate-indent, verilog-label-be): Enable
case-sensitive regular expression parsing when looking for
keywords. (verilog-calc-1): Detect 'pure virtual method'
declarations which exist in abstract classes. Reported by Enzo
Chi and Kaushal Modi. (verilog-backward-ws&directives): When
moving back to the start of a line and the preceeding line ended
with an escaped-newline, then jump up one line. This properly
consumes a multi-line pre-processor directive. Reported by
Kaushal Modi. (verilog-dpi-import-export-re,
verilog-extended-complete-re, verilog-calc-1): Teach verilog-mode
to properly indent after a DPI import/export statement that
resides outside of a module. Reported by Kaushal Modi.
(verilog-extended-complete-re): Update regexp to match both
"DPI-C" and "DPI". Reported by Kaushal Modi.
Paul Eggert [Sun, 16 Aug 2015 00:23:14 +0000 (17:23 -0700)]
substitute-command-keys a few more doc strings
* lisp/allout.el (outlineify-sticky):
* lisp/files.el (hack-one-local-variable--obsolete):
* lisp/help-fns.el (help-fns--obsolete, describe-variable):
Use substitute-command-keys on some doc strings so that
they don't use hard-coded key bindings or quoting styles.
Stephen Leake [Sat, 15 Aug 2015 17:17:47 +0000 (12:17 -0500)]
Allow describe-function helpers to access buffer-local values.
This will be used by cedet/mode-local.el `describe-mode-local-override'
on `help-fns-describe-function-functions' in upstream CEDET.
* lisp/help-fns.el (describe-function-orig-buffer): New, let-bound in
`describe-function'.
(describe-function): Bind it, save it on the help xref stack.
Paul Eggert [Sat, 15 Aug 2015 15:35:02 +0000 (08:35 -0700)]
Fix "\`" confusion in Lisp strings
* admin/authors.el (authors-canonical-author-name):
Fix typo by using "\\`" not "\`" in string RE.
* lisp/obsolete/complete.el (PC-complete-as-file-name):
* lisp/obsolete/vi.el (vi-backward-blank-delimited-word):
* lisp/progmodes/verilog-mode.el (verilog-mode-map):
Use plain "`", not the equivalent-but-confusing "\`", in strings.
* lisp/textmodes/texinfmt.el: Fix comment likewise.
Paul Eggert [Sat, 15 Aug 2015 01:20:35 +0000 (18:20 -0700)]
Default to inotify instead of gfile
* configure.ac (with_file_notification): Fix typo that
prevented suppression of file notification if HAVE_NS.
(NOTIFY_OBJ): Prefer inotify to gfile if both exist and
with_file_notification is 'yes' (Bug#21241).
* etc/NEWS: Mention this.
Paul Eggert [Fri, 14 Aug 2015 22:50:36 +0000 (15:50 -0700)]
Low-level diagnostics now use ‘text-quoting-style’
* src/doprnt.c (doprnt):
Format ` and ' as per ‘text-quoting-style’.
* src/xdisp.c (vmessage, message): Mention that the format should
not contain ` or '.
Paul Eggert [Fri, 14 Aug 2015 22:50:35 +0000 (15:50 -0700)]
Extend ‘format’ to translate curved quotes
This is a followup to the recent doc string change, and deals with
diagnostics and the like. This patch is more conservative than
the doc string change, in that the behavior of ‘format’ changes
only if its first arg contains curved quotes and the user prefers
straight or grave quotes. (Come to think of it, perhaps we should
be similarly conservative with doc strings too, but that can wait.)
The upside of this conservatism is that existing usage is almost
surely unaffected. The downside is that we'll eventually have to
change Emacs's format strings to use curved quotes in places where
the user might want curved quotes, but that's a simple and
mechanical translation that I'm willing to do later. (Bug#21222)
* doc/lispref/help.texi (Keys in Documentation):
Move description of text-quoting-style from here ...
* doc/lispref/strings.texi (Formatting Strings):
... to here, and describe new behavior of ‘format’.
* etc/NEWS: Describe new behavior.
* lisp/calc/calc-help.el (calc-describe-thing):
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
* lisp/info.el (Info-find-index-name):
Use ‘concat’ rather than ‘format’ to avoid misinterpretation
of recently-added curved quotes.
* src/doc.c (uLSQM0, uLSQM1, uLSQM2, uRSQM0, uRSQM1, uRSQM2):
Move from here ...
* src/lisp.h: ... to here.
* src/doc.c (text_quoting_style): New function.
(Fsubstitute_command_keys): Use it.
* src/editfns.c (Fformat): Implement new behavior.
* src/lisp.h (enum text_quoting_style): New enum.
Jürgen Hötzel [Fri, 14 Aug 2015 19:11:51 +0000 (21:11 +0200)]
Flush file properties in Tramp.
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-modes)
(tramp-sh-handle-set-file-times):
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-modes)
(tramp-adb-handle-set-file-times): Flush the file properties of
the directory.
Paul Eggert [Thu, 13 Aug 2015 20:48:28 +0000 (13:48 -0700)]
Make add_to_log varargs
* src/alloc.c (run_finalizer_handler):
* src/charset.c (load_charset_map_from_vector):
* src/nsimage.m (ns_load_image):
* src/xfaces.c (load_pixmap, load_color2):
Simplify, now that add_to_log has a variable number of args.
* src/image.c (image_error): Take a variable number of args.
Callers simplified.
* src/lisp.h (add_to_log, vadd_to_log): Adjust to new APIs.
* src/xdisp.c (format_nargs, vadd_to_log): New functions.
(add_to_log): Make varargs, and reimplement in terms of vadd_to_log.
* src/xfaces.c (merge_face_ref): Fix typo that omitted color name.
Paul Eggert [Thu, 13 Aug 2015 19:16:25 +0000 (12:16 -0700)]
Optional args for holiday-greek-orthodox-easter
* etc/NEWS: Document this.
* lisp/calendar/holidays.el (holiday-greek-orthodox-easter):
Add optional args N and STRING, mimicking the API and code of
‘holiday-easter-etc’. From suggestion by Foivos S. Zakkak (Bug#21256).
Jürgen Hötzel [Thu, 13 Aug 2015 18:59:16 +0000 (20:59 +0200)]
; Fix caching problem in tramp-adb.el
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes): Make a copy of
result to prevent modification of the tramp-cache by side effects.
Use the correct cache key.
* lisp/emacs-lisp/find-func.el (find-feature-regexp): Move here from
elisp-mode.el, change to search for ";;; Code:"
(find-alias-regexp): Move here from elisp-mode.el, cleaned up.
(find-function-regexp-alist): Add them.
* lisp/progmodes/elisp-mode.el:
(elisp--xref-format, elisp--xref-format-extra): Change back to defvar due
to bug#21237.
(elisp--xref-find-definitions): Exclude co-located default methods for
generic functions. Also exclude implicitly declared defgeneric.
(elisp--xref-find-definitions): Handle C source properly. Exclude minor
mode variables defined by 'define-minor-mode'.
* test/automated/elisp-mode-tests.el: Declare generic functions, add
tests for them.
(xref-elisp-test-run): Fix bug.
(emacs-test-dir): Improve initial value.
(find-defs-defun-defvar-el): Don't expect defvar.
(find-defs-feature-el): Match change to find-feature-regexp.
Alan Mackenzie [Wed, 12 Aug 2015 21:28:55 +0000 (21:28 +0000)]
Introduce new macros to cover Emacs's new names in cl-lib.el.
This also eliminates `mapcan' warnings in XEmacs.
progmodes/cc-defs.el (c--mapcan-status): new variable to characterise
[X]Emacs versions.
(top-level): Require either 'cl or 'cl-lib, depending on
c--mapcan-status.
Change this back to cc-external-require from an eval-when-compile
require.
(c--mapcan, c--set-difference, c--intersection, c--macroexpand-all)
(c--delete-duplicates): New macros which expand into either old or new
names.
(c-make-keywords-re, c-lang-defconst, c-lang-const) Use the new macros
rather than the old names.
progmodes/cc-engine.el (c-declare-lang-variables): Use c--mapcan rather
than mapcan.
progmodes/cc-fonts.el (c-compose-keywords-list): Use c--mapcan.
progmodes/cc-langs.el (top-level): Require either 'cl or 'cl-lib,
depending on c--mapcan-status.
(c-filter-ops, c-all-op-syntax-tokens, c-assignment-op-regexp)
(c-type-start-kwds, c-prefix-spec-kwds, c-specifier-key)
(c-not-decl-init-keywords, c-not-primitive-type-keywords)
(c-paren-any-kwds, c-<>-sexp-kwds, c-block-stmt-kwds, c-expr-kwds)
(c-decl-block-key, c-keywords, c-keywords-obarray)
(c-regular-keywords-regexp, c-primary-expr-regexp,
c-primary-expr-regexp)
(c-block-prefix-disallowed-chars, c-known-type-key,
c-nonlabel-token-key)
(c-make-init-lang-vars-fun): Use the new macros rather than the old
names.
Oleh Krehel [Wed, 12 Aug 2015 18:12:14 +0000 (20:12 +0200)]
loadhist.el (read-feature): Conform to completing-read
* lisp/loadhist.el (read-feature): According to `completing-read'
documentation, if collection is a list, then it must be a list of
strings. And not a list of symbols like before.
David Kastrup [Wed, 28 Jan 2015 10:53:54 +0000 (11:53 +0100)]
Deal gracefully with up-events (Bug#19746)
* keyboard.c (apply_modifiers_uncached, parse_solitary_modifier)
(parse_modifiers_uncached): React gracefully to "up-" modifiers:
those may easily be injected by user-level Lisp code.
(read_key_sequence): Discard unbound up-events like unbound
down-events: they are even more likely only relevant for special
purposes.
While Emacs will not produce up-events on its own currently (those are
converted to drag or click events before being converted to
Lisp-readable structures), the input queue can be made to contain them
by synthesizing events to `unread-command-events'. Emacs should deal
consistently with such events.
Eli Zaretskii [Wed, 12 Aug 2015 15:55:38 +0000 (18:55 +0300)]
Fix display of thin lines whose newline has line-height property of t
* src/xdisp.c (append_space_for_newline): Don't try to fix ascent
and descent values of non-empty glyph rows, since they could have
forced low values deliberately. (Bug#21243)
Richard Stallman [Wed, 12 Aug 2015 15:21:49 +0000 (11:21 -0400)]
Re-enable mime processing after decryption. Add 'decrypt' keyword.
* rmail.el (rmail-epa-decrypt-1): New subroutine.
(rmail-epa-decrypt): rmail-epa-decrypt-1 broken out.
In a mime message, reenable Mime and show the parts that
were shown before.
Add keyword "decrypt" if anything decrypted.
* test/automated/elisp-mode-tests.el (xref-elisp-test-run): Split out
from xref-elisp-test for ease of debugging.
(xref-elisp-deftest): Rename from xref-elisp-test.
(find-defs-constructor): New test.
(find-defs-defgeneric-el): Match batch test config.
(compile): Required for find-defs compilation-minor-mode test.
(find-defs-defvar-el): Match code change.
(find-defs-face-el): Match code change.
Jürgen Hötzel [Tue, 11 Aug 2015 06:57:45 +0000 (08:57 +0200)]
; Fix prompt in tramp-adb.el
* lisp/net/tramp-adb.el (tramp-adb-prompt): Match leading escape
sequence. Recent adb version send initial escape sequences, even
when terminal type is set to TERM=dumb.