1. 08 Jul, 2017 9 commits
    • Eli Zaretskii's avatar
      Capitalize the menu entry for display-line-numbers · a87d767c
      Eli Zaretskii authored
      * lisp/menu-bar.el (menu-bar-showhide-menu): Capitalize menu item
      for display-line-numbers.  Suggested by Martin Rudalics
    • Eli Zaretskii's avatar
      Update Unicode data and files to Unicode 10.0 · fd3bcfa3
      Eli Zaretskii authored
      * 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.
    • Alexander Gramiak's avatar
      Support '=' in Scheme and Lisp tags in 'etags' · 42cdb686
      Alexander Gramiak authored
      * 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.
    • Alexander Kuleshov's avatar
      Avoid compiler warnings in xdisp.c debugging code · 92307cb0
      Alexander Kuleshov authored
      * 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)
    • Eli Zaretskii's avatar
      Commentary enhancement in frame.el · 6e2a2b33
      Eli Zaretskii authored
      * lisp/frame.el: Explain how to test whether a variable needs to
      be added to the list of those which are watched for buffer
    • Eli Zaretskii's avatar
      Support display of line numbers natively · 5df239fc
      Eli Zaretskii authored
      This merges branch 'line-numbers'.
      * src/buffer.c (disable_line_numbers_overlay_at_eob): New
      * 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
      (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
      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
      * doc/emacs/display.texi (Display Custom): Describe the
      line-number display.
      * doc/lispref/display.texi (Size of Displayed Text): Document
      * etc/NEWS: Document display-line-numbers and its customizations.
    • Paul Eggert's avatar
      Fix more ungetc bugs with encoding errors · b8ead34f
      Paul Eggert authored
      * 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.
    • Paul Eggert's avatar
      Avoid ungetc when loading charset maps from files · 16283058
      Paul Eggert authored
      * src/charset.c (read_hex): New args LOOKAHEAD and TERMINATOR,
      replacing the old EOF.  All callers changed.  This avoids the
      need to call ungetc.
    • Paul Eggert's avatar
      Fix ungetc bug when reading an encoding error · d2832063
      Paul Eggert authored
      * 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".
  2. 07 Jul, 2017 10 commits
    • Noam Postavsky's avatar
      ; Fix extra "," in previous commit · c819c053
      Noam Postavsky authored
    • Stefan Monnier's avatar
    • Stefan Monnier's avatar
    • Stephen Berman's avatar
      Add new todo-mode.el tests · c24748ad
      Stephen Berman authored
      * 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-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-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.
    • Stephen Berman's avatar
      todo-mode.el: Fix handling of hidden item headers (bug#27609) · 264dd81d
      Stephen Berman authored
      * 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.
    • Stephen Berman's avatar
      Fix several todo-mode bugs found while debugging bug#27609 · 1cf6b157
      Stephen Berman authored
      * 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
    • Eli Zaretskii's avatar
      Exclude blank columns from value of line-number-display-width · 13786d5e
      Eli Zaretskii authored
      * src/indent.c (Fline_number_display_width): Don't add 2 to the
      number of columns we return, to make this consistent with
    • Eli Zaretskii's avatar
      Fix vertical-motion across the place where line-number width changes · 4caf65d4
      Eli Zaretskii authored
      * 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
      * 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.
    • Martin Rudalics's avatar
      Remove Vwindow_text_change_functions and related code · 579a9ee2
      Martin Rudalics authored
      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
      (syms_of_xdisp): Remove Qwindow_text_change_functions.
      (Vwindow_text_change_functions): Remove variable.
      * doc/lispref/hooks.texi (Standard Hooks): Remove entry for
    • Mark Oteiza's avatar
      Convert more uses of looking-at to following-char · 51275358
      Mark Oteiza authored
      More followup to Karl Fogel's commit a84da83c.
      * 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.
  3. 06 Jul, 2017 9 commits
    • Noam Postavsky's avatar
      Don't skip epg tests (Bug#23561) · 1eefada3
      Noam Postavsky authored
      * 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.
    • Eli Zaretskii's avatar
      Implement line numbers that disregard narrowing · 25bc3911
      Eli Zaretskii authored
      * 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
      (syms_of_xdisp) <display-line-numbers-widen>: New buffer-local
      * lisp/cus-start.el (standard): Provide a customization form for
      * 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
    • Noam Postavsky's avatar
      Fix lisp-comment-indent for single-semicolon case · 386918f0
      Noam Postavsky authored
      * 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.
    • Paul Eggert's avatar
      Spelling fixes · 20e9a00f
      Paul Eggert authored
      * 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.
    • Noam Postavsky's avatar
      Don't put whitespace between open paren and comment in Lisp modes (Bug#19740) · 7a0170de
      Noam Postavsky authored
      * 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
    • Noam Postavsky's avatar
      Allow comment-indent-functions to specify exact indentation (Bug#385) · e832febf
      Noam Postavsky authored
      * 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.
      * doc/emacs/programs.texi (Options for Comments): Document new
      acceptable return values.
      * etc/NEWS: Announce it.
    • Paul Eggert's avatar
      Check for integer overflow in xbm images · 018600f8
      Paul Eggert authored
      * 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.
    • Paul Eggert's avatar
      Convert hex digits more systematically · d6662694
      Paul Eggert authored
      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.
    • Paul Eggert's avatar
      Don’t use -Woverride-init · 24faf6b0
      Paul Eggert authored
      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.
  4. 05 Jul, 2017 12 commits