1. 01 Feb, 2017 7 commits
    • Paul Eggert's avatar
      Fix quitting bug when buffers are frozen · b4c9f912
      Paul Eggert authored
      Problem noted by Eli Zaretskii in:
      http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html
      This patch also fixes some other issues in that report.
      * src/lisp.h (incr_rarely_quit): Remove.
      All callers changed to use rarely_quit directly.
      * src/search.c (freeze_buffer_relocation)
      (thaw_buffer_relocation): New functions.
      (looking_at_1, fast_looking_at, search_buffer):
      Use them to fix bug when quitting when buffers are frozen.
      * src/sysdep.c (emacs_intr_read): Rename from emacs_nointr_read.
      All uses changed.
      b4c9f912
    • Paul Eggert's avatar
      Revamp quitting and fix infloops · b01ac672
      Paul Eggert authored
      This fixes some infinite loops that cannot be quitted out of,
      e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#)))
      when byte-compiled and when run under X.  See:
      http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html
      This also attempts to keep the performance improvements I recently
      added, as much as possible under the constraint that the infloops
      must be caught.  In some cases this fixes infloop bugs recently
      introduced when I removed immediate_quit.
      * src/alloc.c (Fmake_list):
      Use rarely_quit, not maybe_quit, for speed in the usual case.
      * src/bytecode.c (exec_byte_code):
      * src/editfns.c (Fcompare_buffer_substrings):
      * src/fns.c (Fnthcdr):
      * src/syntax.c (scan_words, skip_chars, skip_syntaxes)
      (Fbackward_prefix_chars):
      Use rarely_quit so that users can C-g out of long loops.
      * src/callproc.c (call_process_cleanup, call_process):
      * src/fileio.c (read_non_regular, Finsert_file_contents):
      * src/indent.c (compute_motion):
      * src/syntax.c (scan_words, Fforward_comment):
      Remove now-unnecessary maybe_quit calls.
      * src/callproc.c (call_process):
      * src/doc.c (get_doc_string, Fsnarf_documentation):
      * src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents):
      * src/lread.c (safe_to_load_version):
      * src/sysdep.c (system_process_attributes) [GNU_LINUX]:
      Use emacs_read_quit instead of emacs_read in places where
      C-g handling is safe.
      * src/eval.c (maybe_quit): Move comment here from lisp.h.
      * src/fileio.c (Fcopy_file, e_write):
      Use emacs_write_quit instead of emacs_write_sig in places where
      C-g handling is safe.
      * src/filelock.c (create_lock_file): Use emacs_write, not
      plain write, as emacs_write no longer has a problem.
      (read_lock_data): Use emacs_read, not read, as emacs_read
      no longer has a problem.
      * src/fns.c (rarely_quit): Move to lisp.h and rename to
      incr_rarely_quit.  All uses changed..
      * src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member):
      * src/indent.c (compute_motion):
      * src/syntax.c (find_defun_start, back_comment, forw_comment)
      (Fforward_comment, scan_lists, scan_sexps_forward):
      Use incr_rarely_quit so that users can C-g out of long loops.
      * src/fns.c (Fnconc): Move incr_rarely_quit call to within
      inner loop, so that it catches C-g there too.
      * src/keyboard.c (tty_read_avail_input): Remove commented-out
      and now-obsolete code dealing with interrupts.
      * src/lisp.h (rarely_quit, incr_rarely_quit): New functions,
      the latter moved here from fns.c and renamed from rarely_quit.
      (emacs_read_quit, emacs_write_quit): New decls.
      * src/search.c (find_newline, search_buffer, find_newline1):
      Add maybe_quit to catch C-g.
      * src/sysdep.c (get_child_status): Always invoke maybe_quit
      if interruptible, so that the caller need not bother.
      (emacs_nointr_read, emacs_read_quit, emacs_write_quit):
      New functions.
      (emacs_read): Rewrite in terms of emacs_nointr_read.
      Do not handle C-g or signals; that is now for emacs_read_quit.
      (emacs_full_write): Replace PROCESS_SIGNALS two-way arg
      with INTERRUPTIBLE three-way arg.  All uses changed.
      b01ac672
    • Paul Eggert's avatar
      Remove immediate_quit. · 33be5003
      Paul Eggert authored
      The old code that sets and clears immediate_quit was
      ineffective except when Emacs is running in terminal mode, and
      has problematic race conditions anyway, so remove it.  This
      will introduce some hangs when Emacs runs in terminal mode,
      and these hangs should be fixed in followup patches.
      * src/keyboard.c (immediate_quit): Remove.  All uses removed.
      33be5003
    • Alan Mackenzie's avatar
      Allow C++ nested brace-list-entries to be better indented. · 94ad13b9
      Alan Mackenzie authored
      This fixes bug #24431.  The key change of this bug fix is correctly analyzing
      nested brace lists when the opening element stands on the same line as both
      its introductory brace and an enclosing parameter list parenthesis.
      
      * list/progmodes/cc-align.el (c-lineup-under-anchor): New line-up function.
      
      * list/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Accept the
      presence of exactly an identifier between an open parenthesis and an open
      brace as evidence of the brace starting a brace list.
      (c-looking-at-statement-block): New function, extracted from
      c-looking-at-inexpr-block.  Enhance it to analyze inner blocks recursively
      when needed.
      (c-looking-at-inexpr-block): Extract new function (see above) and call it.
      (c-add-stmt-syntax): Enhance, with new &optional parameter, to supply the
      prime syntactic symbol with a fixed anchor point.  When this is used, restrict
      all added syntactic symbols to those having an anchor point on the same line.
      Add, in addition to the current additional symbols, c-brace-list-entry when
      needed; use c-looking-at-statement-block to determine the latter.
      (c-guess-basic-syntax, CASE 9D): Use c-add-stmt-syntax rather than just
      c-add-syntax, to assemble the syntactic context of a 'brace-list-entry, thus
      getting, possibly, several accompanying syntactic entries.
      
      * lisp/progmodes/cc-styles.el (c-style-alist, "gnu" style): New entry for
      'brace-list-intro, namely c-lineup-arglist-intro-after-paren.
      
      * lisp/progmodes/cc-vars.el (c-offsets-alist): Change the factory default
      offset for 'brace-list-entry from 0 to c-lineup-under-anchor.
      
      * doc/misc/cc-mode.texi (Syntactic Symbols): Amend the definition of
      brace-list-intro.
      (Brace List Symbols): Amend the example to show the new analysis of brace
      lists when the first element comes on the same line as the opening brace.
      (Misc Line-Up): Document the new line-up function c-lineup-under-anchor.
      94ad13b9
    • Lars Ingebrigtsen's avatar
      Revert "DOn't use string-as-unibyte in Gnus" · 5d61ef0d
      Lars Ingebrigtsen authored
      This reverts commit d1c93100.
      
      Not all the cases where we had string-as-unibyte were characters,
      so this needs to be considered more thoroughly before being redone.
      5d61ef0d
    • Michael Albinus's avatar
      Fix a subtle problem in Tramp with timers · d8057576
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-accept-process-output): Change argument
      list.  Make it work when called inside a timer.  See
      <http://lists.gnu.org/archive/html/tramp-devel/2017-01/msg00010.html>.
      d8057576
    • Mark Oteiza's avatar
      ; Bump let-alist · 12da2a5b
      Mark Oteiza authored
      * lisp/emacs-lisp/let-alist.el: Bump micro version (bug#24641).
      12da2a5b
  2. 31 Jan, 2017 12 commits
  3. 30 Jan, 2017 9 commits
    • Tom Tromey's avatar
      css-mode documentation lookup feature · 68e8f4bb
      Tom Tromey authored
      * etc/NEWS: Mention new feature.
      * lisp/textmodes/css-mode.el (css-mode-map): New defvar.
      (css--mdn-lookup-history): New defvar.
      (css-lookup-url-format): New defcustom.
      (css--mdn-property-regexp, css--mdn-completion-list): New defconsts.
      (css--mdn-after-render, css--mdn-find-symbol, css-lookup-symbol): New
      defuns.
      * test/lisp/textmodes/css-mode-tests.el (css-mdn-symbol-guessing): New
      test.
      68e8f4bb
    • Glenn Morris's avatar
      edt-mapper: just loading a library should not run code · 77888c88
      Glenn Morris authored
      * lisp/emulation/edt-mapper.el (edt-mapper): New function,
      containing code previously at top-level.
      * lisp/emulation/edt.el (edt-load-keys): After loading edt-mapper,
      run edt-mapper function.
      77888c88
    • Glenn Morris's avatar
      mh-compat.el: remove duplicate definition · 5cebfc44
      Glenn Morris authored
      * lisp/mh-e/mh-compat.el (mh-make-obsolete-variable):
      Remove duplicate definition.
      5cebfc44
    • Paul Eggert's avatar
      Add delq list arg check · 1056be0b
      Paul Eggert authored
      * src/fns.c (Fdelq): Check that list is a proper list.
      This is more compatible with what ‘delete’ does.
      1056be0b
    • Stefan Monnier's avatar
      * lisp/indent.el (indent-region-line-by-line): New function. · 499780da
      Stefan Monnier authored
      Extracted from indent-region.
      (indent-region, indent-region-function): Use it.
      499780da
    • Stefan Monnier's avatar
    • Eli Zaretskii's avatar
      More fixes to prevent crashes on C-g · 998e1976
      Eli Zaretskii authored
      * src/fns.c (Fassq, Frassq, Fplist_put): Reset immediate_quit
      before returning, to avoid crashes in quit.  (Bug#25566)
      998e1976
    • Eli Zaretskii's avatar
      Avoid crashes on C-g in TTY sessions · ab96c850
      Eli Zaretskii authored
      * src/keyboard.c (handle_interrupt): Don't quit if
      waiting_for_input is set, as doing that is "unsafe": it will
      abort.  (Bug#25566)
      ab96c850
    • Vibhav Pant's avatar
      Fix hash tables not being purified correctly. · 9c4dfdd1
      Vibhav Pant authored
      * src/alloc.c
      (purecopy_hash_table) New function, makes a copy of the given hash
      table in pure storage.
      Add new struct `pinned_object' and `pinned_objects' linked list for
      pinning objects.
      (Fpurecopy) Allow purifying hash tables
      (purecopy) Pin hash tables that are either weak or not declared with
      `:purecopy t`, use purecopy_hash_table otherwise.
      (marked_pinned_objects) New function, marks all objects in pinned_objects.
      (garbage_collect_1) Use it. Mark all pinned objects before sweeping.
      * src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
      * src/fns.c: Add `purecopy' parameter to hash tables.
      (Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
      to make_hash_table.
      (make_hash_table): Add `pure' parameter, set h->pure to it.
      (Fclrhash, Fremhash, Fputhash): Enforce that the table is impure with
      CHECK_IMPURE.
      * src/lread.c: (read1) Parse for `purecopy' parameter while reading
        hash tables.
      * src/print.c: (print_object) add the `purecopy' parameter while
        printing hash tables.
      * src/category.c, src/emacs-module.c, src/image.c, src/profiler.c,
        src/xterm.c: Use new (make_hash_table).
      9c4dfdd1
  4. 29 Jan, 2017 5 commits
    • Dmitry Gutov's avatar
      Escape dash in xref rgrep regexp · 8ba236e7
      Dmitry Gutov authored
      * lisp/progmodes/xref.el (xref-collect-matches): Escape dash
      in REGEXP if it's the first character.
      8ba236e7
    • Dmitry Gutov's avatar
      Say JavaScript, not Javascript · 52feecd3
      Dmitry Gutov authored
      * lisp/progmodes/js.el (js-mode-map, js-syntax-propertize)
      (js-js-error, js-eval, js-set-js-context)
      (js--get-js-context):
      Refer to the language consistently as JavaScript.
      52feecd3
    • Juanma Barranquero's avatar
      lisp/*.el: Fix some warnings · 2f90bbb5
      Juanma Barranquero authored
      * lisp/battery.el (dbus-get-property):
      * lisp/dired-aux.el (format-spec): Declare function.
      
      * lisp/net/zeroconf.el (zeroconf-list-service-names)
      (zeroconf-list-service-types, zeroconf-list-services):
      Mark unused lexical arg.
      
      * lisp/progmodes/hideshow.el (hs-hide-block-at-point):
      * lisp/progmodes/sql.el (sql-end-of-statement):
      Pass LIMIT to 'looking-back'.
      2f90bbb5
    • Noam Postavsky's avatar
      Don't warn about obsolete defgenerics when defining them · 9bf94639
      Noam Postavsky authored
      * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): The declaration code
      should run after the definition code (Bug#25556).
      9bf94639
    • Tino Calancha's avatar
      Fix Bug#25524 · 0073223c
      Tino Calancha authored
      * lisp/vc/diff-mode.el (diff-beginning-of-hunk):
      Return position at the beginning off the hunk.
      (diff-file-junk-re): Add SVN keywords.
      0073223c
  5. 28 Jan, 2017 4 commits
    • Stephen Berman's avatar
      hl-line.el: Don't try to operate on a killed buffer · d12e1ddf
      Stephen Berman authored
      * lisp/hl-line.el (hl-line-maybe-unhighlight): Examine only
      live buffers (bug#25522).
      d12e1ddf
    • Mark Oteiza's avatar
      Use access-file in EWW to check before downloading a file · c7bbddf0
      Mark Oteiza authored
      * lisp/net/eww.el (eww-download): Check accessibility of
      eww-download-directory to prevent starting a download that will fail
      to write.
      * src/fileio.c (Faccess_file): Clarify the use of string argument in
      the docstring.
      c7bbddf0
    • Yuri D'Elia's avatar
      Subject: Check Bcc after the Messag hook has run · f83363d3
      Yuri D'Elia authored
      * lisp/gnus/message.el (message-send): If the hook modifies
      the message (mml tags or headers), we should check bcc on the
      final message, not on the original.
      f83363d3
    • Juanma Barranquero's avatar
      test/*.el: Avoid byte-compiler warnings · 375c70fd
      Juanma Barranquero authored
      * test/lisp/abbrev-tests.el (abbrev-table-p-test): Remove unused 'let*'.
      
      * test/lisp/faces-tests.el (faces--test): New customization group.
      (faces--test1, faces--test2): Use it.
      
      * test/lisp/ffap-tests.el (ffap-tests-25243):
      Call 'mark-whole-buffer' interactively.
      
      * test/lisp/ibuffer-tests.el (ibuffer-filter-groups, ibuffer-filtering-alist)
      (ibuffer-filtering-qualifiers, ibuffer-save-with-custom)
      (ibuffer-saved-filter-groups, ibuffer-saved-filters): Defvar.
      (ibuffer-format-qualifier, ibuffer-unary-operand): Declare.
      
      * test/lisp/minibuffer-tests.el (completion-test1):
      Mark unused lexical arguments.
      
      * test/lisp/simple-tests.el (simple-test--dummy-buffer): Wrap result in
      'with-no-warnings' to avoid them when the macro is invoked for effect.
      
      * test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-count-test):
      Mark unused lexical arguments.
      
      * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-surface-test):
      Mark unused lexical arguments.
      (let-alist-cons): Remove unused let binding.
      
      * test/lisp/net/dbus-tests.el (dbus-debug): Defvar.
      (dbus-get-unique-name): Declare.
      
      * test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid):
      Call 'font-lock-fontify-buffer' interactively.
      
      * test/lisp/textmodes/tildify-tests.el (tildify-space-undo-test--test):
      Mark unused lexical argument.
      375c70fd
  6. 27 Jan, 2017 3 commits