1. 09 Apr, 2019 14 commits
    • Jackson Ray Hamilton's avatar
      Propertize and font-lock JSXText and JSXExpressionContainers · 8dae7423
      Jackson Ray Hamilton authored
      This completes highlighting support for JSX, as requested in:
      
      - https://github.com/mooz/js2-mode/issues/140
      - https://github.com/mooz/js2-mode/issues/330
      - https://github.com/mooz/js2-mode/issues/409
      
      * lisp/progmodes/js.el (js--name-start-chars): Extract part of
      js--name-start-re so it can be reused in another regexp.
      (js--name-start-re): Use js--name-start-chars.
      
      (js-jsx--font-lock-keywords): Use new matchers.
      (js-jsx--match-text, js-jsx--match-expr): New matchers to remove
      typical JS font-locking and extend the font-locked region,
      respectively.
      
      (js-jsx--tag-re, js-jsx--self-closing-re): New regexps matching JSX.
      (js-jsx--matched-tag-type, js-jsx--matching-close-tag-pos)
      (js-jsx--enclosing-curly-pos, js-jsx--enclosing-tag-pos)
      (js-jsx--at-enclosing-tag-child-p): New functions for parsing and
      analyzing JSX.
      
      (js-jsx--text-range, js-jsx--syntax-propertize-tag-text): New
      functions for propertizing JSXText.
      (js-jsx--syntax-propertize-tag): Propertize JSXText children of tags.
      (js-jsx--text-properties): Remove JSXText-related text properties when
      repropertizing.
      (js-mode): Extend the syntax-propertize region with
      syntax-propertize-multiline; we are now adding the syntax-multiline
      text property to buffer ranges that are JSXText to ensure the whole
      multiline JSX construct is reidentified.
      8dae7423
    • Jackson Ray Hamilton's avatar
      Font-lock JSX while editing it by extending regions · 4d2b5bbf
      Jackson Ray Hamilton authored
      * lisp/progmodes/js.el (js-jsx--font-lock-keywords):
      Call tag beginning and end matchers.
      (js-jsx--match-tag-beg, js-jsx--match-tag-end): New functions.
      (js-jsx--syntax-propertize-tag): Record buffer positions of JSXElement
      beginning and end for font-locking.
      
      (js--syntax-propertize-extend-region)
      (js-jsx--syntax-propertize-extend-region): New functions for extending
      the syntax-propertize region backwards to the start of a JSXElement so
      its JSXAttribute children on its n+1th lines can be parsed as such
      while editing those lines.
      (js-mode): Add js--syntax-propertize-extend-region to
      syntax-propertize-extend-region-functions.
      4d2b5bbf
    • Jackson Ray Hamilton's avatar
      Add basic JSX font-locking · 52a3113b
      Jackson Ray Hamilton authored
      Font-lock JSX from the beginning of the buffer to the end.  Tends to
      break temporarily when editing lines, because the parser doesn’t yet
      look backwards to determine if the end of a tag in the current range
      starts before the range.
      
      This also re-breaks some tests fixed by previous commits, as we begin
      to take a different direction in our parsing code, looking for JSX,
      rather than for non-JSX.  The parsing code will eventually provide
      information for indentation again.
      
      * lisp/progmodes/js.el (js--dotted-captured-name-re)
      (js-jsx--disambiguate-beginning-of-tag)
      (js-jsx--disambiguate-end-of-tag, js-jsx--disambiguate-syntax):
      Remove.
      (js-jsx--font-lock-keywords): New variable.
      (js--font-lock-keywords-3): Add JSX matchers.
      (js-jsx--match-tag-name, js-jsx--match-attribute-name): New functions.
      (js-jsx--syntax-propertize-tag): New function to aid in JSX
      font-locking and eventually indentation.
      (js-jsx--text-properties): New variable.
      (js-syntax-propertize): Propertize JSX properly using
      syntax-propertize-rules.
      52a3113b
    • Jackson Ray Hamilton's avatar
      Use js-jsx- prefix for functions and variables · 6f535762
      Jackson Ray Hamilton authored
      * lisp/progmodes/js.el (js--disambiguate-beginning-of-jsx-tag): Rename
      to js-jsx--disambiguate-beginning-of-tag.
      (js--disambiguate-end-of-jsx-tag): Rename to
      js-jsx--disambiguate-end-of-tag.
      (js--disambiguate-js-from-jsx): Rename to js-jsx--disambiguate-syntax.
      (js--jsx-start-tag-re): Rename to js-jsx--start-tag-re.
      (js--looking-at-jsx-start-tag-p): Rename to
      js-jsx--looking-at-start-tag-p.
      (js--jsx-end-tag-re): Rename to js-jsx--end-tag-re.
      (js--looking-back-at-jsx-end-tag-p): Rename to
      js-jsx--looking-back-at-end-tag-p.
      (js--as-sgml): Rename to js-jsx--as-sgml.
      (js--outermost-enclosing-jsx-tag-pos): Rename to
      js-jsx--outermost-enclosing-tag-pos.
      (js--jsx-indentation): Rename to js-jsx--indentation-type.
      (js--indent-line-in-jsx-expression): Rename to
      js-jsx--indent-line-in-expression.
      (js--indent-n+1th-jsx-line): Rename to js-jsx--indent-n+1th-line.
      6f535762
    • Jackson Ray Hamilton's avatar
      js-syntax-propertize: Disambiguate JS from JSX, fixing some indents · be86ece4
      Jackson Ray Hamilton authored
      Fix some JSX indentation bugs:
      
      - Bug#24896 / https://github.com/mooz/js2-mode/issues/389
      - Bug#30225
      - https://github.com/mooz/js2-mode/issues/459
      
      * lisp/progmodes/js.el (js--dotted-captured-name-re)
      (js--unary-keyword-re, js--unary-keyword-p)
      (js--disambiguate-beginning-of-jsx-tag)
      (js--disambiguate-end-of-jsx-tag)
      (js--disambiguate-js-from-jsx): New variables and functions.
      
      (js-syntax-propertize): Additionally clarify when syntax is JS so that
      ‘(with-syntax-table sgml-mode-syntax-table …)’ does not mistake some
      JS punctuation syntax for SGML parenthesis syntax, namely ‘<’ and ‘>’.
      
      * test/manual/indent/js-jsx-unclosed-2.js: Add additional test for
      unary operator parsing.
      be86ece4
    • Jackson Ray Hamilton's avatar
      Add new (failing) unclosed JSX test and separate such tests · 27e9bce7
      Jackson Ray Hamilton authored
      * test/manual/indent/js-jsx.js: Move test with intentional scan error to
      its own file, js-jsx-unclosed-1.js.
      * test/manual/indent/js-jsx-unclosed-1.js: New file.
      * test/manual/indent/js-jsx-unclosed-2.js: New file with test for
      regression caused by new ambiguous parsing of JS/JSX.
      27e9bce7
    • Jackson Ray Hamilton's avatar
      Refactor JSX indentation code to improve enclosing JSX discovery · 4b305bb1
      Jackson Ray Hamilton authored
      Fix a number of bugs reported for JSX indentation (caused by poor JSX
      detection):
      
      - https://github.com/mooz/js2-mode/issues/140#issuecomment-166250016
      - https://github.com/mooz/js2-mode/issues/490
      - Bug#24896 / https://github.com/mooz/js2-mode/issues/389 (with
      respect to comments)
      - Bug#26001 /
      https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380
      - https://github.com/mooz/js2-mode/issues/411 / Bug#27000 /
      https://github.com/mooz/js2-mode/issues/451
      
      Potentially manifest some new bugs (due to false positives with ‘<’
      and ‘>’ and SGML detection).  Slow down indentation a fair bit.
      
      * list/progmodes/js.el (js-jsx-syntax, js--jsx-start-tag-re)
      (js--looking-at-jsx-start-tag-p, js--looking-back-at-jsx-end-tag-p):
      New variables and functions.
      (js--jsx-find-before-tag, js--jsx-after-tag-re): Deleted.
      
      (js--looking-at-operator-p): Don’t mistake a JSXOpeningElement for the
      ‘<’ operator.
      (js--continued-expression-p): Don’t mistake a JSXClosingElement as a
      fragment of a continued expression including the ‘>’ operator.
      
      (js--as-sgml): Simplify.  Probably needn’t bind forward-sexp-function
      to nil (sgml-mode already does) and probably shouldn’t bind
      parse-sexp-lookup-properties to nil either (see Bug#24896).
      
      (js--outermost-enclosing-jsx-tag-pos): Find enclosing JSX more
      accurately than js--jsx-find-before-tag.  Use sgml-mode’s parsing
      logic, rather than unreliable heuristics like paren-wrapping.  This
      implementation is much slower; the previous implementation was fast,
      but at the expense of accuracy.  To make up for all the grief we’ve
      caused users, we will prefer accuracy over speed from now on.  That
      said, this can still probably be optimized a lot.
      
      (js--jsx-indented-element-p): Rename to js--jsx-indentation, since it
      doesn’t just return a boolean.
      (js--jsx-indentation): Refactor js--jsx-indented-element-p to simplify
      the implementation as the improved accuracy of other code allows (and
      to repent for some awful stylistic choices I made earlier).
      
      (js--expression-in-sgml-indent-line): Rename to
      js--indent-line-in-jsx-expression, since it’s a private function and
      we can give it a name that reads more like English.
      (js--indent-line-in-jsx-expression): Restructure point adjustment
      logic more like js-indent-line.
      
      (js--indent-n+1th-jsx-line): New function to complement
      js--indent-line-in-jsx-expression.
      
      (js-jsx-indent-line): Refactor.  Don’t bind js--continued-expression-p
      to ignore any more; instead, rely on the improved accuracy of
      js--continued-expression-p.
      
      (js-jsx-mode): Set js-jsx-syntax to t.  For now, this will be the flag
      we use to determine whether ‘JSX is enabled.’  (Maybe later, we will
      refactor the code to use this variable instead of requiring
      js-jsx-mode to be enabled, thus rendering the mode obsolete.)
      4b305bb1
    • Jackson Ray Hamilton's avatar
      Add failing tests for JSX indentation bugs · 58c77f1f
      Jackson Ray Hamilton authored
      * test/manual/indent/js-jsx.js: Add failing tests for all the js-mode
      and js2-mode JSX indentation bugs reported over the years that I could
      find.  Some may be duplicates, so I have grouped similar reports
      together, for now; we’ll see for certain which distinct cases we need
      once we start actually implementing fixes.
      * test/manual/indent/js-jsx-quote.js: New file with a nasty test.
      58c77f1f
    • Katsumi Yamaoka's avatar
      Restore .dir-locals.el accidentally deleted · e1872f80
      Katsumi Yamaoka authored
      But this way -- git add/commit/push -- is probably wrong, sorry.
      e1872f80
    • Katsumi Yamaoka's avatar
      Fix last commit message · e24cdf5c
      Katsumi Yamaoka authored
      e24cdf5c
    • Katsumi Yamaoka's avatar
      4f92cfdc
    • Katsumi Yamaoka's avatar
      Make `jump to group' work even if it is not activated (bug#33653) · 12cbe2e9
      Katsumi Yamaoka authored
      * lisp/gnus/gnus-group.el (gnus-group-goto-group):
      Use gnus-newsrc-hashtb instead of gnus-active-hashtb to check if
      a group exists even if its server is not activated (bug#33653).
      12cbe2e9
    • Katsumi Yamaoka's avatar
      Make `jump to group' work even if it is not activated (bug#33653) · 24d75c66
      Katsumi Yamaoka authored
      * lisp/gnus/gnus-group.el (gnus-group-goto-group):
      Use gnus-newsrc-hashtb instead of gnus-newsrc-hashtb to check if
      a group exists even if its server is not activated (bug#33653).
      24d75c66
    • Eric Abrahamsen's avatar
      Fix encoding and access of Gnus group names · 8b2dad28
      Eric Abrahamsen authored
      * lisp/gnus/gnus-start.el (gnus-active-to-gnus-format): Encode group
        names as 'latin-1.
      * lisp/gnus/nnmail.el (nnmail-parse-active): Ditto.
      * lisp/gnus/nnml.el (nnml-request-group, nnml-request-create-group,
        nnml-request-expire-articles, nnml-request-delete-group,
        nnml-request-rename-group, nnml-deletable-article-p,
        nnml-active-number, nnml-open-incremental-nov): Use assoc-string
        with nnml-group-alist.
      * lisp/gnus/nnrss.el (nnrss-request-delete-group,
        nnrss-retrieve-groups, nnrss-read-group-data, nnrss-check-group,
        nnrss-generate-download-script): Use assoc-string with
        nnrss-group-alist.
      8b2dad28
  2. 08 Apr, 2019 9 commits
    • Katsumi Yamaoka's avatar
      Make `move article' work again (bug#33653) · 3e5e097f
      Katsumi Yamaoka authored
      * lisp/gnus/gnus-sum.el (gnus-summary-move-article): Back to while loop
      m dolist that blocks nov and active from saving (bug#33653).
      3e5e097f
    • Stefan Monnier's avatar
      * lisp/gnus/gnus-sum.el: Prepare for lexical-binding · 36dc39bf
      Stefan Monnier authored
      Add defvars for all the gnus-tmp-*.
      (gnus-summary-make-local-variables): Move let binding to avoid setq.
      (gnus-set-global-variables): Use dolist.
      (gnus-summary-from-or-to-or-newsgroups, gnus-summary-insert-line)
      (gnus-summary-insert-dummy-line): Avoid dynbind args.
      (gnus-build-old-threads): Remove unused var 'id'.
      (gnus-nov-parse-line): Remove unused var 'buffer'.
      (gnus-thread-header): Prepare it for a lexbind world.
      (gnus-adjust-marked-articles): Remove unused var 'marks'.
      (gnus-mark-xrefs-as-read): Remove unused var 'idlist'.
      (gnus-summary-display-article): Erase&widen before mm-enable-multibyte.
      (gnus-summary-better-unread-subject): Remove unused var 'score'.
      (gnus-summary-find-matching): Remove unused var 'd'.
      (ps-right-header, ps-left-header, shr-ignore-cache): Declare vars.
      (gnus-summary-idna-message, gnus-summary-morse-message)
      (gnus-summary-sort-by-original):
      Fix interactive spec since we don't actually use any prefix arg.
      (gnus-summary-move-article, gnus-read-move-group-name): Use user-error.
      (gnus-summary-move-article): Use dolist.
      (gnus-summary-edit-article): Fix unquoting.
      (gnus-summary-highlight-line-0, gnus-summary-highlight-line):
      Declare dynbind vars documented in gnus-summary-highlight.
      36dc39bf
    • Juri Linkov's avatar
      * lisp/vc/diff-mode.el (diff-syntax-fontify-props): Check both buffer-local · 0667c737
      Juri Linkov authored
      and default value of find-file-hook.
      0667c737
    • Paul Eggert's avatar
      Allow gap before first non-Lisp pseudovec member · a038df77
      Paul Eggert authored
      Problem reported by Keith David Bershatsky in:
      https://lists.gnu.org/r/emacs-devel/2019-04/msg00259.html
      Solution suggested by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2019-04/msg00282.html
      * src/buffer.h (BUFFER_LISP_SIZE): Simplify by using PSEUDOVECSIZE.
      (BUFFER_REST_SIZE): Simplify by using VECSIZE and BUFFER_LISP_SIZE.
      * src/lisp.h (PSEUDOVECSIZE): Base it on the last Lisp field,
      not the first non-Lisp field.  All callers changed.  Callers
      without Lisp fields changed to use ALLOCATE_PLAIN_PSEUDOVECTOR.
      (ALLOCATE_PLAIN_PSEUDOVECTOR): New macro.
      a038df77
    • Stefan Monnier's avatar
      * lisp/gnus/gnus-agent.el (gnus-agent-fetch-articles): Use match-string · 31e9087c
      Stefan Monnier authored
      (gnus-agent-expire-group-1): Dial down on the 'setq'.
      31e9087c
    • Stefan Monnier's avatar
    • Stefan Monnier's avatar
      Eshell: Try to untangle the dependencies; move 'provide's to the end · 0d5e8361
      Stefan Monnier authored
      * lisp/eshell/esh-arg.el: Move defsubst and vars before first use.
      Don't require `esh-mode but esh-util instead.
      
      * lisp/eshell/esh-cmd.el: Require esh-module and esh-io.
      
      * lisp/eshell/esh-ext.el: Don't require esh-proc nor esh-cmd.
      (eshell-external-command): Require esh-proc for
      eshell-gather-process-output.
      
      * lisp/eshell/esh-mode.el: Don't require esh-io nor esh-var, but
      require esh-arg.
      (eshell-directory-name): Move from eshell.el.
      
      * lisp/eshell/esh-module.el: Don't require eshell.
      
      * lisp/eshell/esh-opt.el: Don't require esh-ext at top-level.
      (eshell--do-opts, eshell-show-usage): Require it here instead.
      
      * lisp/eshell/esh-proc.el: Don't require esh-cmd, but require esh-io.
      (eshell-reset-after-proc, eshell-record-process-object)
      (eshell-gather-process-output, eshell-send-eof-to-process):
      Require esh-mode and esh-var here.
      
      * lisp/eshell/esh-var.el: Require esh-module, esh-arg, and esh-io.
      
      * lisp/eshell/eshell.el: Require esh-module, esh-proc, esh-io, and esh-cmd.
      But don't require esh-mode.
      (eshell-directory-name): Move to esh-mode.
      (eshell-return-exits-minibuffer): Don't bind 'return' and 'M-return'
      since we already bind RET and M-RET.
      0d5e8361
    • Michael Albinus's avatar
      Fix file-readable-p and file-executable-p in some Tramp backends · a20845c1
      Michael Albinus authored
      * lisp/net/tramp-archive.el (tramp-archive-handle-file-readable-p):
      Use tramp-gvfs.
      
      * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-executable-p):
      Check that FILENAME exists.
      (tramp-gvfs-handle-file-readable-p): Check that FILENAME exists.
      Use heuristic in case it cannot be determined correctly.
      a20845c1
    • Alexander Gramiak's avatar
      ; * src/frame.h (MonitorInfo): Remove const modifier · 0b8117ed
      Alexander Gramiak authored
      This removes a compiler warning with xfree.
      0b8117ed
  3. 07 Apr, 2019 14 commits
  4. 06 Apr, 2019 3 commits