]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoAdd assertion related to display-line-numbers
Eli Zaretskii [Fri, 14 Jul 2017 08:00:25 +0000 (11:00 +0300)]
Add assertion related to display-line-numbers

* src/xdisp.c (maybe_produce_line_number): Add assertion for the
condition regarding IT->glyph_row->used[TEXT_AREA] expected by the
code.  (Bug#27668)

7 years agoPrevent display corruption when display-line-numbers is set
Eli Zaretskii [Fri, 14 Jul 2017 07:53:36 +0000 (10:53 +0300)]
Prevent display corruption when display-line-numbers is set

* src/xdisp.c (try_window_reusing_current_matrix): If giving up
due to display-line-numbers, clear the window's desired glyph
matrix before returning, as the following call to try_window will
call display_line, which expects rows of the desired matrix
cleared.  (Bug#27668)

7 years agoRevert "Use fixed-pitch font for display-line-numbers"
Eli Zaretskii [Fri, 14 Jul 2017 06:24:44 +0000 (09:24 +0300)]
Revert "Use fixed-pitch font for display-line-numbers"

This reverts commit d014a5e15c1110af77e7a96f06ccd0f0cafb099f.
* lisp/faces.el (line-number): Don't use a fixed-pitch font, by
popular demand.  For relevant discussions, see

 http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00433.html
 http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00445.html

7 years agoMerge from gnulib
Paul Eggert [Fri, 14 Jul 2017 02:24:06 +0000 (19:24 -0700)]
Merge from gnulib

This incorporates:
2017-07-13 Improve cross-compilation guesses for native Windows
2017-07-11 More systematic m4 quoting and indentation
2017-07-10 Make sure $host and $host_os are defined when used
2017-07-03 stdioext: Port to OpenVMS
2017-06-24 xalloc-oversized: port to icc
* doc/misc/texinfo.tex, lib/fpending.c, lib/stdio-impl.h:
* lib/xalloc-oversized.h, m4/dirfd.m4, m4/gettimeofday.m4:
* m4/lstat.m4, m4/mktime.m4, m4/pselect.m4, m4/putenv.m4:
* m4/stdint.m4, m4/strtoimax.m4, m4/utimes.m4:
Copy from Gnulib.

7 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Vincent Belaïche [Thu, 13 Jul 2017 21:25:34 +0000 (23:25 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

7 years agoC++ Mode. Fix anomaly occurring when a ">" is deleted then reinserted.
Alan Mackenzie [Thu, 13 Jul 2017 19:56:00 +0000 (19:56 +0000)]
C++ Mode.  Fix anomaly occurring when a ">" is deleted then reinserted.

This fontification anomaly happened because after deleting the ">",
c-forward-<>-arglist parses the preceding identifier as a putative type but
stores it in c-found-types before it becomes clear it is not an unambiguous
type.  c-forward-<>-arglist fails, leaving the spurious type id in
c-found-types.  Fix this by "binding" c-found-types "to itself" in
c-forward-<>-arglist, and restoring the original value when that function call
fails.

* lisp/progmodes/cc-engine.el (c-copy-found-types): New function.
(c-forward-<>-arglist): Record the original value of c-found-types at the
beginning of the function, and restore it at the end on failure.

* lisp/progmodes/cc-mode.el (c-unfind-coalesced-tokens): Rewrite more
accurately.

7 years agoAdd tests for SES, and fix one more cell renaming bug.
Vincent Belaïche [Thu, 13 Jul 2017 18:58:22 +0000 (20:58 +0200)]
Add tests for SES, and fix one more cell renaming bug.

* lisp/ses.el (ses-relocate-all): In case of insertion, do not
relocate value for named cells as they keep the same symbol.
(ses-rename-cell): Set new cell name symbol to cell value --- do not
rely on recalculating.  Push cells with updated data --- cell name,
cell reference list, or cell formula --- to deferred write list.

* test/lisp/ses-tests.el: New file, with 7 tests for SES.

7 years ago; Improve tramp-tests traces
Michael Albinus [Thu, 13 Jul 2017 14:40:07 +0000 (16:40 +0200)]
; Improve tramp-tests traces

7 years agoFix some bugs in c-defun-name. This fixes bug #25623.
Alan Mackenzie [Wed, 12 Jul 2017 20:15:56 +0000 (20:15 +0000)]
Fix some bugs in c-defun-name.  This fixes bug #25623.

* lisp/progmodes/cc-cmds.el (c-defun-name): Fix some bugs to do with structs,
etc.

7 years agoMake prog-mode-map the parent of c-mode-base-map. Fixes bug #26658.
Vasilij Schneidermann [Wed, 12 Jul 2017 17:42:12 +0000 (17:42 +0000)]
Make prog-mode-map the parent of c-mode-base-map.  Fixes bug #26658.

* lisp/progmodes/cc-mode.el (top level): Make prog-mode-map the parent of
c-mode-base-map if possible.

7 years agoCC Mode: create and use c-set-keymap-parent.
Alan Mackenzie [Wed, 12 Jul 2017 17:03:35 +0000 (17:03 +0000)]
CC Mode: create and use c-set-keymap-parent.

* lisp/progmodes/cc-defs.el (c-set-keymap-parent): New macro.

* lisp/progmodes/cc-mode.el (top-level): Remove cc-bytecomp-defun for
set-keymap-parents.
(c-make-inherited-keymap): Use c-set-keymap-parent in place of inline code.

7 years agoMinor tweaks of new line number display variables
Martin Rudalics [Wed, 12 Jul 2017 15:35:31 +0000 (17:35 +0200)]
Minor tweaks of new line number display variables

* src/xdisp.c (Vdisplay_line_numbers): Tweak doc-string.
(Vdisplay_line_number_width): Rename to
Vdisplay_line_numbers_width.
(maybe_produce_line_number): Comply with above rename.
* lisp/cus-start.el (standard):
* lisp/frame.el (top-level):
* etc/NEWS: Comply with renaming of
`display-line-number-width' to `display-line-numbers-width'.

7 years agoAvoid assertion violations in close_infile_unwind
Eli Zaretskii [Wed, 12 Jul 2017 14:49:21 +0000 (17:49 +0300)]
Avoid assertion violations in close_infile_unwind

* src/lread.c (close_infile_unwind): A temporary band-aid solution
for bug#27642: allow 'infile' be NULL.

7 years ago; Enable traces for tramp-tests.el on hydra
Michael Albinus [Wed, 12 Jul 2017 12:53:53 +0000 (14:53 +0200)]
; Enable traces for tramp-tests.el on hydra

7 years agoUse fixed-pitch font for display-line-numbers
Eli Zaretskii [Tue, 11 Jul 2017 15:16:36 +0000 (18:16 +0300)]
Use fixed-pitch font for display-line-numbers

* lisp/faces.el (line-number): Use a fixed-pitch font by default,
even if the default face uses a variable-pitch font.  Reported by
James Cloos <cloos@jhcloos.com>.

7 years ago; * src/xdisp.c (syms_of_xdisp) <display-line-numbers>: Copyedits.
Eli Zaretskii [Tue, 11 Jul 2017 15:11:33 +0000 (18:11 +0300)]
; * src/xdisp.c (syms_of_xdisp) <display-line-numbers>: Copyedits.

7 years agoImprove documentation of display-line-numbers
Eli Zaretskii [Tue, 11 Jul 2017 15:08:46 +0000 (18:08 +0300)]
Improve documentation of display-line-numbers

* src/xdisp.c (syms_of_xdisp) <display-line-numbers>: Improve the
doc string.  Suggested by Alex <agrambot@gmail.com>.

7 years agoAdd an optional testfn parameter to assoc
Nicolas Petton [Fri, 7 Jul 2017 19:21:55 +0000 (21:21 +0200)]
Add an optional testfn parameter to assoc

* src/fns.c (assoc): New optional testfn parameter used for comparison
when provided.
* test/src/fns-tests.el (test-assoc-testfn): Add tests for the new
'testfn' parameter.
* src/buffer.c:
* src/coding.c:
* src/dbusbind.c:
* src/font.c:
* src/fontset.c:
* src/gfilenotify.c:
* src/image.c:
* src/keymap.c:
* src/process.c:
* src/w32fns.c:
* src/w32font.c:
* src/w32notify.c:
* src/w32term.c:
* src/xdisp.c:
* src/xfont.c: Add a third argument to Fassoc calls.
* etc/NEWS:
* doc/lispref/lists.texi: Document the new 'testfn' parameter.

7 years agoUse `with-demoted-errors' in Tramp
Michael Albinus [Mon, 10 Jul 2017 15:49:01 +0000 (17:49 +0200)]
Use `with-demoted-errors' in Tramp

* lisp/net/tramp.el (tramp-with-demoted-errors): New defmacro.

* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Use it.

7 years agoAdd Quick Start Guide to Tramp manual
Michael Albinus [Mon, 10 Jul 2017 13:36:23 +0000 (15:36 +0200)]
Add Quick Start Guide to Tramp manual

* doc/misc/tramp.texi: Use consequently "@value{tramp}" and
"MS Windows".
(Quick Start Guide): New node.

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.3-pre".

7 years agoFix failing module tests on GNU/Linux
Glenn Morris [Sun, 9 Jul 2017 23:43:09 +0000 (16:43 -0700)]
Fix failing module tests on GNU/Linux

* test/src/emacs-module-tests.el
(module--test-assertions--load-non-live-object)
(module--test-assertions--call-emacs-from-gc):
Avoid test failures due to backtraces.

7 years agoFix core dump in substitute-object-in-subtree
Paul Eggert [Sun, 9 Jul 2017 23:04:02 +0000 (16:04 -0700)]
Fix core dump in substitute-object-in-subtree

Without this fix, (substitute-object-in-subtree #0=(#0# 'a) 'a)
would dump core, since the C code would recurse indefinitely through
the infinite structure.  This patch adds an argument to the function,
and renames it to lread--substitute-object-in-subtree as the function
is not general-purpose and should not be relied on by outside code.
See Bug#23660.
* src/intervals.c (traverse_intervals_noorder): ARG is now void *,
not Lisp_Object, so that callers need not cons unnecessarily.
All callers changed.  Also, remove related #if-0 code that was
“temporary” in the early 1990s and has not been compilable for
some time.
* src/lread.c (struct subst): New type, for substitution closure data.
(seen_list): Remove this static var, as this info is now part of
struct subst.  All uses removed.
(Flread__substitute_object_in_subtree): Rename from
Fsubstitute_object_in_subtree, and give it a 3rd arg so that it
doesn’t dump core when called from the top level with an
already-cyclic structure.  All callers changed.
(SUBSTITUTE): Remove.  All callers expanded and then simplified.
(substitute_object_recurse): Take a single argument SUBST rather
than a pair OBJECT and PLACEHOLDER, so that its address can be
passed around as part of a closure; this avoids the need for an
AUTO_CONS call.  All callers changed.  If the COMPLETED component
is t, treat every subobject as potentially circular.
(substitute_in_interval): Take a struct subst * rather than a
Lisp_Object, for the closure data.  All callers changed.
* test/src/lread-tests.el (lread-lread--substitute-object-in-subtree):
New test, to check that the core dump does not reoccur.

7 years agoMinor simplification of module_free_global_ref
Philipp Stephani [Sun, 9 Jul 2017 22:33:30 +0000 (00:33 +0200)]
Minor simplification of module_free_global_ref

* src/emacs-module.c (module_free_global_ref): Remove unused variable
'hashcode'.  Inline variable 'value' that's only used once.

7 years agoRe-add a useful assertion
Philipp Stephani [Sun, 9 Jul 2017 22:28:50 +0000 (00:28 +0200)]
Re-add a useful assertion

* src/emacs-module.c (module_free_global_ref): Re-add assertion that
the reference count is zero.  This assertion was removed in commit
8afaa1321f8088bfb877fe4b6676e8517adb0bb7, but it's not included in the
test performed by XFASTINT before, because the previous reference
count could have been zero already in the case of a buggy
implementation.  This assertion might have detected Bug#27587.

7 years agoFix bug in module_free_global_ref (Bug#27587)
Valentin Gatien-Baron [Sun, 9 Jul 2017 22:08:52 +0000 (00:08 +0200)]
Fix bug in module_free_global_ref (Bug#27587)

* src/emacs-module.c (module_free_global_ref): Actually remove entry
from hash table.

Copyright-paperwork-exempt: yes

7 years agoFurther improve electric quote support for Markdown (Bug#24709)
Philipp Stephani [Sun, 2 Jul 2017 16:14:21 +0000 (18:14 +0200)]
Further improve electric quote support for Markdown (Bug#24709)

Markdown sets both 'comment-start' and 'comment-use-syntax' to non-nil
values.  Therefore 'electric-quote-mode' recognized it as a
programming mode.  Fix this by first checking whether the current
major mode is derived from 'text-mode'.

* lisp/electric.el (electric-quote-post-self-insert-function): Treat
'text-mode' as stronger signal than comment syntax.

* test/lisp/electric-tests.el (electric-quote-markdown-in-text)
(electric-quote-markdown-in-code): Adapt unit tests.

7 years agoRemove pointless code in 'electric-quote-mode'
Philipp Stephani [Sun, 2 Jul 2017 16:04:38 +0000 (18:04 +0200)]
Remove pointless code in 'electric-quote-mode'

* lisp/electric.el (electric-quote-post-self-insert-function): Remove
pointless form.

7 years agoRefactor 'electric-quote-mode'
Philipp Stephani [Sun, 2 Jul 2017 16:03:06 +0000 (18:03 +0200)]
Refactor 'electric-quote-mode'

* lisp/electric.el (electric-quote-post-self-insert-function): Remove
local variable 'start', which was misnamed and only used once.

7 years agoAvoid crashes on MS-Windows starting 64-bit .NET executables
Saulius Menkevičius [Sun, 9 Jul 2017 18:16:17 +0000 (21:16 +0300)]
Avoid crashes on MS-Windows starting 64-bit .NET executables

* src/w32proc.c (w32_executable_type): Don't assume that the
import directory in a DLL will always be non-NULL.  (Bug#27527)

Copyright-paperwork-exempt: yes

7 years agoAvoid compilation warning in files.el
Eli Zaretskii [Sun, 9 Jul 2017 17:35:57 +0000 (20:35 +0300)]
Avoid compilation warning in files.el

* lisp/files.el (auto-save-visited-file-name): Avoid obsoletion
warning due to its use in auto-save-visited-mode.

7 years agoImprove indexing of VC-related stuff in the Emacs manual
Eli Zaretskii [Sun, 9 Jul 2017 14:46:59 +0000 (17:46 +0300)]
Improve indexing of VC-related stuff in the Emacs manual

* doc/emacs/maintaining.texi (Version Control): Add a "VC" index
entry.  (Bug#27627)

7 years ago; * etc/NEWS: Fix a typo.
Eli Zaretskii [Sun, 9 Jul 2017 14:42:16 +0000 (17:42 +0300)]
; * etc/NEWS: Fix a typo.

7 years agoSpeed up display of line numbers for very large buffers
Eli Zaretskii [Sun, 9 Jul 2017 14:37:23 +0000 (17:37 +0300)]
Speed up display of line numbers for very large buffers

* src/xdisp.c (maybe_produce_line_number): Speed up line counting
using values cached by mode-line display of line numbers.
(Bug#27622)

7 years ago; * src/emacs-module.c (module_assert_thread): Simplify.
Philipp Stephani [Sun, 9 Jul 2017 11:43:45 +0000 (13:43 +0200)]
; * src/emacs-module.c (module_assert_thread): Simplify.

7 years agoDefine internal_border_parts for window systems only (Bug#27615)
Alexander Kuleshov [Sun, 9 Jul 2017 07:11:57 +0000 (09:11 +0200)]
Define internal_border_parts for window systems only (Bug#27615)

* src/keyboard.c: (internal_border_parts): Define only
when HAVE_WINDOW_SYSTEM is enabled.  (Bug#27615)

7 years agoAdd realgud faces faces to whiteboard...
R. Bernstein [Sun, 9 Jul 2017 01:57:33 +0000 (21:57 -0400)]
Add realgud faces faces to whiteboard...

Adjust wheatgrass to use underline for enabled/disabled breakpoints

7 years ago; Merge: Update and optimize UCS normalization tests
Noam Postavsky [Sat, 8 Jul 2017 18:32:07 +0000 (14:32 -0400)]
; Merge: Update and optimize UCS normalization tests

7 years agoOptimize UCS normalization tests
Noam Postavsky [Sat, 8 Jul 2017 17:20:17 +0000 (13:20 -0400)]
Optimize UCS normalization tests

Brings the the time for `ucs-normalize-part1' from 200s down to 130s.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--parse-column): Use character instead of string
of length 1 for terminator.  Convert return value into string since
all callers need that form anyway.
(ucs-normalize-tests--normalization-equal-p): Rename from
ucs-normalize-tests--normalize.  Use dedicated buffer instead of
messing with narrowing.  Take string to compare against and insert it
into buffer so that compare-buffer-substrings can be used instead of
allocating a new string from buffer contents.
(ucs-normalize-tests--normalization-chareq-p): New macro, specialized
for comparing single character.
(ucs-normalize-tests--rule1-holds-p)
(ucs-normalize-tests--rule2-holds-p): Turn into defsubst.
(ucs-normalize-tests--rule1-failing-for-partX): Use `eq' instead of
`='.

7 years agoUpdate failing lines for UCS normalize tests
Noam Postavsky [Sat, 8 Jul 2017 17:06:48 +0000 (13:06 -0400)]
Update failing lines for UCS normalize tests

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part2): Update for new
admin/unidata/NormalizationTest.txt version.

7 years agoSemi-automate the procedure for updating UCS normalize test bad lines
Noam Postavsky [Sat, 8 Jul 2017 17:01:30 +0000 (13:01 -0400)]
Semi-automate the procedure for updating UCS normalize test bad lines

* test/lisp/international/ucs-normalize-tests.el: Remove incorrect
commentary describing a manual procedure for producing the updated
failing lines, it did not actually work.  Replace it with pointer to
new function which prints the updated values.
(ucs-normalize-tests--rule1-holds-p): Renamed from
ucs-normalize-tests--invariants-hold-p.
(ucs-normalize-tests--rule2-holds-p): Renamed from
ucs-normalize-tests--invariants-rule2-hold-p.
(ucs-normalize-tests--rule1-failing-for-partX): Renamed from
ucs-normalize-tests--invariants-failing-for-part.
(ucs-normalize-tests--rule1-failing-for-lines): Renamed from
ucs-normalize-tests--invariants-failing-for-lines.
(ucs-normalize-tests--part2-rule1-failed-lines): New variable.
(ucs-normalize-part2): Set it.
(ucs-normalize-part1): Always run through to end of test before
checking for failures.
(ucs-normalize-tests--insert-failing-lines)
(ucs-normalize-check-failing-lines): New functions, used to update
the *--failing-lines-part* variables.

7 years ago* lisp/cus-start.el (standard): Spelling fix.
Paul Eggert [Sat, 8 Jul 2017 15:42:09 +0000 (08:42 -0700)]
* lisp/cus-start.el (standard): Spelling fix.

7 years agoModule assertions: check for garbage collections
Philipp Stephani [Tue, 4 Jul 2017 20:50:46 +0000 (22:50 +0200)]
Module assertions: check for garbage collections

It's technically possible to write a user pointer finalizer that calls
into Emacs module functions.  This would be disastrous because it
would allow arbitrary Lisp code to run during garbage collection.
Therefore extend the module assertions to check for this case.

* src/emacs-module.c (module_assert_thread): Also check whether a
garbage collection is in progress.

* test/data/emacs-module/mod-test.c (invalid_finalizer)
(Fmod_test_invalid_finalizer): New test module functions.
(emacs_module_init): Register new test function.

* test/src/emacs-module-tests.el (module--test-assertion)
(module--with-temp-directory): New helper macros.
(module--test-assertions--load-non-live-object): Rename existing
unit test, use helper macros.
(module--test-assertions--call-emacs-from-gc): New unit test.

7 years agoCapitalize the menu entry for display-line-numbers
Eli Zaretskii [Sat, 8 Jul 2017 10:22:53 +0000 (13:22 +0300)]
Capitalize the menu entry for display-line-numbers

* lisp/menu-bar.el (menu-bar-showhide-menu): Capitalize menu item
for display-line-numbers.  Suggested by Martin Rudalics
<rudalics@gmx.at>.

7 years agoUpdate Unicode data and files to Unicode 10.0
Eli Zaretskii [Sat, 8 Jul 2017 10:02:47 +0000 (13:02 +0300)]
Update Unicode data and files to Unicode 10.0

* admin/notes/unicode:
* admin/unidata/README:
* admin/unidata/BidiBrackets.txt:
* admin/unidata/BidiMirroring.txt:
* admin/unidata/Blocks.txt:
* admin/unidata/IVD_Sequences.txt:
* admin/unidata/NormalizationTest.txt:
* admin/unidata/SpecialCasing.txt:
* admin/unidata/UnicodeData.txt:
* lisp/international/characters.el:
* lisp/international/fontset.el (script-representative-chars):
* lisp/international/mule-cmds.el (ucs-names): Update per Unicode 10.0.

7 years agoSupport '=' in Scheme and Lisp tags in 'etags'
Alexander Gramiak [Sat, 8 Jul 2017 08:25:53 +0000 (11:25 +0300)]
Support '=' in Scheme and Lisp tags in 'etags'

* lib-src/etags.c (get_lispy_tag): New function.
(L_getit, Scheme_functions): Use get_lispy_tag (Bug#5624).
* test/manual/etags/CTAGS.good:
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/Makefile:
* test/manual/etags/el-src/TAGTEST.EL: Update tests.
* test/manual/etags/scm-src/test.scm: New tests for Scheme.

7 years agoAvoid compiler warnings in xdisp.c debugging code
Alexander Kuleshov [Sat, 8 Jul 2017 08:15:52 +0000 (11:15 +0300)]
Avoid compiler warnings in xdisp.c debugging code

* src/xdisp.c (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
Use pD directives for ptrdiff_t values instead of pI, to avoid
compilation warnings on 64-bit hosts.  (Bug#27597)

7 years agoCommentary enhancement in frame.el
Eli Zaretskii [Sat, 8 Jul 2017 08:08:55 +0000 (11:08 +0300)]
Commentary enhancement in frame.el

* lisp/frame.el: Explain how to test whether a variable needs to
be added to the list of those which are watched for buffer
redisplay.

7 years agoSupport display of line numbers natively
Eli Zaretskii [Sat, 8 Jul 2017 07:49:36 +0000 (10:49 +0300)]
Support display of line numbers natively

This merges branch 'line-numbers'.
* src/buffer.c (disable_line_numbers_overlay_at_eob): New
function.
* src/lisp.h (disable_line_numbers_overlay_at_eob): Add prototype.
* src/dispextern.h (struct it): New members pt_lnum, lnum,
lnum_bytepos, lnum_width, and lnum_pixel_width.
* src/indent.c (line_number_display_width): New function,
refactored from line-number width calculations in vertical-motion.
(Fvertical_motion): Call line_number_display_width when the width
of line-number display is needed.
(Fline_number_display_width): New defun.
(syms_of_indent): Defsubr it.
* src/indent.c (Fvertical_motion): Help C-n/C-p estimate correctly
the width used up by line numbers by looking near the window-start
point.  If window-start is outside of the accessible portion,
temporarily widen the buffer.
* src/term.c (produce_glyphs): Adjust tab stops for the horizontal
space taken by the line-number display.
* src/xdisp.c (display_count_lines_logically)
(display_count_lines_visually, maybe_produce_line_number)
(should_produce_line_number, row_text_area_empty): New functions.
(try_window_reusing_current_matrix): Don't use this method when
display-line-numbers is in effect.
(try_window_id, try_cursor_movement): Disable these optimizations
when the line-number-current-line face is different from
line-number face and for relative line numbers.
(try_window_id, redisplay_window, try_cursor_movement): For
visual line-number display, disable the same redisplay
optimizations as for relative.
(x_produce_glyphs): Adjust tab stops for the horizontal
space taken by the line-number display.
(hscroll_window_tree): Adjust hscroll calculations to line-number
display.
(DISP_INFINITY): Renamed from INFINITY to avoid clashes with
math.h; all users changed.
(set_cursor_from_row): Fix calculation of cursor X coordinate in
R2L rows with display-produced glyphs at the beginning.
(display_line): Use should_produce_line_number to determine
whether a line number should be produced for each glyph row, and
maybe_produce_line_number to produce line numbers.
Don't display line numbers in the minibuffer and in tooltip
frames.
Call row_text_area_empty to verify that a glyph
row's text area is devoid of any glyphs that came from a buffer or
a string.  This fixes a bug with empty-lines indication
disappearing when line numbers or line-prefix are displayed.
(syms_of_xdisp) <display-line-numbers, display-line-numbers-widen>
<display-line-number-width>: New buffer-local variables.
<display-line-numbers-current-absolute>: New variable.

* lisp/cus-start.el (standard): Provide customization forms for
display-line-numbers and its sub-features.
* lisp/faces.el (line-number, line-number-current-line): New faces.
* lisp/frame.el: Add display-line-numbers, display-line-numbers-widen,
display-line-numbers-current-absolute, and
display-line-number-width to the list of variables that should
trigger redisplay of the current buffer.
* lisp/menu-bar.el (menu-bar-showhide-menu): Add menu-bar item to
turn display-line-numbers on and off.
(toggle-display-line-numbers): New function.
* lisp/simple.el (last--line-number-width): New internal variable.
(line-move-visual): Use it to adjust temporary-goal-column when
line-number display changes its width.

* doc/emacs/basic.texi (Position Info): Add cross-reference to
"Display Custom", for line-number display.
* doc/emacs/custom.texi (Init Rebinding):
* doc/emacs/modes.texi (Minor Modes): Remove references to
linum-mode.
* doc/emacs/display.texi (Display Custom): Describe the
line-number display.
* doc/lispref/display.texi (Size of Displayed Text): Document
line-number-display-width.

* etc/NEWS: Document display-line-numbers and its customizations.

7 years agoFix more ungetc bugs with encoding errors
Paul Eggert [Sat, 8 Jul 2017 01:12:16 +0000 (18:12 -0700)]
Fix more ungetc bugs with encoding errors

* src/lread.c (infile): New variable, replacing ...
(instream): ... this.  All uses changed.
(readbyte_from_stdio): New function, which deals with lookahead.
(readbyte_from_file, Fget_file_char): Use it.
(Fget_file_char): When misused, signal an error instead of
relying on undefined behavior.
(close_infile_unwind): New function.
(Fload): Use it.
(readevalloop): 2nd arg is now struct infile *, not FILE *.
All callers changed.
(read1): Handle lookahead when copying doc strings with
encoding errors.

7 years agoAvoid ungetc when loading charset maps from files
Paul Eggert [Sat, 8 Jul 2017 01:12:16 +0000 (18:12 -0700)]
Avoid ungetc when loading charset maps from files

* src/charset.c (read_hex): New args LOOKAHEAD and TERMINATOR,
replacing the old EOF.  All callers changed.  This avoids the
need to call ungetc.

7 years agoFix ungetc bug when reading an encoding error
Paul Eggert [Sat, 8 Jul 2017 01:08:00 +0000 (18:08 -0700)]
Fix ungetc bug when reading an encoding error

* src/lread.c (readchar, read_emacs_mule_char): Fix off-by-one
error when reading an encoding error from a file, e.g., a symbol
in an .elc file whose name is "\360\220\200\360".

7 years ago; Fix extra "," in previous commit
Noam Postavsky [Fri, 7 Jul 2017 22:13:15 +0000 (18:13 -0400)]
; Fix extra "," in previous commit

7 years ago* lisp/wid-edit.el (widget-color--choose-action): Use a closure
Stefan Monnier [Fri, 7 Jul 2017 21:02:27 +0000 (17:02 -0400)]
* lisp/wid-edit.el (widget-color--choose-action): Use a closure

7 years ago* lisp/window.el (display-buffer--special-action): Use a closure.
Stefan Monnier [Fri, 7 Jul 2017 20:58:30 +0000 (16:58 -0400)]
* lisp/window.el (display-buffer--special-action): Use a closure.

7 years agoAdd new todo-mode.el tests
Stephen Berman [Fri, 7 Jul 2017 20:03:21 +0000 (22:03 +0200)]
Add new todo-mode.el tests

* test/lisp/calendar/todo-mode-tests.el (with-todo-test):
Declare an Edebug spec.  Restore pre-test-run state of test files.
(todo-test--show, todo-test--move-item)
(todo-test--insert-item): New functions.
(todo-test-get-archive): Remove, as subsumed by
todo-test--show.  Adjust all callers.
(todo-test--is-current-buffer): Rename from
todo-test-is-current-buffer and adjust uses.
(todo-test-item-highlighting): Use todo-test--show.
(todo-test-revert-buffer01, todo-test-revert-buffer02)
(todo-test-raise-lower-priority)
(todo-test-todo-mark-unmark-category, todo-test-move-item01)
(todo-test-move-item02, todo-test-move-item03)
(todo-test-move-item04, todo-test-move-item05)
(todo-test-toggle-item-header01)
(todo-test-toggle-item-header02)
(todo-test-toggle-item-header03)
(todo-test-toggle-item-header04)
(todo-test-toggle-item-header05)
(todo-test-toggle-item-header06)
(todo-test-toggle-item-header07): New tests.

* test/lisp/calendar/todo-mode-resources/todo-test-1.toda:
* test/lisp/calendar/todo-mode-resources/todo-test-1.todo:
Modify to accommodate new tests.

7 years agotodo-mode.el: Fix handling of hidden item headers (bug#27609)
Stephen Berman [Fri, 7 Jul 2017 15:48:14 +0000 (17:48 +0200)]
todo-mode.el: Fix handling of hidden item headers (bug#27609)

* lisp/calendar/todo-mode.el (todo--item-headers-hidden): New variable.
(todo-toggle-item-header): Use it.  Make this command a noop
if the file has no items.
(todo-move-item, todo-item-done): Instead of concatenating the
items to move into one string, make a list of them to
facilitate handling hidden headers.  Adjust insertion accordingly.
(todo-archive-done-item): Handle hidden headers in archive file.
(todo-unarchive-items): Handle hidden headers in todo file.
(todo-backward-item): Use todo--item-headers-hidden and handle
moving backward work when item date-time headers are hidden.
(todo-remove-item): Delete date-time header overlay.
(todo-get-overlay, todo-insert-with-overlays): Make them work
with hidden date-time headers.
(todo-modes-set-2): Make todo--item-headers-hidden buffer local.

7 years agoFix several todo-mode bugs found while debugging bug#27609
Stephen Berman [Fri, 7 Jul 2017 15:37:46 +0000 (17:37 +0200)]
Fix several todo-mode bugs found while debugging bug#27609

* lisp/calendar/todo-mode.el (todo-toggle-mark-item): Calculate
current category only once.
(todo-mark-category): Update number of marked items to avoid
spurious duplication in todo-categories-with-marks alist and
corruption of the todo-categories alist.  Handle empty line
when there are no todo items and done items are shown.
(todo-set-item-priority): Make noop if called from
todo-raise-item-priority or todo-lower-item-priority when
point is on a done todo item or an empty line.
(todo-move-item): Use markers instead of integer positions to
correctly handle deleting the now moved items from the source
category (without markers an infinite loop arises when moving
marked item to a preceding category).
(todo-unarchive-items): Put point on the (first) restored done
item, instead of leaving it at the end of the done items
separator string.
(todo-revert-buffer): Ensure buffer remains read-only after
reverting.

7 years agoExclude blank columns from value of line-number-display-width
Eli Zaretskii [Fri, 7 Jul 2017 14:30:06 +0000 (17:30 +0300)]
Exclude blank columns from value of line-number-display-width

* src/indent.c (Fline_number_display_width): Don't add 2 to the
number of columns we return, to make this consistent with
display-line-number-width.

7 years agoFix vertical-motion across the place where line-number width changes
Eli Zaretskii [Fri, 7 Jul 2017 09:21:10 +0000 (12:21 +0300)]
Fix vertical-motion across the place where line-number width changes

* src/indent.c (line_number_display_width): New function,
refactored from line-number width calculations in vertical-motion.
(Fvertical_motion): Call line_number_display_width when the width
of line-number display is needed.
(Fline_number_display_width): New defun.
(syms_of_indent): Defsubr it.

* doc/lispref/display.texi (Size of Displayed Text): Document
line-number-display-width.

* etc/NEWS: Mention line-number-display-width.

* lisp/simple.el (last--line-number-width): New internal variable.
(line-move-visual): Use it to adjust temporary-goal-column when
line-number display changes its width.

7 years agoRemove Vwindow_text_change_functions and related code
Martin Rudalics [Fri, 7 Jul 2017 06:40:24 +0000 (08:40 +0200)]
Remove Vwindow_text_change_functions and related code

Vwindow_text_change_functions had been provided for implementing
line numbers but apparently was never functional or in use.

* src/xdisp.c (redisplay_window): Remove handling of
Vwindow_text_change_functions.
(syms_of_xdisp): Remove Qwindow_text_change_functions.
(Vwindow_text_change_functions): Remove variable.
* doc/lispref/hooks.texi (Standard Hooks): Remove entry for
`window-text-change-functions'.

7 years agoConvert more uses of looking-at to following-char
Mark Oteiza [Fri, 7 Jul 2017 03:53:19 +0000 (23:53 -0400)]
Convert more uses of looking-at to following-char

More followup to Karl Fogel's commit a84da83c1.
* lisp/dired-aux.el (dired-add-entry, dired-subdir-hidden-p):
* lisp/dired-x.el (dired-mark-unmarked-files, dired-mark-sexp):
* lisp/help-fns.el (doc-file-to-man, doc-file-to-info):
* lisp/proced.el (proced-toggle-marks):
* lisp/progmodes/f90.el (f90-indent-line):
* lisp/ses.el (ses-load):
* lisp/tar-mode.el (tar-expunge): Replace instances of looking-at with
char comparisons using following-char.

7 years agoDon't skip epg tests (Bug#23561)
Noam Postavsky [Fri, 30 Jun 2017 03:28:15 +0000 (23:28 -0400)]
Don't skip epg tests (Bug#23561)

* test/lisp/epg-tests.el (with-epg-tests): Ignore REQUIRE-PASSPHRASE
parameter, since we supply the passphrase via pinentry-program for all
GPG versions (as of 2017-02-28 "Fix epg-tests with dummy-pinentry
program (Bug#23619)").
(epg-tests-program-alist-for-passphrase-callback): Remove.

7 years agoImplement line numbers that disregard narrowing
Eli Zaretskii [Thu, 6 Jul 2017 17:22:16 +0000 (20:22 +0300)]
Implement line numbers that disregard narrowing

* src/xdisp.c (display_count_lines_logically): New function,
counts line numbers disregarding narrowing.  Suggested by Andy
Moreton <andrewjmoreton@gmail.com>.
(maybe_produce_line_number): Call display_count_lines_logically
instead of display_count_lines.  Adapt BEGV, ZV, etc. to
display-line-numbers-widen.
(syms_of_xdisp) <display-line-numbers-widen>: New buffer-local
variable.

* lisp/cus-start.el (standard): Provide a customization form for
display-line-numbers-widen.
* lisp/frame.el: Add display-line-numbers-widen,
display-line-numbers-current-absolute, and
display-line-number-width to the list of variables that should
trigger redisplay of the current buffer.

* doc/emacs/display.texi (Display Custom): Document
display-line-numbers-widen.

7 years agoFix lisp-comment-indent for single-semicolon case
Noam Postavsky [Thu, 6 Jul 2017 12:52:24 +0000 (08:52 -0400)]
Fix lisp-comment-indent for single-semicolon case

* lisp/emacs-lisp/lisp-mode.el (lisp-comment-indent): Only check for
open paren if we're looking at multiple comment characters.
* test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-comment-indent-1)
(lisp-comment-indent-2): New tests.

7 years agoSpelling fixes
Paul Eggert [Thu, 6 Jul 2017 07:23:30 +0000 (00:23 -0700)]
Spelling fixes

* lisp/org/org-table.el (org-table-sort-lines):
Fix misspelling in prompt.
* lisp/org/ox-ascii.el (org-ascii--describe-datum):
Fix misspelling in call to org-element-lineage.

7 years agoDon't put whitespace between open paren and comment in Lisp modes (Bug#19740)
Noam Postavsky [Wed, 14 Jun 2017 04:13:06 +0000 (00:13 -0400)]
Don't put whitespace between open paren and comment in Lisp modes (Bug#19740)

* lisp/emacs-lisp/lisp-mode.el (lisp-comment-indent): If current
line's code ends in open paren, set comment indentation exactly to
column following it.
(lisp-mode-variables): Set `comment-indent-function' to
`lisp-comment-indent'.

7 years agoAllow comment-indent-functions to specify exact indentation (Bug#385)
Noam Postavsky [Wed, 14 Jun 2017 04:08:15 +0000 (00:08 -0400)]
Allow comment-indent-functions to specify exact indentation (Bug#385)

* lisp/newcomment.el (comment-choose-indent): Interpret a cons of two
integers as indicating a range of acceptable indentation.
(comment-indent): Don't apply `comment-inline-offset',
`comment-choose-indent' already does that.
(comment-indent-function):
* doc/emacs/programs.texi (Options for Comments): Document new
acceptable return values.
* etc/NEWS: Announce it.

7 years agoCheck for integer overflow in xbm images
Paul Eggert [Thu, 6 Jul 2017 01:58:11 +0000 (18:58 -0700)]
Check for integer overflow in xbm images

* src/image.c (XBM_TK_OVERFLOW): New constant.
(xbm_scan): Check for integer overflow instead of relying on
undefined behavior.  Check that octal digits are actually octal.

7 years agoConvert hex digits more systematically
Paul Eggert [Thu, 6 Jul 2017 00:51:31 +0000 (17:51 -0700)]
Convert hex digits more systematically

This makes the code a bit smaller and presumably faster, as
it substitutes a single lookup for conditional jumps.
* src/character.c (hexdigit): New constant.
(syms_of_character) [HEXDIGIT_IS_CONST]: Initialize it.
* src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST): New macros.
(hexdigit): New decl.
(char_hexdigit): New inline function.
* src/charset.c: Do not include c-ctype.h.
* src/charset.c (read_hex):
* src/editfns.c (styled_format):
* src/image.c (xbm_scan):
* src/lread.c (read_escape):
* src/regex.c (ISXDIGIT) [emacs]:
Use char_hexdigit insted of doing it by hand.

7 years agoDon’t use -Woverride-init
Paul Eggert [Thu, 6 Jul 2017 00:14:50 +0000 (17:14 -0700)]
Don’t use -Woverride-init

I have some further changes in mind that would also need to
disable the -Woverride-init warnings.  In practice these warnings
seem to be more trouble than they’re worth, so disable them in the
cc command line.
* configure.ac: Disable -Woverride-init here ...
* src/bytecode.c: ... rather than here.

7 years ago* lisp/progmodes/python.el (auto-mode-alist): Add .pyi. (Bug#27847)
Glenn Morris [Wed, 5 Jul 2017 19:21:28 +0000 (15:21 -0400)]
* lisp/progmodes/python.el (auto-mode-alist): Add .pyi.  (Bug#27847)

7 years ago; Standardize some copyright and license notices
Glenn Morris [Wed, 5 Jul 2017 18:08:35 +0000 (14:08 -0400)]
; Standardize some copyright and license notices

7 years ago* lisp/org/ox-html.el (org-html-infojs-template): Update copyright.
Glenn Morris [Wed, 5 Jul 2017 18:07:14 +0000 (14:07 -0400)]
* lisp/org/ox-html.el (org-html-infojs-template): Update copyright.

7 years agoSmall fix for bug-reference.el
Glenn Morris [Wed, 5 Jul 2017 17:32:26 +0000 (13:32 -0400)]
Small fix for bug-reference.el

* lisp/progmodes/bug-reference.el (bug-reference-bug-regexp):
Autoload safety property.  (Bug#27481)

7 years agoSuppress timers in Tramp
Michael Albinus [Wed, 5 Jul 2017 15:03:42 +0000 (17:03 +0200)]
Suppress timers in Tramp

* lisp/net/tramp.el (tramp-file-name-handler): Don't trigger timers.

* test/lisp/net/tramp-tests.el
(tramp-test36-asynchronous-requests): Trigger timers.
(tramp-test37-recursive-load, tramp-test38-remote-load-path):
Set `default-directory' to a trustworthy value.

7 years agoAdd realgud face definitions
rocky [Wed, 5 Jul 2017 14:36:31 +0000 (10:36 -0400)]
Add realgud face definitions

7 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
rocky [Wed, 5 Jul 2017 02:39:32 +0000 (22:39 -0400)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

7 years agoAdd realgud faces to tdsh-dark-theme
rocky [Wed, 5 Jul 2017 02:37:52 +0000 (22:37 -0400)]
Add realgud faces to tdsh-dark-theme

7 years ago* lisp/progmodes/cc-awk.el: Mark unused args
Stefan Monnier [Wed, 5 Jul 2017 02:30:33 +0000 (22:30 -0400)]
* lisp/progmodes/cc-awk.el: Mark unused args

7 years ago* lisp/progmodes/cc-bytecomp.el: Mark unused args
Stefan Monnier [Wed, 5 Jul 2017 02:29:49 +0000 (22:29 -0400)]
* lisp/progmodes/cc-bytecomp.el: Mark unused args

7 years ago* lisp/progmodes/cc-defs.el (lookup-syntax-properties): Move ...
Stefan Monnier [Wed, 5 Jul 2017 02:27:51 +0000 (22:27 -0400)]
* lisp/progmodes/cc-defs.el (lookup-syntax-properties): Move ...

... before first use

7 years ago* lisp/progmodes/cc-vars.el: Mark unused args
Stefan Monnier [Wed, 5 Jul 2017 02:26:20 +0000 (22:26 -0400)]
* lisp/progmodes/cc-vars.el: Mark unused args

7 years ago* lisp/progmodes/cc-langs.el: Mark unused args
Stefan Monnier [Wed, 5 Jul 2017 02:23:57 +0000 (22:23 -0400)]
* lisp/progmodes/cc-langs.el: Mark unused args

(c-primary-expr-regexp): Remove unused vars ambiguous-prefix-ops and
unambiguous-prefix-ops.

7 years ago* lisp/progmodes/cc-engine.el: Mark unused args
Stefan Monnier [Wed, 5 Jul 2017 02:20:22 +0000 (22:20 -0400)]
* lisp/progmodes/cc-engine.el: Mark unused args

(c-beginning-of-statement-1, c-guess-basic-syntax):
Remove unused var c-in-literal-cache.
(c-debug-sws-msg): Silence byte-compiler, even if we don't use the arg.
(c-append-to-state-cache): Remove unused var `bra+1s'.
(c-remove-stale-state-cache): Remove unused var `pps-point-state'.
(c-invalidate-state-cache-1): Remove unused var `pa'.
(c-forward-decl-or-cast-1): Change comments so they don't look like
outline headers.
(c-restricted-<>-arglists, c-parse-and-markup-<>-arglists):
Declare before first use.
(c-forward-decl-or-cast-1): Remove unused var `backup-kwd-sym'.
(c-backward-over-enum-header): Remove unused var `up-sexp-pos'.

7 years ago* lisp/progmodes/cc-cmds.el: Remove unused vars
Stefan Monnier [Wed, 5 Jul 2017 02:00:35 +0000 (22:00 -0400)]
* lisp/progmodes/cc-cmds.el: Remove unused vars

(c-syntactic-context): Declare as dynbound.
(c-beginning-of-defun, c-end-of-defun): Remove unused var `start'.

7 years ago* lisp/progmodes/cc-guess.el: Remove unused var
Stefan Monnier [Wed, 5 Jul 2017 01:55:44 +0000 (21:55 -0400)]
* lisp/progmodes/cc-guess.el: Remove unused var

(c-guess-view-reorder-offsets-alist-in-style): Remove redundantly bound
and computed variable `guessed-syntactic-symbols'.

7 years ago* lisp/progmodes/cc-align.el: Mark unused arguments
Stefan Monnier [Wed, 5 Jul 2017 01:46:05 +0000 (21:46 -0400)]
* lisp/progmodes/cc-align.el: Mark unused arguments

7 years ago* lisp/progmodes/cc-mode.el: Mark unused arguments
Stefan Monnier [Wed, 5 Jul 2017 01:32:20 +0000 (21:32 -0400)]
* lisp/progmodes/cc-mode.el: Mark unused arguments

(c-parse-quotes-before-change, c-parse-quotes-after-change):
Remove unused vars.

7 years agoMention `ffap-url-unwrap-local' in find-file-at-point's docstring (Bug#27564)
Noam Postavsky [Mon, 3 Jul 2017 19:27:09 +0000 (15:27 -0400)]
Mention `ffap-url-unwrap-local' in find-file-at-point's docstring (Bug#27564)

* lisp/ffap.el (find-file-at-point): Mention `ffap-url-unwrap-local'
and `ffap-url-unwrap-remote'.

7 years agoFix infloop in uncomment-region-default (Bug#27112)
Noam Postavsky [Fri, 2 Jun 2017 03:09:36 +0000 (23:09 -0400)]
Fix infloop in uncomment-region-default (Bug#27112)

When `comment-continue' has only blanks, `comment-padright' produces a
regexp that matches the empty string, so `uncomment-region-default'
will loop infinitely.
* lisp/newcomment.el (comment-padright): Only return a regexp if STR
has nonblank characters.

7 years agoFix display of current line number in visual mode
Eli Zaretskii [Tue, 4 Jul 2017 15:43:03 +0000 (18:43 +0300)]
Fix display of current line number in visual mode

* src/xdisp.c (maybe_produce_line_number): Fix visual-mode display
of current line when line-number-current-line face was customized.
Reported by Filipe Silva <filipe.silva@gmail.com>.

7 years ago; Remove unused text properties in test
Philipp Stephani [Mon, 3 Jul 2017 21:26:08 +0000 (23:26 +0200)]
; Remove unused text properties in test

* test/lisp/electric-tests.el (electric-quote-markdown-in-code):
Remove now-unused text properties.

7 years agoUse hook instead of face list to inhibit electric quoting
Philipp Stephani [Mon, 3 Jul 2017 16:46:10 +0000 (18:46 +0200)]
Use hook instead of face list to inhibit electric quoting

This is more flexible and doesn't couple electric quoting to font
locking.
Give that 'electric-quote-code-faces' was just introduced, remove it
without formal deprecation.

* lisp/electric.el (electric-quote-inhibit-functions): New abnormal
hook variable.
(electric-quote-post-self-insert-function): Run the hook.  Remove
use of old 'electric-quote-code-faces' variable.

* test/lisp/electric-tests.el (electric-quote-markdown-in-text)
(electric-quote-markdown-in-code): Adapt unit tests.

7 years agoOffer non-aligned indentation in lists in js-mode (Bug#27503)
Ingo Lohmar [Sat, 1 Jul 2017 11:09:20 +0000 (13:09 +0200)]
Offer non-aligned indentation in lists in js-mode (Bug#27503)

* lisp/progmodes/js.el (js--proper-indentation):
New customization option 'js-indent-align-list-continuation'.
Affects argument lists as well as arrays and object properties.
* test/manual/indent/js-indent-align-list-continuation-nil.js:
Test the change.

7 years agoAvoid errors in vertical-motion when buffer is narrowed
Eli Zaretskii [Mon, 3 Jul 2017 15:57:01 +0000 (18:57 +0300)]
Avoid errors in vertical-motion when buffer is narrowed

* src/indent.c (Fvertical_motion): If need to start from
window-start, and it is outside of the accessible portion,
temporarily widen the buffer.  This avoids errors in evil-mode.
Reported by James Nguyen <james@jojojames.com>.

7 years ago(Re-)activate remote tests of filenotify-tests.el
Michael Albinus [Mon, 3 Jul 2017 14:12:10 +0000 (16:12 +0200)]
(Re-)activate remote tests of filenotify-tests.el

* test/lisp/filenotify-tests.el
(file-notify-test-remote-temporary-file-directory):
Declare default host for mock method.  Offer home directory
for mock method if it doesn't exist.
(file-notify-test09-watched-file-in-watched-dir-remote):
Remove, it doesn't work reliably.

7 years agoReset ansi escape context before printing eshell prompt (Bug#27407)
Noam Postavsky [Sun, 18 Jun 2017 19:29:55 +0000 (15:29 -0400)]
Reset ansi escape context before printing eshell prompt (Bug#27407)

* lisp/eshell/em-prompt.el (eshell-emit-prompt): Reset
`ansi-color-context-region'.

7 years agoLet ansi-color overlay hooks work in eshell (Bug#27407)
Noam Postavsky [Sat, 17 Jun 2017 16:06:37 +0000 (12:06 -0400)]
Let ansi-color overlay hooks work in eshell (Bug#27407)

* lisp/ansi-color.el (ansi-color-make-extent): Add
`ansi-color-freeze-overlay' to `insert-behind-hooks' as well.
* lisp/eshell/esh-mode.el (eshell-output-filter): Let-bind
`inhibit-modification-hooks' to nil while inserting the string.

7 years agoFix and simplify ansi escape detection (Bug#21381)
Noam Postavsky [Fri, 16 Jun 2017 03:23:44 +0000 (23:23 -0400)]
Fix and simplify ansi escape detection (Bug#21381)

* lisp/ansi-color.el (ansi-color-regexp, ansi-color-drop-regexp):
Remove.
(ansi-color-control-seq-regexp): New constant, matches all escape
sequences.
(ansi-color-filter-apply, ansi-color-apply)
(ansi-color-filter-region, ansi-color-apply-on-region): Use it instead
of matching color sequences separately from ignored sequences.
Differentiate color sequences simply by checking the last character.

7 years agoAdd absolute optional parameter to line-number-at-pos (Bug#26417)
Damien Cassou [Sun, 9 Apr 2017 10:46:57 +0000 (12:46 +0200)]
Add absolute optional parameter to line-number-at-pos (Bug#26417)

* lisp/simple.el (line-number-at-pos): Add a second optional
  argument 'absolute'.
* test/list/simple-tests.el: Add tests for 'line-number-at-pos'.