Karl Fogel [Sat, 26 Nov 2016 05:44:48 +0000 (23:44 -0600)]
Handle TeX comments when making new paragraph
* lisp/textmodes/tex-mode.el (tex-handle-newline): New function.
Handle comment case directly, and dispatch to `tex-terminate-paragraph'
for original behavior in non-comment case.
(tex-mode-map): Bind above to C-j, replacing `tex-terminate-paragraph'.
Eli Zaretskii [Thu, 24 Nov 2016 17:37:38 +0000 (19:37 +0200)]
; Minor copyedit in the Emacs manual
* doc/emacs/maintaining.texi (Select Tags Table): Remove text that
is no longer pertinent. (The "explained above" part was moved to
another place in the manual a long time ago.)
Philipp Stephani [Tue, 22 Nov 2016 20:32:11 +0000 (21:32 +0100)]
Guard terminal parameter in XTerm mouse mode
It has been observed (in the HTerm terminal emulator) that the
event stored in the 'xterm-mouse-last-down' terminal parameter gets
overwritten during a mouse drag operation, causing Emacs to attempt to
synthesize the non-existing <drag-mouse-0> event. Copy the event into
the terminal parameter to protect against such modifications.
* lisp/xt-mouse.el (xterm-mouse-translate-1): Guard against modification
of input event list.
Eli Zaretskii [Mon, 21 Nov 2016 16:22:10 +0000 (18:22 +0200)]
Fix menu bindings of Dired 'A' and 'Q' commands
* lisp/dired.el (dired-mode-map): Rebind "Search Files" and "Query
Replace in Files" menu items to 'dired-do-find-regexp' and
'dired-do-find-regexp-and-replace', respectively. (Bug#24977)
Eli Zaretskii [Sun, 20 Nov 2016 19:08:47 +0000 (21:08 +0200)]
Avoid errors in shr-pixel-column due to dedicated windows
* lisp/net/shr.el (shr-pixel-column): If we are switching to
another buffer in the selected window, make that window
temporarily non-dedicated. (Bug#24950)
Eli Zaretskii [Fri, 18 Nov 2016 11:02:34 +0000 (13:02 +0200)]
Improve documentation of functions that accept time values
* doc/lispref/os.texi (Time Calculations): Mention the meaning of
'nil' or a scalar number as the time-value argument. Add a
cross-reference to 'float-time' for computing a time difference as
a scalar number of seconds.
* src/editfns.c (Fformat_time_string, Ftime_less_p)
(Ftime_subtract, Ftime_add, Fdecode_time, Fcurrent_time_string)
(Fcurrent_time_zone): Mention in the doc strings the meaning of
nil argument and the fact that a time value can be a scalar number
of seconds since the epoch.
(Ftime_subtract): Mention 'float-time'.
Eli Zaretskii [Wed, 16 Nov 2016 16:11:33 +0000 (18:11 +0200)]
Fix sluggish display of symbols in UTF-8 language environment
* lisp/international/fontset.el (setup-default-fontset): Make sure
Symbola and FreeMono are set up in the default fontset as belonging
to the "iso10646-1" registry. In the UTF-8 locale, this avoids a
long and futile search for a suitable font, whose side effect is a
lot of consing, which then hits the font-cache compacting issue,
and causes very sluggish redisplay of characters displayed by
these fonts. All this happens because the default for the
registry is "iso8859-1". (Bug#24953)
Glenn Morris [Wed, 16 Nov 2016 00:18:28 +0000 (19:18 -0500)]
Don't confuse how Texinfo outputs @var with the input
* doc/emacs/rmail.texi (Movemail):
* doc/lispref/control.texi (Pattern matching case statement):
* doc/lispref/frames.texi (Size and Position):
* doc/lispref/processes.texi (Asynchronous Processes):
* doc/lispref/text.texi (Document Object Model):
* doc/lispref/windows.texi (Coordinates and Windows):
Do not upper-case the argument of @var.
Alan Mackenzie [Thu, 10 Nov 2016 21:22:05 +0000 (21:22 +0000)]
Correct the statement about programming modes always running prog-mode-hook.
doc/emacs/modes.texi (Major Modes): Amend the statement about programming
modes running prog-mode-hook to say that it applies to many (not all) such
modes, and specifying exactly which modes.
Noam Postavsky [Tue, 8 Nov 2016 01:03:48 +0000 (20:03 -0500)]
Do call debugger on failed cl-assert
"Don't call debug on failed cl-assert..." removed the call to `debug' in
cl--assertion-failed because `debug' calls `kill-emacs' in batch mode,
thus messing up ert test runs. However, calling the debugger is useful
because it allows catching failed assertions even inside
`condition-case' calls. The problem with ert can be avoided by calling
`debugger' instead of `debug' directly, since ert installs its own
debugger while running tests.
* lisp/emacs-lisp/cl-preloaded.el (cl--assertion-failed): Call
`debugger' if `debug-on-error' is non-nil.
* lisp/progmodes/python.el (python-info-docstring-p): Improve
infloop avoidance: replace (bobp) with generic test for
forward progress.
* test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid): Add
test for bug#24905
* doc/emacs/abbrevs.texi (Dynamic Abbrevs): Mention
'dabbrev-check-all-buffers', 'dabbrev-check-other-buffers', and
'dabbrev-ignored-buffer-names' and their purpose. (Bug#24890)
Noam Postavsky [Wed, 2 Nov 2016 03:24:33 +0000 (23:24 -0400)]
Fix python-mode hideshow regexp
2015-02-07 "Fix hideshow integration[...]" changed the regexp added to
`hs-special-modes-alist' so that it worked when not searching from the
beginning of the line. However, this allows matching tokens ending in
"def" or "class", not just those keywords. This results in an infinite
loop in hs-hide-all (Bug #24815).
* lisp/progmodes/python.el (python-mode): Add symbol boundaries around
the def|class matching part of the regexp added to
hs-special-modes-alist.
Paul Eggert [Sun, 6 Nov 2016 07:33:43 +0000 (00:33 -0700)]
Modernize usage of 'macOS' in doc and comments
Apple changed the spelling of its operating system again, to "macOS",
effective with macOS 10.12 Sierra (2016-09-20). Change Emacs
documentation and comments to match this. Stick with older OS
spellings ("OS X", "Mac OS X") when talking about older releases where
the older names are more correct.
Paul Eggert [Sun, 6 Nov 2016 03:41:37 +0000 (20:41 -0700)]
Prefer comments /* like this */ in C code
Emacs C code assumes C99 features, but has long used traditional
comments /* like this */ instead of C99-style comments // like this.
Stick with traditional comments for now, partly for style, partly as
it may be safer with compilers that are not fully in C99 mode.
Noam Postavsky [Sat, 5 Nov 2016 01:40:16 +0000 (21:40 -0400)]
Don't call debug on failed cl-assert
Doing this causes problems when running ert tests, for
instance (Bug#24778). The call to `debug` when `debug-on-error' is
non-nil was introduced in 2015-02-14 "* lisp/emacs-lisp/cl*.el: Use
define-inline and move some code...".
Phillip Lord [Fri, 4 Nov 2016 20:50:55 +0000 (20:50 +0000)]
Update README for precompiled windows Emacs.
* nt/README.W32: Describe 64 and 32-bit downloads, optional
dependencies bundle. Remove old material on sourcing dependencies.
Remove references to Windows 95. Update GUI references to recent
Windows. Remove references to Usenet.
Eli Zaretskii [Fri, 4 Nov 2016 09:50:48 +0000 (11:50 +0200)]
Clarify doc string of 'transpose-sexps'
* lisp/simple.el (transpose-sexps): Clarify the conditions for
transposing sexps that are lists or strings. Mention the effect
of the prefix argument. (Bug#24860)
Eli Zaretskii [Fri, 4 Nov 2016 09:16:40 +0000 (11:16 +0200)]
Improve documentation of 'font-lock-remove-keywords'
* doc/lispref/modes.texi (Customizing Keywords): Clarify the
'keywords' argument of 'font-lock-remove-keywords'. Suggested by
Hong Xu <hong@topbug.net>. (Bug#24830)
python.el: Fix detection of native completion in Python 3 (bug #24401)
With Python 3.5, (python-shell-completion-native-get-completions ... "")
would return an empty list, causing python.el to think that native
completion was unavailable (the difference between Python 2 and Python 3
is due to https://bugs.python.org/issue25660).
* lisp/progmodes/python.el (python-shell-completion-native-try): Use "_"
to check whether native completion is available instead of "".
Noam Postavsky [Tue, 25 Oct 2016 01:22:07 +0000 (21:22 -0400)]
Inhibit buffer relocation during regex searches
* src/search.c (looking_at_1, fast_looking_at, search_buffer): Prevent
relocation of buffer contents during calls to re_search_2. This ensures
the pointers into buffer text won't be invalidated by
r_alloc_sbrk (called from malloc with configurations where
REL_ALLOC=yes).
Paul Eggert [Tue, 25 Oct 2016 19:13:20 +0000 (12:13 -0700)]
Default REL_ALLOC to 'no'
This should make ralloc-related bugs less likely on GNU/Linux
systems with bleeding-edge glibc. See the email thread containing:
http://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00801.html
Do not merge to master.
* configure.ac (REL_ALLOC): Default to 'no' on all platforms, not
merely on platforms with Doug Lea malloc. Although bleeding-edge
glibc no longer exports __malloc_initialize_hook and so longer
passes the configure-time test for Doug Lea malloc, ralloc tickles
longstanding bugs like Bug#24358 and Bug#24764 and Emacs is likely
to be more reliable without it. This patch is not needed on
master, which uses hybrid malloc in this situation.
Eli Zaretskii [Mon, 24 Oct 2016 13:59:34 +0000 (16:59 +0300)]
Another fix for using pointer to buffer text
* src/search.c (Freplace_match): Move the call to BYTE_POS_ADDR
after the call to xpalloc, to avoid the danger of buffer text
relocation after its address was taken. (Bug#24358)
Michael Albinus [Mon, 24 Oct 2016 13:04:25 +0000 (15:04 +0200)]
Fix Bug#24478
* lisp/net/tramp-sh.el (tramp-histfile-override): Change default value
to "~/.tramp_history".
(tramp-open-shell): Check proper HISTFILE setting.
(tramp-maybe-open-connection): Cleanup also for errors. (Bug#24478)
Paul Eggert [Mon, 24 Oct 2016 04:54:13 +0000 (21:54 -0700)]
Port --enable-gcc-warnings to bleeding-edge glibc
Bleeding-edge glibc sets emacs_cv_var_doug_lea_malloc to 'no'.
Do not merge to master.
* configure.ac: Check for valloc decl when compiling gmalloc.c.
* src/gmalloc.c (emacs_abort) [emacs]: Adjust decl to match
what is in lisp.h. Remove duplicate decl.
(aligned_alloc): #undef before defining.
(aligned_alloc, memalign) [!MSDOS]: Declare.
(valloc) [HAVE_DECL_VALLOC]: Remove duplicate decl.
Paul Eggert [Sun, 23 Oct 2016 04:12:54 +0000 (21:12 -0700)]
Port to GCC 6.2.1 + --enable-gcc-warnings
* src/regex.c (ENSURE_FAIL_STACK, re_search_2):
Redo recent regex changes to avoid complaints from GCC 6.2.1 when
Emacs is configured with --enable-gcc-warnings. Also, work around
GCC bug 78081, which was uncovered by this new code.
Noam Postavsky [Mon, 3 Oct 2016 22:49:56 +0000 (18:49 -0400)]
Let describe-function work for lambda again
Since commit "* lisp/help-fns.el (describe-function): More type
checking[...]", `describe-function' throws a user-error when given a
non-symbol. This prevents the [back] button in a *Help* buffer from
working when the page it goes back to describes an anonymous
function (e.g., the result of `describe-key' on a key which is bound to
a lambda form).
* lisp/help-fns.el (describe-function): Move the checks on FUNCTION
being an fbound symbol into the `interactive' form. This allows
non-interactive calls to pass an anonymous function (Bug #24221). Note
that passing a non-bound symbol non-interactively will still trigger a
`void-function' error from `describe-function-1'.
Noam Postavsky [Thu, 20 Oct 2016 00:23:50 +0000 (20:23 -0400)]
Fix handling of allocation in regex matching
`re_match_2_internal' uses pointers to the lisp objects that it
searches. Since it may call malloc when growing the "fail stack", these
pointers may be invalidated while searching, resulting in memory
curruption (Bug #24358).
To fix this, we check the pointer that the lisp object (as specified by
re_match_object) points to before and after growing the stack, and
update existing pointers accordingly.
* src/regex.c (STR_BASE_PTR): New macro.
(ENSURE_FAIL_STACK, re_search_2): Use it to convert pointers into
offsets before possible malloc call, and back into pointers again
afterwards.
(POS_AS_IN_BUFFER): Add explanatory comment about punning trick.
* src/search.c (search_buffer): Instead of storing search location as
pointers, store them as pointers and recompute the corresponding address
for each call to `re_search_2'.
(string_match_1, fast_string_match_internal, fast_looking_at):
* src/dired.c (directory_files_internal): Set `re_match_object' to Qnil
after calling `re_search' or `re_match_2'.
* src/regex.h (re_match_object): Mention new usage in commentary.