Paul Eggert [Fri, 4 Sep 2015 05:13:31 +0000 (22:13 -0700)]
Support automated ‘make check’ in non-C locale
This lets the builder optionally test Emacs behavior in other locales.
The C locale is still the default for tests.
* test/automated/Makefile.in (TEST_LOCALE): New macro.
(emacs): Use it.
* test/automated/flymake-tests.el (flymake-tests--current-face):
Use C locale for subprocesses so that tests behave as expected.
* test/automated/python-tests.el:
(python-shell-prompt-validate-regexps-1)
(python-shell-prompt-validate-regexps-2)
(python-shell-prompt-validate-regexps-3)
(python-shell-prompt-validate-regexps-4)
(python-shell-prompt-validate-regexps-5)
(python-shell-prompt-validate-regexps-6)
(python-shell-prompt-set-calculated-regexps-1):
Adjust expected output to match locale.
* test/automated/tildify-tests.el (tildify-test--test)
(tildify-space-test--test, tildify-space-undo-test--test):
This test assumes UTF-8 encoding.
Paul Eggert [Thu, 3 Sep 2015 22:31:12 +0000 (15:31 -0700)]
Fix some more docstring etc. quoting problems
Mostly these fixes prevent the transliteration of apostrophes
that should stay apostrophes. Also, prefer curved quotes in
Bahá’í proper names, as that’s the preferred Bahá’í style and
these names are chock-full of non-ASCII characters anyway.
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload)
(eieio-defclass-internal):
* lisp/emacs-lisp/eieio.el (defclass):
* lisp/hi-lock.el (hi-lock-mode):
Don’t transliterate Lisp apostrophes when generating a
doc string or diagnostic.
* lisp/international/mule-diag.el (list-coding-systems-1):
* lisp/international/ogonek.el (ogonek-jak, ogonek-how):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/vc/ediff-mult.el (ediff-redraw-registry-buffer):
* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map):
Substitute quotes before putting them in the help buffer.
Stefan Monnier [Thu, 3 Sep 2015 20:02:28 +0000 (16:02 -0400)]
Re-add the notion of echo_prompt lost in the translation
* src/keyboard.h (struct kboard): Replace echo_after_prompt with new
echo_prompt which contains the actual string. Update all uses.
* src/keyboard.c (kset_echo_prompt): New function.
(echo_update): Add echo_prompt at the very beginning.
(read_char): Remove workaround for bug#19875, not needed any more.
(read_key_sequence): Set echo_prompt rather than echo_string (bug#21403).
(mark_kboards): Mark echo_prompt.
Stefan Monnier [Thu, 3 Sep 2015 19:15:11 +0000 (15:15 -0400)]
Fix disassembly of non-compiled lexical functions (bug#21377)
* lisp/emacs-lisp/bytecomp.el (byte-compile): Handle `closure' arg.
* lisp/emacs-lisp/disass.el: Use lexical-binding.
(disassemble): Recognize `closure's as well.
(disassemble-internal): Use indirect-function and
help-function-arglist, and accept `closure's.
(disassemble-internal): Use interactive-form.
(disassemble-1): Use functionp.
Paul Eggert [Wed, 2 Sep 2015 22:08:03 +0000 (15:08 -0700)]
Treat initial-scratch-message as a doc string
* doc/emacs/building.texi (Lisp Interaction):
* doc/lispref/os.texi (Startup Summary):
* etc/NEWS: Document this.
* lisp/startup.el (initial-scratch-message):
Look up find-file’s key rather than hardcoding it.
(command-line-1): Substitute the doc string.
This also substitutes the quotes, which will help test display
quoting at startup.
Paul Eggert [Wed, 2 Sep 2015 21:43:03 +0000 (14:43 -0700)]
Fix describe-char bug with glyphs on terminals
* lisp/descr-text.el (describe-char): Terminals can have glyphs in
buffers too, so don’t treat them differently from graphic displays.
Without this fix, describe-char would throw an error on a terminal
if given a glyph with a non-default face.
Paul Eggert [Wed, 2 Sep 2015 20:55:41 +0000 (13:55 -0700)]
Follow text-quoting-style in display table init
This attempts to fix a problem reported by Alan Mackenzie in:
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00112.html
* doc/lispref/display.texi (Active Display Table):
Mention how text-quoting-style affects it.
* doc/lispref/help.texi (Keys in Documentation):
Say how to set text-quoting-style in ~/.emacs.
* etc/NEWS: Document the change.
* lisp/startup.el (startup--setup-quote-display):
Follow user preference if text-quoting-style is set.
(command-line): Setup quote display again if user expresses
a preference in .emacs.
Paul Eggert [Wed, 2 Sep 2015 01:21:42 +0000 (18:21 -0700)]
Escape ` and ' in doc
Escape apostrophes and grave accents in docstrings if they are
are supposed to stand for themselves and are not quotes. Remove
apostrophes from docstring examples like ‘'(calendar-nth-named-day
-1 0 10 year)’ that confuse source code with data. Do some other
minor docstring fixups as well, e.g., insert a missing close
quote.
Stefan Monnier [Wed, 2 Sep 2015 01:14:18 +0000 (21:14 -0400)]
Generalize the prefix-command machinery of C-u
* lisp/simple.el (prefix-command-echo-keystrokes-functions)
(prefix-command-preserve-state-hook): New hooks.
(internal-echo-keystrokes-prefix): New function.
(prefix-command--needs-update, prefix-command--last-echo): New vars.
(prefix-command-update, prefix-command-preserve): New functions.
(reset-this-command-lengths): New compatibility definition.
(universal-argument--mode): Call prefix-command-update.
(universal-argument, universal-argument-more, negative-argument)
(digit-argument): Call prefix-command-preserve-state.
* src/keyboard.c: Call internal-echo-keystrokes-prefix to build
the "prefix argument" to echo.
(this_command_key_count_reset, before_command_key_count)
(before_command_echo_length): Delete variables.
(echo_add_key): Always add a space.
(echo_char): Remove.
(echo_dash): Don't give up when this_command_key_count is 0, since that
is now the case after a prefix command.
(echo_update): New function, extracted from echo_now.
(echo_now): Use it.
(add_command_key, read_char, record_menu_key): Remove old disabled code.
(command_loop_1): Don't refrain from pushing an undo boundary when
prefix-arg is set. Remove other prefix-arg special case, now handled
directly in the prefix commands instead. But call echo_now if there's
a prefix state to echo.
(read_char, record_menu_key): Use echo_update instead of echo_char.
(read_key_sequence): Use echo_now rather than echo_dash/echo_char.
(Freset_this_command_lengths): Delete function.
(syms_of_keyboard): Define Qinternal_echo_keystrokes_prefix.
(syms_of_keyboard): Don't defsubr Sreset_this_command_lengths.
* lisp/simple.el: Use those new hooks for C-u.
(universal-argument--description): New function.
(prefix-command-echo-keystrokes-functions): Use it.
(universal-argument--preserve): New function.
(prefix-command-preserve-state-hook): Use it.
(command-execute): Call prefix-command-update if needed.
* lisp/kmacro.el (kmacro-step-edit-prefix-commands)
(kmacro-step-edit-prefix-index): Delete variables.
(kmacro-step-edit-query, kmacro-step-edit-insert): Remove ad-hoc
support for prefix arg commands.
(kmacro-step-edit-macro): Don't bind kmacro-step-edit-prefix-index.
* lisp/emulation/cua-base.el (cua--prefix-override-replay)
(cua--shift-control-prefix): Use prefix-command-preserve-state.
Remove now unused arg `arg'.
(cua--prefix-override-handler, cua--prefix-repeat-handler)
(cua--shift-control-c-prefix, cua--shift-control-x-prefix):
Update accordingly.
(cua--prefix-override-timeout): Don't call reset-this-command-lengths
any more.
(cua--keep-active, cua-exchange-point-and-mark): Don't set mark-active
if the mark is not set.
Paul Eggert [Wed, 2 Sep 2015 00:25:39 +0000 (17:25 -0700)]
Rework quoting in tutorial
* doc/lispintro/emacs-lisp-intro.texi (Sample let Expression)
(if in more detail, type-of-animal in detail, else): Rework the
early example to use " rather than ' so that we don’t burden
complete novices with the low-priority detail of text quoting style.
(Complete zap-to-char, kill-region, Complete copy-region-as-kill)
(kill-new function, kill-ring-yank-pointer)
(Complete forward-sentence, Loading Files)
(Code for current-kill, Code for current-kill, yank):
Resurrect the Emacs 22 versions of the code, which uses grave
quoting style in doc strings.
(Complete zap-to-char): Mention how quoting works in doc strings.
Paul Eggert [Tue, 1 Sep 2015 23:53:08 +0000 (16:53 -0700)]
Setup quote display only if interactive
* lisp/startup.el (command-line):
Skip call to startup--setup-quote-display if noninteractive.
Without this change, python-shell-prompt-validate-regexps-1
fails in test/automated/python-tests.el when run in an
en_US.utf8 locale on Fedora.
* lisp/gnus/gnus-util.el (gnus-format-message):
* lisp/net/tls.el (tls-format-message): Use defalias at the top level
so as to make eval-and-compile unnecessary. Thanks to Stefan Monnier.
Paul Eggert [Tue, 1 Sep 2015 19:06:00 +0000 (12:06 -0700)]
terminal-init-w32console mimicks command-line
Problem reported by Eli Zaretskii.
* lisp/startup.el (startup--setup-quote-display):
New function, refactored from a part of ‘command-line’.
(command-line): Use it.
* lisp/term/w32console.el (terminal-init-w32console):
Use it, so that this function stays consistent with ‘command-line’.
Paul Eggert [Tue, 1 Sep 2015 16:18:12 +0000 (09:18 -0700)]
Display replacement quotes with shadow glyphs
* lisp/startup.el (command-line): When displaying ASCII
replacements for curved quotes, use a shadow glyph instead of a
regular one, to avoid ambiguity.
Michael Albinus [Tue, 1 Sep 2015 12:57:39 +0000 (14:57 +0200)]
Some Tramp password fixes
* lisp/net/tramp.el (tramp-clear-passwd): Clear also the passwords
of the hops.
* lisp/net/tramp-sh.el (tramp-methods) <sudo>: Move "-p" "Password:"
at the beginning of the command. Otherwise, it could be
interpreted as password prompt if the remote host echoes the
command.
(tramp-remote-coding-commands): Add "openssl enc -base64".
Make vc-git-working-revision always return the commit hash
* lisp/vc/vc-git.el (vc-git-working-revision):
Return the commit hash (bug#21383).
(vc-git--symbolic-ref): New function, extracted from above.
(vc-git-mode-line-string): Use it.
K. Handa [Tue, 1 Sep 2015 11:44:51 +0000 (20:44 +0900)]
Use the new type MFLTGlyphFT for MFLTGlyphString.glyphs.
* ftfont.c (MFLTGlyphFT): New type.
(ftfont_get_glyph_id, ftfont_get_metrics, ftfont_drive_otf)
(ftfont_shape_by_flt): Make MFLTGlyphFT the actual type of
elements in the array MFLTGlyphString.glyphs.
* lisp/gnus/gnus-sum.el (gnus-summary-search-article):
Ensure that the article where the search word is found is displayed
and pointed to in the summary buffer.
* lisp/newcomment.el (comment-dwim): Use `use-region-p'
When the region is active, but is empty (length 0), act as though
the region was not active; that is, put a comment at the end of
the line. (Bug#21119)
Stephen Leake [Mon, 31 Aug 2015 15:32:26 +0000 (10:32 -0500)]
Fix some byte-compiler warnings in EDE
This fixes a bug that caused ede-generic-new-autoloader to overwrite the
existing autoloader list, rather than add to it.
* lisp/cedet/ede/auto.el (ede-project-class-files): Delete obsolete name
argument to eieio class constructor.
(ede-show-supported-projects): New.
(ede-add-project-autoload): Replace obsolete `eieio-object-name-string'
with (oref ... name).
(ede-auto-load-project): Use slot name, not initarg key.
* lisp/cedet/ede/generic.el (ede-generic-load,
ede-generic-find-matching-target): Use slot name, not initarg key.
(ede-find-target): Use oref-default on class name.
(ede-generic-new-autoloader): Delete obsolete name argument to eieio
class constructor.
(ede-enable-generic-projects): Make project type names unique.
Eli Zaretskii [Mon, 31 Aug 2015 14:52:47 +0000 (17:52 +0300)]
Fix handling long file names in readdir on MS-Windows
* src/w32.c (sys_readdir): Append "\*" to the directory after
converting it to UTF-16/ANSI, not before, to avoid overflowing the
260-character limit on file names in filename_to_utf16/ansi.
Eli Zaretskii [Mon, 31 Aug 2015 14:48:26 +0000 (17:48 +0300)]
Make file-accessible-directory-p reliable on MS-Windows
* src/w32.c (w32_accessible_directory_p): New function.
* src/w32.h (w32_accessible_directory_p): Add prototype.
* src/fileio.c (file_accessible_directory_p) [WINDOWSNT]: Call
w32_accessible_directory_p to test a directory for accessibility
by the current user. (Bug#21346)
(Ffile_accessible_directory_p): Remove the w32 specific caveat
from the doc string.
Paul Eggert [Mon, 31 Aug 2015 06:02:34 +0000 (23:02 -0700)]
Make ‘text-quoting-style’ a plain defvar
It doesn’t need customization, as it’s likely useful only by experts.
Suggested by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg01020.html
* lisp/cus-start.el: Remove doc.c section for builtin customized vars.
Paul Eggert [Mon, 31 Aug 2015 05:47:58 +0000 (22:47 -0700)]
Documentation fixes re quotes
Prefer curved quotes in examples if users will typically see
curved quotes when the examples run.
Mention format-message when appropriate.
Don’t use @code in examples.
Quote an apostrophe with @kbd.
Fix which-func for curly quotes: look for symbol, not message
* lisp/progmodes/which-func.el (which-func-ff-hook): Look for new
imenu-unavailable error symbol instead of trying to match message
exactly.
* lisp/imenu.el (imenu-unavailable): New error
(imenu-unavailable-error): New function.
Eli Zaretskii [Sat, 29 Aug 2015 14:39:47 +0000 (17:39 +0300)]
Fix Python tests on MS-Windows
* test/automated/python-tests.el
(python-shell-calculate-command-1): Run python-shell-interpreter
through shell-quote-argument before comparing with what
python-shell-calculate-command returns.
(python-shell-calculate-pythonpath-1)
(python-shell-calculate-pythonpath-2)
(python-shell-calculate-process-environment-2): Use path-separator
instead of a literal ':'.
(python-shell-calculate-exec-path-2)
(python-shell-calculate-exec-path-3)
(python-shell-calculate-exec-path-4)
(python-shell-with-environment-1)
(python-shell-with-environment-2): Run "/env/bin" through
expand-file-name before comparing with exec-path. (Bug#21375)
Paul Eggert [Thu, 27 Aug 2015 18:34:45 +0000 (11:34 -0700)]
Tweak startup screen quoting
* lisp/startup.el (normal-splash-screen): Use standard
"M-" abbrevation rather than a confusingly-different one.
(normal-no-mouse-startup-screen): Follow ‘text-quoting-style’.
Paul Eggert [Thu, 27 Aug 2015 15:50:22 +0000 (08:50 -0700)]
Add test case for ‘format’ bug and refactor
* src/editfns.c (styled_format): Refactor internally, mostly by
moving declarations closer to uses. This should not affect behavior.
* test/automated/textprop-tests.el (textprop-tests-format): New test.
Paul Eggert [Thu, 27 Aug 2015 09:36:56 +0000 (02:36 -0700)]
Use straight quotes in lib-src diagnostics
These auxiliary programs can’t use Emacs’s text-quoting-style,
and it’s too much trouble to redo that mechanism by hand.
So just use straight quotes for now.
* lib-src/ebrowse.c (main):
* lib-src/emacsclient.c (decode_options, main):
* lib-src/etags.c (Ada_help, default_C_help, Cplusplus_help)
(Forth_help, HTML_help, Lisp_help, Makefile_help, Objc_help)
(Perl_help, PHP_help, Python_help, Scheme_help, TeX_help, auto_help)
(none_help, print_language_names, print_help, add_regex)
(suggest_asking_for_help):
* lib-src/make-docfile.c (write_c_args, scan_c_stream):
Use straight quotes in diagnostics.
Paul Eggert [Thu, 27 Aug 2015 02:24:28 +0000 (19:24 -0700)]
Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
This removes the need for GCPRO1 etc. Suggested by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
* doc/lispref/internals.texi (Writing Emacs Primitives):
* etc/NEWS:
Document the change.
* src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
(nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
(Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
* src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
* src/eval.c (gcpro_level) [DEBUG_GCPRO]:
* src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
(GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
(GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
(BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
(GCPRO7, UNGCPRO, RETURN_UNGCPRO):
Remove. All uses removed. The code now assumes
GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
* src/bytecode.c (relocate_byte_stack):
Rename from unmark_byte_stack, since it now only relocates.
All callers changed.
* src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
with GCPROs removed.
* src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
* test/automated/finalizer-tests.el (finalizer-basic)
(finalizer-circular-reference, finalizer-cross-reference)
(finalizer-error):
* test/automated/generator-tests.el (cps-test-iter-close-finalizer):
Remove tests, as they depend on gc-precise.
Nicolas Petton [Wed, 26 Aug 2015 22:21:38 +0000 (00:21 +0200)]
Improve seq-concatenate for new sequence types
Use the new `seq-into-sequence' in seqs passed to `seq-concatenate' to
ensure that concatenation happens on sequences only. This makes it
possible to use `seq-concatenate' for new types of seqs.
* lisp/emacs-lisp/seq.el (seq-into-sequence, seq-concatenate): New
function used in `seq-concatenate'.
* test/automated/seq-tests.el (test-seq-into-sequence): New unit test
for seq-into-sequence.
Paul Eggert [Wed, 26 Aug 2015 20:11:57 +0000 (13:11 -0700)]
Fix quoting in ‘message_with_string’
* src/nsfont.m (nsfont_open): Use directed quotes in format; they
should work now.
* src/xdisp.c (message_to_stderr): New function, refactored from
part of ‘message3_nolog’.
(message3_nolog): Use it.
(message_with_string): Use it. Don’t mishandle NUL bytes when
noninteractive. Prefer AUTO_STRING when it’s most likely faster.
Use ‘format-message’, not ‘format’, so that quotes are translated.
Paul Eggert [Wed, 26 Aug 2015 15:25:56 +0000 (08:25 -0700)]
Treat error strings as help
* src/print.c (print_error_message): Translate quotes and command
keys in errmsg so that users see, e.g., "Symbol’s value as
variable is void: foo" when text-quoting-style is curved.
Paul Eggert [Wed, 26 Aug 2015 01:58:54 +0000 (18:58 -0700)]
Go back to grave quoting in Tramp
* lisp/net/tramp-adb.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-gw.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp.el:
Stick with grave quoting in diagnostics strings. This is more
portable to older Emacs, desirable for Tramp.
* lisp/net/tramp-cache.el: Use ‘format-message’, not ‘format’,
for diagnostic that needs requoting.
* lisp/net/tramp-compat.el (format-message):
Fall back on simple ‘format’, since that’s good enough now.
Paul Eggert [Wed, 26 Aug 2015 01:46:18 +0000 (18:46 -0700)]
Fix customization of text-quoting-style
* lisp/cus-edit.el (custom-guess-type, custom-variable-documentation):
* lisp/wid-edit.el (widget-docstring):
Get raw docstring here since it’s cooked later and should not be
cooked twice.
* lisp/cus-edit.el (custom-group-value-create):
Cook the docstring before inserting it.
* lisp/cus-start.el (text-quoting-style): Quote the customization
docstrings according to the new rules. Give curved examples.
Paul Eggert [Wed, 26 Aug 2015 01:41:31 +0000 (18:41 -0700)]
format-message now curves ` and '
That way, the caller doesn’t have to use curved quotes to
get diagnostics that match the text-quoting-style preferences.
Suggested by Dmitry Gutov in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00893.html
This means we no longer need %qs, so remove that format.
While we’re at it, fix an unlikely bug and lessen the pressure
on the garbage collector by processing the string once rather
than twice in the usual case.
* doc/lispref/strings.texi (Formatting Strings):
* etc/NEWS: Document this.
* lisp/subr.el (format-message): Remove; now done in C.
* src/callint.c (Fcall_interactively):
* src/editfns.c (Fmessage, Fmessage_box):
Use Fformat_message instead of Finternal__text_restyle
followed by Fformat.
* src/doc.c (LSQM, RSQM): Remove; all uses changed to use
uLSQM and uRSQM.
(Fsubstitute_command_keys): Prefer AUTO_STRING to build_string
when pure ASCII now suffices. Fix unlikely bug when parsing
unibyte string containing non-ASCII bytes. Use inline code
rather than memcpy, as it’s a tiny number of bytes.
(Finternal__text_restyle): Remove; no longer used.
(syms_of_doc): Don’t declare it.
* src/editfns.c (Fformat): Rewrite in terms of new function
‘styled_format’.
(Fformat_message): New function, moved here from subr.el.
(styled_format): New function, with the old guts of Fformat,
except it now optionally transliterates quotes, and it transliterates
traditional grave accent and apostrophe quoting as well.
Remove recently-added q flag; no longer needed or used.
(syms_of_editfns): Define format-message.
* src/lisp.h (uLSQM0, uLSQM1, uLSQM2, uRSQM0, uRSQM1, uRSQM2):
Remove; no longer need to be global symbols.
* src/xdisp.c (vadd_to_log): Use Fformat_message, not Fformat,
so that callers can use `%s'.
* src/image.c (image_size_error, xbm_load_image, xbm_load)
(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 `%s' instead of %qs in formats.
Paul Eggert [Tue, 25 Aug 2015 06:37:18 +0000 (23:37 -0700)]
Treat ' like ’ even when not matching `
This is simpler and easier to explain, and should encourage better
typography. Do this in Electric Quote mode and when translating
quotes in docstrings. Inspired by a suggestion by Dmitry Gutov in:
https://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00806.html
* doc/emacs/text.texi (Quotation Marks):
* doc/lispref/help.texi (Keys in Documentation):
* etc/NEWS:
Document this.
* lisp/electric.el (electric-quote-post-self-insert-function):
* src/doc.c (Fsubstitute_command_keys):
Always treat ' like ’ even when not matched by an open quote.