]> git.eshelyaron.com Git - emacs.git/log
emacs.git
5 years agoUpdate expectations for JSX indentation in JSXAttribute space
Jackson Ray Hamilton [Sat, 23 Mar 2019 19:33:20 +0000 (12:33 -0700)]
Update expectations for JSX indentation in JSXAttribute space

* test/manual/indent/js-jsx.js: Align expectations for dangling
closing constructs with other places in the tests.

5 years agoPropertize and font-lock JSXText and JSXExpressionContainers
Jackson Ray Hamilton [Sat, 9 Mar 2019 00:29:02 +0000 (16:29 -0800)]
Propertize and font-lock JSXText and JSXExpressionContainers

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.

5 years agoFont-lock JSX while editing it by extending regions
Jackson Ray Hamilton [Mon, 18 Feb 2019 05:16:13 +0000 (21:16 -0800)]
Font-lock JSX while editing it by extending regions

* 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.

5 years agoAdd basic JSX font-locking
Jackson Ray Hamilton [Sun, 17 Feb 2019 08:38:01 +0000 (00:38 -0800)]
Add basic JSX font-locking

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.

5 years agoUse js-jsx- prefix for functions and variables
Jackson Ray Hamilton [Sat, 16 Feb 2019 06:15:11 +0000 (22:15 -0800)]
Use js-jsx- prefix for functions and variables

* 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.

5 years agojs-syntax-propertize: Disambiguate JS from JSX, fixing some indents
Jackson Ray Hamilton [Mon, 11 Feb 2019 11:00:34 +0000 (03:00 -0800)]
js-syntax-propertize: Disambiguate JS from JSX, fixing some indents

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.

5 years agoAdd new (failing) unclosed JSX test and separate such tests
Jackson Ray Hamilton [Mon, 11 Feb 2019 05:11:17 +0000 (21:11 -0800)]
Add new (failing) unclosed JSX test and separate such tests

* 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.

5 years agoRefactor JSX indentation code to improve enclosing JSX discovery
Jackson Ray Hamilton [Sun, 10 Feb 2019 04:06:29 +0000 (20:06 -0800)]
Refactor JSX indentation code to improve enclosing JSX discovery

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.)

5 years agoAdd failing tests for JSX indentation bugs
Jackson Ray Hamilton [Sat, 9 Feb 2019 23:42:42 +0000 (15:42 -0800)]
Add failing tests for JSX indentation bugs

* 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.

5 years agoRestore .dir-locals.el accidentally deleted
Katsumi Yamaoka [Tue, 9 Apr 2019 04:38:31 +0000 (04:38 +0000)]
Restore .dir-locals.el accidentally deleted

But this way -- git add/commit/push -- is probably wrong, sorry.

5 years agoFix last commit message
Katsumi Yamaoka [Tue, 9 Apr 2019 04:28:03 +0000 (04:28 +0000)]
Fix last commit message

5 years agoMerge remote-tracking branch 'origin/master'
Katsumi Yamaoka [Tue, 9 Apr 2019 04:27:08 +0000 (04:27 +0000)]
Merge remote-tracking branch 'origin/master'

5 years agoMake `jump to group' work even if it is not activated (bug#33653)
Katsumi Yamaoka [Tue, 9 Apr 2019 04:15:57 +0000 (04:15 +0000)]
Make `jump to group' work even if it is not activated (bug#33653)

* 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).

5 years agoMake `jump to group' work even if it is not activated (bug#33653)
Katsumi Yamaoka [Tue, 9 Apr 2019 04:15:57 +0000 (04:15 +0000)]
Make `jump to group' work even if it is not activated (bug#33653)

* 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).

5 years agoFix encoding and access of Gnus group names
Eric Abrahamsen [Sun, 31 Mar 2019 16:09:18 +0000 (09:09 -0700)]
Fix encoding and access of Gnus group names

* 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.

5 years agoMake `move article' work again (bug#33653)
Katsumi Yamaoka [Fri, 5 Apr 2019 04:25:06 +0000 (04:25 +0000)]
Make `move article' work again (bug#33653)

* lisp/gnus/gnus-sum.el (gnus-summary-move-article): Back to while loop
m dolist that blocks nov and active from saving (bug#33653).

5 years ago* lisp/gnus/gnus-sum.el: Prepare for lexical-binding
Stefan Monnier [Mon, 8 Apr 2019 20:49:11 +0000 (16:49 -0400)]
* lisp/gnus/gnus-sum.el: Prepare for lexical-binding

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.

5 years ago* lisp/vc/diff-mode.el (diff-syntax-fontify-props): Check both buffer-local
Juri Linkov [Mon, 8 Apr 2019 20:34:20 +0000 (23:34 +0300)]
* lisp/vc/diff-mode.el (diff-syntax-fontify-props): Check both buffer-local

and default value of find-file-hook.

5 years agoAllow gap before first non-Lisp pseudovec member
Paul Eggert [Mon, 8 Apr 2019 19:59:22 +0000 (12:59 -0700)]
Allow gap before first non-Lisp pseudovec member

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.

5 years ago* lisp/gnus/gnus-agent.el (gnus-agent-fetch-articles): Use match-string
Stefan Monnier [Mon, 8 Apr 2019 19:43:26 +0000 (15:43 -0400)]
* lisp/gnus/gnus-agent.el (gnus-agent-fetch-articles): Use match-string

(gnus-agent-expire-group-1): Dial down on the 'setq'.

5 years ago* nadvice.el: Add ourselves to package--builtin-versions
Stefan Monnier [Mon, 8 Apr 2019 19:36:18 +0000 (15:36 -0400)]
* nadvice.el: Add ourselves to package--builtin-versions

5 years agoEshell: Try to untangle the dependencies; move 'provide's to the end
Stefan Monnier [Mon, 8 Apr 2019 18:28:34 +0000 (14:28 -0400)]
Eshell: Try to untangle the dependencies; move 'provide's to the end

* 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.

5 years agoFix file-readable-p and file-executable-p in some Tramp backends
Michael Albinus [Mon, 8 Apr 2019 11:34:54 +0000 (13:34 +0200)]
Fix file-readable-p and file-executable-p in some Tramp backends

* 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.

5 years ago; * src/frame.h (MonitorInfo): Remove const modifier
Alexander Gramiak [Mon, 8 Apr 2019 01:17:48 +0000 (19:17 -0600)]
; * src/frame.h (MonitorInfo): Remove const modifier

This removes a compiler warning with xfree.

5 years ago; * src/xfns.c (x-display-monitor-attributes-list) Fix typo.
Alexander Gramiak [Sun, 7 Apr 2019 18:53:41 +0000 (12:53 -0600)]
; * src/xfns.c (x-display-monitor-attributes-list) Fix typo.

5 years agoRename variable for clarity
Mattias Engdegård [Sun, 7 Apr 2019 18:50:40 +0000 (20:50 +0200)]
Rename variable for clarity

* lisp/progmodes/verilog-mode.el (verilog-sk-define-signal):
Rename sig-re to sig-chars, to make it clear that it isn't a regexp.

5 years agoPlug memory leak in GTK x-display-monitor-attributes-list
Alexander Gramiak [Sun, 7 Apr 2019 05:02:24 +0000 (23:02 -0600)]
Plug memory leak in GTK x-display-monitor-attributes-list

* src/frame.c (free_monitors) [USE_GTK]: Define in the GTK case as
  well.

* src/xfns.c (x-display-monitor-attributes-list) [USE_GTK]: Plug
  memory leak.

* src/frame.h (MonitorInfo): Declare name as pointing to const char.

5 years agoSimplify fill_gstring_header
Paul Eggert [Sun, 7 Apr 2019 18:43:17 +0000 (11:43 -0700)]
Simplify fill_gstring_header

* src/composite.c (fill_gstring_header): Omit first argument HEADER,
since in practice it is always nil.  Change caller to match.
Help the compiler by telling it LEN is nonnegative.
Problem found with --enable-gcc-warnings and gcc -O2 -Og.

5 years agoHelp the compiler with byte order
Paul Eggert [Sun, 7 Apr 2019 18:36:50 +0000 (11:36 -0700)]
Help the compiler with byte order

* src/xsettings.c (parse_settings): Help the compiler by
letting it deduce the native endianness at compile-time.

5 years agoFix more regexp oddities
Paul Eggert [Sun, 7 Apr 2019 09:44:37 +0000 (02:44 -0700)]
Fix more regexp oddities

Problems reported by Mattias Engdegård in:
https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00178.html
* lisp/progmodes/sh-script.el (sh-get-indent-info):
Reorder skip-chars-forward arg so that it does not look like a regexp.
* lisp/progmodes/verilog-mode.el (verilog-sk-define-signal):
Fix typo: the string is not a regexp.
* lisp/vc/log-edit.el (log-edit-goto-eoh): Fix typo: stray ‘:’.
* lisp/xml.el (xml-parse-dtd): Avoid ‘-’ right after char class.

5 years agoFix typo in tramp.texi
Michael Albinus [Sun, 7 Apr 2019 08:10:52 +0000 (10:10 +0200)]
Fix typo in tramp.texi

* doc/misc/tramp.texi (Change file name syntax)
(Frequently Asked Questions): '.' or ',' must follow xref.

5 years ago* lisp/net/tramp.el (tramp-parse-group): Rename third arg to SKIP-CHARS.
Michael Albinus [Sun, 7 Apr 2019 08:10:30 +0000 (10:10 +0200)]
* lisp/net/tramp.el (tramp-parse-group): Rename third arg to SKIP-CHARS.

(tramp-parse-sconfig-group): Fix thinko.

5 years ago* lisp/frame.el (display-planes): Use logb over truncate + log
Alexander Gramiak [Tue, 2 Apr 2019 17:14:18 +0000 (11:14 -0600)]
* lisp/frame.el (display-planes): Use logb over truncate + log

Suggested by Basil L. Contovounesios:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2019-03/msg01052.html

5 years agoIntroduce new defcustom for terminal CUA rectangle commands
Alexander Gramiak [Wed, 3 Apr 2019 20:06:45 +0000 (14:06 -0600)]
Introduce new defcustom for terminal CUA rectangle commands

This allows a user to set a non-meta modifier for their terminal
should his/her terminal support it. See bug#35058 for background on
this change.

* lisp/emulation/cua-base.el (cua-rectangle-terminal-modifier-key):
New defcustom.

* lisp/emulation/cua-base.el (cua--shift-control-x-prefix): Use new
defcustom.

5 years agoDefine and use new procedure display-symbol-keys-p
Alexander Gramiak [Wed, 3 Apr 2019 20:03:28 +0000 (14:03 -0600)]
Define and use new procedure display-symbol-keys-p

* lisp/frame.el (display-symbol-keys-p): Define.

* lisp/simple.el (normal-erase-is-backspace-setup-frame): Use eq
instead of memq.
(normal-erase-is-backspace-mode): Use display-symbol-keys-p.

5 years agoDefine and use new alias display-blink-cursor-p
Alexander Gramiak [Wed, 3 Apr 2019 20:03:42 +0000 (14:03 -0600)]
Define and use new alias display-blink-cursor-p

display-graphic-p is not used in this case because it may be possible
in the future for terminals to allow control over cursor blinking. For
details, see bug#35058.

* lisp/frame.el (blink-cursor-mode): Use display-blink-cursor-p.

5 years agoUse display-graphic-p and display-multi-frame-p in more cases
Alexander Gramiak [Wed, 3 Apr 2019 19:57:16 +0000 (13:57 -0600)]
Use display-graphic-p and display-multi-frame-p in more cases

* lisp/disp-table.el:
* lisp/faces.el:
* lisp/frame.el:
* lisp/info.el (Info-fontify-node):
* lisp/window.el (handle-select-window): Use display-graphic-p and
  display-multi-frame-p instead of explicit memq calls.

5 years agoDistinguish buttons from widgets (bug#34506)
Basil L. Contovounesios [Sun, 7 Apr 2019 02:36:47 +0000 (03:36 +0100)]
Distinguish buttons from widgets (bug#34506)

* lisp/button.el (button-at):
* lisp/wid-edit.el (widget-at): Avoid returning a false positive
when looking for a button and finding a widget, or vice versa.
* test/lisp/button-tests.el:
* test/lisp/wid-edit-tests.el: New files.

5 years ago* src/buffer.c (Fget_buffer_create): Apply booleans's eta-reduction
Stefan Monnier [Sat, 6 Apr 2019 22:54:31 +0000 (18:54 -0400)]
* src/buffer.c (Fget_buffer_create): Apply booleans's eta-reduction

5 years ago* lisp/subr.el (setq-default): Fix thinko
Stefan Monnier [Sat, 6 Apr 2019 22:44:24 +0000 (18:44 -0400)]
* lisp/subr.el (setq-default): Fix thinko

Reported by Johan Bockgård <bojohan+news@gnu.org>

5 years ago* doc/misc/tramp.texi (Remote processes): '.' or ',' must follow xref.
Glenn Morris [Sat, 6 Apr 2019 19:57:44 +0000 (12:57 -0700)]
* doc/misc/tramp.texi (Remote processes): '.' or ',' must follow xref.

5 years agoEncode the FILENAME argument of 'file-locked-p'
Eli Zaretskii [Sat, 6 Apr 2019 14:53:30 +0000 (17:53 +0300)]
Encode the FILENAME argument of 'file-locked-p'

* src/filelock.c (Ffile_locked_p): Encode the file name,
before passing it to system APIs.  (Bug#35171)

5 years agoDon't leave inhibit_buffer_hooks uninitialized
Basil L. Contovounesios [Sat, 6 Apr 2019 01:41:16 +0000 (02:41 +0100)]
Don't leave inhibit_buffer_hooks uninitialized

* src/buffer.c (Fget_buffer_create): Explicitly initialize
inhibit_buffer_hooks. (bug#34847)

5 years ago; * src/w32fns.c (Fw32_read_registry): Doc fix.
Eli Zaretskii [Sat, 6 Apr 2019 13:16:32 +0000 (16:16 +0300)]
; * src/w32fns.c (Fw32_read_registry): Doc fix.

5 years agoFix Bug#34847
Michael Albinus [Sat, 6 Apr 2019 09:36:34 +0000 (11:36 +0200)]
Fix Bug#34847

* lisp/autorevert.el (auto-revert-remove-current-buffer):
Add optional argument BUFFER.
(auto-revert-notify-rm-watch): Remove local hook.
(auto-revert-buffers): Check `buffer-live-p' in time.  (Bug#34847)

5 years agoUpdate documentation for indent-relative functions
Alex Branham [Tue, 26 Mar 2019 01:49:01 +0000 (20:49 -0500)]
Update documentation for indent-relative functions

* lisp/indent.el (indent-relative): Document what happens when there
  is no previous nonblank line.
* doc/lispref/text.texi (Relative Indent): Document
  indent-relative-first-indent-point instead of obsolete
  indent-relative-maybe. Fix documentation of which argument from
  'indent-relative' is used.

Bug#34858

5 years agoSmall elide-head.el update
Michał Krzywkowski [Sat, 6 Apr 2019 00:33:07 +0000 (20:33 -0400)]
Small elide-head.el update

* lisp/elide-head.el (elide-head-headers-to-hide):
Also match https for GPL.  (Bug#34919)

5 years ago* doc/emacs/emacs.texi (Acknowledgments): Remove duplicate.
Glenn Morris [Sat, 6 Apr 2019 00:03:04 +0000 (17:03 -0700)]
* doc/emacs/emacs.texi (Acknowledgments): Remove duplicate.

5 years agoAdapt tramp-tests.el
Michael Albinus [Fri, 5 Apr 2019 11:27:06 +0000 (13:27 +0200)]
Adapt tramp-tests.el

* test/lisp/net/tramp-tests.el (tramp-test30-make-process):
Instrument test.  Adapt check string.
(tramp-test34-explicit-shell-file-name)
(tramp-test43-asynchronous-requests): Skip tests for tramp-adb
with older Emacsen.

5 years agoMinor cleanup in widget.c
Konstantin Kharlamov [Tue, 2 Apr 2019 20:49:58 +0000 (23:49 +0300)]
Minor cleanup in widget.c

* src/widget.c (update_wm_hints): Remove variables that are
always zero, and simplify all expressions which used them.
(Bug#35062)

5 years agoMinor cleanup in gtkutil.c
Konstantin Kharlamov [Tue, 2 Apr 2019 00:23:27 +0000 (03:23 +0300)]
Minor cleanup in gtkutil.c

* src/gtkutil.c (x_wm_set_size_hint): Remove variables that
are always zero, and simplify all expressions which used
them.  (Bug#35062)

5 years agoMake `move article' work again (bug#33653)
Katsumi Yamaoka [Fri, 5 Apr 2019 04:25:06 +0000 (04:25 +0000)]
Make `move article' work again (bug#33653)

* lisp/gnus/gnus-sum.el (gnus-summary-move-article): Back to while loop
m dolist that blocks nov and active from saving (bug#33653).

5 years ago; Fix copyright years
Glenn Morris [Fri, 5 Apr 2019 00:41:02 +0000 (20:41 -0400)]
; Fix copyright years

5 years agoDon't check comp-buffer-name-function in derived mode (Bug#34956)
Troy Hinckley [Wed, 16 Jan 2019 22:47:07 +0000 (14:47 -0800)]
Don't check comp-buffer-name-function in derived mode (Bug#34956)

* lisp/progmodes/compile.el (define-compilation-mode): Remove
'compilation-buffer-name-function' from the list of overridden
variables to ensure that it is not mistaken for a variable that can be
major mode specific.  'compilation-buffer-name-function' is used
before the major mode is loaded, therefore overriding it here is
ineffectual.  Also, the function 'compilation-start' takes an optional
argument name-function, so there is already a mechanism to override
it.

5 years agoFix comment-empty-lines docstring (bug#35152)
Basil L. Contovounesios [Thu, 4 Apr 2019 22:37:08 +0000 (23:37 +0100)]
Fix comment-empty-lines docstring (bug#35152)

* lisp/newcomment.el (comment-empty-lines): Consistently use US
commas in docstring.  Fix indentation of and typo in custom :type.

5 years ago* lisp/progmodes/compile.el (compilation-error-regexp-alist): Typo
Stefan Monnier [Thu, 4 Apr 2019 20:27:29 +0000 (16:27 -0400)]
* lisp/progmodes/compile.el (compilation-error-regexp-alist): Typo

Reported by Kévin Le Gouguec <kevin.legouguec@gmail.com>

5 years ago* lisp/desktop.el (desktop--v2s): Add case for defstructs (bug#35131)
Stefan Monnier [Thu, 4 Apr 2019 17:46:30 +0000 (13:46 -0400)]
* lisp/desktop.el (desktop--v2s): Add case for defstructs (bug#35131)

5 years ago* test/lisp/net/tramp-tests.el (tramp-test43-asynchronous-requests):
Michael Albinus [Thu, 4 Apr 2019 11:41:53 +0000 (13:41 +0200)]
* test/lisp/net/tramp-tests.el (tramp-test43-asynchronous-requests):

Make it fit for tramp-adb.  Apply better check in process filter.

5 years agoAvoid recursive load of eshell
Mauro Aranda [Sat, 23 Mar 2019 14:38:14 +0000 (11:38 -0300)]
Avoid recursive load of eshell

* lisp/eshell/eshell.el: Provide eshell before requiring esh-mode to
avoid a recursive load when esh-mode requires esh-module (which in
turn requires eshell).  (Bug #34954)
The double loading can be noticed by entries in 'eshell-load-hook' or
forms passed to (with-eval-after-load 'eshell ...).

5 years agoFix repeated 'custom-add-option' in esh-mode.el (Bug#34993)
Mauro Aranda [Mon, 25 Mar 2019 13:38:39 +0000 (10:38 -0300)]
Fix repeated 'custom-add-option' in esh-mode.el (Bug#34993)

* lisp/eshell/esh-mode.el: Call 'custom-add-option' with the right
argument.

5 years agoWork on asynchronous processes for tramp-adb.el
Michael Albinus [Wed, 3 Apr 2019 19:36:40 +0000 (21:36 +0200)]
Work on asynchronous processes for tramp-adb.el

* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Simplify.  Remove echoed first line.
(tramp-adb-send-command): Add NEVEROPEN and NOOUTPUT.

* lisp/net/tramp-sh.el (tramp-process-sentinel): Remove.
(tramp-sh-handle-make-process): Simplify.

* lisp/net/tramp.el (tramp-process-sentinel): New defun, taken from
tramp-sh.el.  Delete trailing shell prompt.

* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Run also for tramp-adb.
(tramp-test32-shell-command): Remove tramp-adb restrictions.
(tramp-test34-explicit-shell-file-name): Rework.  Remove :unstable tag.

5 years ago* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types):
Glenn Morris [Wed, 3 Apr 2019 19:20:50 +0000 (15:20 -0400)]
* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types):
Expect failure on hydra.nixos.

5 years agoImprove commentary in 'field_relpos'
Eli Zaretskii [Wed, 3 Apr 2019 17:41:47 +0000 (20:41 +0300)]
Improve commentary in 'field_relpos'

* src/pdumper.c (PDUMPER_MAX_OBJECT_SIZE): New macro.
(field_relpos): Use PDUMPER_MAX_OBJECT_SIZE, and comment on
why we require that relpos be not too large.

5 years agoRestore process-environment after portable dumping
Eli Zaretskii [Wed, 3 Apr 2019 17:30:23 +0000 (20:30 +0300)]
Restore process-environment after portable dumping

* src/pdumper.c (struct dump_context): New member
old_process_environment.
(Fdump_emacs_portable): Record the original value of
process-environment.
(dump_unwind_cleanup): Restore the original values of
process-environment and post-gc-hook.

5 years agoFix bug in gud-gdb-marker-filter: first marker does not start with \n
Stephen Leake [Wed, 3 Apr 2019 17:25:45 +0000 (10:25 -0700)]
Fix bug in gud-gdb-marker-filter: first marker does not start with \n

5 years agoAvoid using obsolete indent-relative-maybe
Basil L. Contovounesios [Mon, 1 Apr 2019 23:56:04 +0000 (00:56 +0100)]
Avoid using obsolete indent-relative-maybe

* lisp/electric.el (electric-indent-functions-without-reindent):
* lisp/indent.el (indent-according-to-mode): Check for
indent-relative-first-indent-point in addition to its obsolete alias
indent-relative-maybe.
* lisp/obsolete/vi.el (vi-com-map): Use
indent-relative-first-indent-point in place of its obsolete alias
indent-relative-maybe.

5 years ago* lisp/progmodes/compile.el: Use non-nil values for *-function
Stefan Monnier [Wed, 3 Apr 2019 15:24:12 +0000 (11:24 -0400)]
* lisp/progmodes/compile.el: Use non-nil values for *-function

(compilation-parse-errors-filename-function,compilation-exit-message-function)
(compilation-process-setup-function, compilation-buffer-name-function):
Give them non-nil default values.
(compilation-buffer-name): Restructure slightly.
(compilation--default-buffer-name): New function, extracted from it.
Use `name-of-mode` instead of `mode-command` to check if the current
buffer is already in the appropriate mode.

5 years ago* lisp/progmodes/compile.el: Allow 'line' functions in error-regexp-alist
Stefan Monnier [Wed, 3 Apr 2019 14:58:36 +0000 (10:58 -0400)]
* lisp/progmodes/compile.el: Allow 'line' functions in error-regexp-alist

(compilation-error-properties): Allow 'line' and 'end-line' to be functions,
like 'col' and 'end-col'.
(compilation-error-regexp-alist): Document this.
(compilation-parse-errors): Drop support for old undocumented feature
where 'line' was a function of 2 arguments.
(compilation--compat-error-properties): Delete function.

5 years ago; Copyright years and license copyedits
Glenn Morris [Wed, 3 Apr 2019 04:40:56 +0000 (21:40 -0700)]
; Copyright years and license copyedits

5 years agoAllow partial decompression (Bug#33133)
Noam Postavsky [Sat, 27 Oct 2018 21:45:00 +0000 (17:45 -0400)]
Allow partial decompression (Bug#33133)

* src/decompress.c (Fzlib_decompress_region): Add optional
ALLOW-PARTIAL parameter.
* lisp/url/url-http.el (url-handle-content-transfer-encoding): Use it.
* doc/lispref/text.texi (Decompression): Document it.
* etc/NEWS: Announce it.

5 years ago* lisp/gnus/gnus-dup.el: Use lexical-binding
Basil L. Contovounesios [Mon, 25 Mar 2019 20:14:40 +0000 (20:14 +0000)]
* lisp/gnus/gnus-dup.el: Use lexical-binding

(gnus-dup-list-dirty): Add docstring.
(gnus-dup-open): Allocate gnus-dup-hashtb more conservatively now
that it is no longer an obarray.
(gnus-dup-enter-articles): Fix off-by-one error.
(gnus-dup-suppress-articles): DRY.

For discussion, see thread starting at:
https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00974.html

5 years agoFix verilog-mode vmm statements and AUTOINPUTREG ignores.
Wilson Snyder [Wed, 3 Apr 2019 00:05:16 +0000 (20:05 -0400)]
Fix verilog-mode vmm statements and AUTOINPUTREG ignores.

* lisp/progmodes/verilog-mode.el (verilog-vmm-statement-re):
Fix vmm statement regexps. Reported by Mattias Engdegard.
(verilog-auto-reg-input)
(verilog-auto-reg-input-assigned-ignore-regexp): For AUTOINPUTREG,
allow ignoring assignments with new
`verilog-auto-reg-input-assigned-ignore-regexp' variable, bug1401.
Reported by David Rogoff.

5 years agoImprove regexp advice again, and unchain ranges
Paul Eggert [Tue, 2 Apr 2019 22:00:59 +0000 (15:00 -0700)]
Improve regexp advice again, and unchain ranges

* doc/lispref/searching.texi (Regexp Special):
Mention char classes earlier, in a more-logical place.
Advise sticking to ASCII letters and digits in ranges.
Reword negative advice to make it clearer that it’s negative.
* lisp/files.el (make-auto-save-file-name):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/gnus/nndoc.el (nndoc-lanl-gov-announce-type-p)
(nndoc-generate-lanl-gov-head):
* lisp/org/org-eshell.el (org-eshell-open):
* lisp/org/org.el (org-deadline-time-hour-regexp)
(org-scheduled-time-hour-regexp):
* lisp/progmodes/bat-mode.el (bat-font-lock-keywords):
* lisp/progmodes/bug-reference.el (bug-reference-bug-regexp):
* lisp/textmodes/less-css-mode.el (less-css-font-lock-keywords):
* lisp/vc/vc-cvs.el (vc-cvs-valid-symbolic-tag-name-p):
* lisp/vc/vc-svn.el (vc-svn-valid-symbolic-tag-name-p):
Avoid attempts to chain ranges, as this can be confusing.
For example, instead of [0-9-_.], use [0-9_.-].

5 years agoFix documentation of last change
Eli Zaretskii [Tue, 2 Apr 2019 17:08:08 +0000 (20:08 +0300)]
Fix documentation of last change

* doc/misc/cl.texi (Structures): Document :noinline.

* etc/NEWS: Mark the entry for :noinline as documented.

5 years ago* lisp/emacs-lisp/cl-macs.el: Don't always inline struct functions
Stefan Monnier [Tue, 2 Apr 2019 16:24:52 +0000 (12:24 -0400)]
* lisp/emacs-lisp/cl-macs.el: Don't always inline struct functions

(cl--struct-inline): New var.
(cl-defstruct): Obey it along with a new :noinline keyword argument.

5 years ago* lisp/subr.el (prog2): Define as a macro
Stefan Monnier [Tue, 2 Apr 2019 13:51:20 +0000 (09:51 -0400)]
* lisp/subr.el (prog2): Define as a macro

* src/eval.c (Fprog2): Delete function.
(syms_of_eval): Don't register it.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
* lisp/emacs-lisp/generator.el (cps--transform-1): Remove `prog2` case.

* lisp/emacs-lisp/bytecomp.el (prog2): Remove handlers.
(byte-compile-prog2): Delete.

* lisp/emacs-lisp/lisp-mode.el (prog2): Remove property.

5 years agoSuppress timers in tramp-send-string
Michael Albinus [Tue, 2 Apr 2019 13:17:17 +0000 (15:17 +0200)]
Suppress timers in tramp-send-string

* lisp/net/tramp.el (tramp-send-string): Suppress timers.  Use
`with-local-quit'.

5 years agoGive example for configuration in tramp.texi
Michael Albinus [Tue, 2 Apr 2019 08:48:39 +0000 (10:48 +0200)]
Give example for configuration in tramp.texi

* doc/misc/tramp.texi (Configuration): Explain how to call Tramp
configuration functions in the init file.

5 years agoMore regexp advice and clarifications
Paul Eggert [Tue, 2 Apr 2019 07:17:37 +0000 (00:17 -0700)]
More regexp advice and clarifications

* doc/lispref/searching.texi (Regexp Special): Simplify style
advice for order of ], ^, and - in character alternatives.
Stick with saying that it’s not a good idea to put ‘-’ after a
range.  Remove the special case about raw 8-bit bytes and
unibyte characters, as this documentation is confusing and
seems to be incorrect in some cases.  Say that z-a is the
preferred style for reversed ranges, since it’s clearer and is
typically what’s used in practice.  Mention some bad styles:
duplicates in character alternatives, ranges that denote <=3
characters, and ‘-’ as the first character.

5 years agoMerge from origin/emacs-26
Paul Eggert [Tue, 2 Apr 2019 06:43:57 +0000 (23:43 -0700)]
Merge from origin/emacs-26

0924b27bca Say which regexp ranges should be avoided

# Conflicts:
# doc/lispref/searching.texi

5 years ago; Merge from origin/emacs-26
Paul Eggert [Tue, 2 Apr 2019 06:40:21 +0000 (23:40 -0700)]
; Merge from origin/emacs-26

The following commit was skipped:

297a141ca3 ; * lisp/ldefs-boot.el: Update.

5 years agoRefactor Gnus group name extraction in group completing read
Eric Abrahamsen [Sun, 31 Mar 2019 16:18:43 +0000 (09:18 -0700)]
Refactor Gnus group name extraction in group completing read

* lisp/gnus/gnus-group.el (gnus-group-completing-read): Only do the
  unibyte check once; make sure it applies to hash table keys as
  well.

5 years agoMake struct Lisp_Objfwd etc. objects read-only
Paul Eggert [Mon, 1 Apr 2019 18:54:23 +0000 (11:54 -0700)]
Make struct Lisp_Objfwd etc. objects read-only

Initialize these objects statically, and make them constants.
This is a bit safer and more efficient.
* src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD):
* src/lisp.h (XBUFFER_OBJFWD):
Return a pointer-to-const instead of an unrestricted pointer.
(lispfwd): fwdptr is now a pointer-to-const instead of an
unrestricted pointer.  All uses changed.
(SET_SYMBOL_FWD): Accept pointer-to-const instead of an
unrestricted pointer.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Initialize static structures statically
instead of dynamically, and make them const.
* src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
(defvar_lisp, defvar_kboard): Accept pointer-to-const instead
of an unrestricted pointer; it’s now the caller’s
responsibility to initialize the pointed-to storage.  No need
for a separate address argument any more.  All callers
changed.

5 years agoFix union Lisp_Fwd * alignment bug
Paul Eggert [Mon, 1 Apr 2019 18:54:23 +0000 (11:54 -0700)]
Fix union Lisp_Fwd * alignment bug

It's not portable to cast (e.g.) struct Lisp_Objfwd * to union
Lisp_Fwd * and then back again, because the compiler can then assume
that the pointer is aligned for union Lisp_Fwd * when accessing
the struct Lisp_Objfwd * components, and this assumption might
be incorrect becase we don't force that alignment.
* src/lisp.h (lispfwd): New type, replacing ...
(union Lisp_Fwd): ... this type, which was removed.
All uses changed.
(SET_SYMBOL_FWD): 2nd arg is now void *, not lispfwd.
All uses changed (casts no longer needed; they were
not portable anyway).

5 years ago* lisp/subr.el (setq-default): Define as a macro
Stefan Monnier [Mon, 1 Apr 2019 16:35:10 +0000 (12:35 -0400)]
* lisp/subr.el (setq-default): Define as a macro

* lisp/emacs-lisp/bytecomp.el (byte-compile-setq-default): Delete.
(byte-compile-set-default): Inline the part that it used.

* lisp/emacs-lisp/edebug.el (setq-default): Remove the debug spec.

* src/data.c (Fsetq_default): Delete.
(syms_of_data): Don't register.

5 years agoFix a typo in xterm.c and w32term.c
Eli Zaretskii [Mon, 1 Apr 2019 14:39:30 +0000 (17:39 +0300)]
Fix a typo in xterm.c and w32term.c

* src/xterm.c (x_window_to_scroll_bar):
* src/w32term.c (x_window_to_scroll_bar): Fix a typo.

5 years ago; Auto-commit of loaddefs files.
Glenn Morris [Mon, 1 Apr 2019 11:37:57 +0000 (07:37 -0400)]
; Auto-commit of loaddefs files.

5 years agoUse update-game-score more often with Tetris
Paul Eggert [Mon, 1 Apr 2019 03:00:30 +0000 (20:00 -0700)]
Use update-game-score more often with Tetris

* lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score):
Go back to previous way of deciding whether to invoke
update-game-score, except do not try to invoke it if file-modes
fails on it (Bug#35056).

5 years agoDo not set indent-line-function in text-mode
Basil L. Contovounesios [Mon, 25 Mar 2019 23:10:59 +0000 (23:10 +0000)]
Do not set indent-line-function in text-mode

* lisp/textmodes/text-mode.el (text-mode): Do not reset
indent-line-function to its global default value of indent-relative.
* doc/lispref/modes.texi (Example Major Modes):
* etc/NEWS: Document change accordingly.

5 years agoDo not set indent-line-function in text-mode
Basil L. Contovounesios [Sun, 31 Mar 2019 18:39:54 +0000 (19:39 +0100)]
Do not set indent-line-function in text-mode

For discussion, see thread starting at:
https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg01012.html
* lisp/textmodes/text-mode.el (text-mode): Do not reset
indent-line-function to its global default value of indent-relative.
* doc/lispref/modes.texi (Example Major Modes):
* etc/NEWS: Document change accordingly.

5 years agoUse lexical-binding in text-mode.el
Basil L. Contovounesios [Mon, 18 Mar 2019 23:45:55 +0000 (23:45 +0000)]
Use lexical-binding in text-mode.el

* lisp/textmodes/text-mode.el: Use lexical-binding.
(text-mode, paragraph-indent-minor-mode, text-mode-hook-identify):
Use setq-local.
(toggle-text-mode-auto-fill): Quote function symbols as such.
(center-line): Minor simplification.
* doc/lispref/modes.texi (Example Major Modes): Update code example
for these changes to text-mode.

5 years agoUse the correct filename for dump file in NS
Alan Third [Sun, 31 Mar 2019 17:14:31 +0000 (18:14 +0100)]
Use the correct filename for dump file in NS

* nextstep/Makefile.in (all):
(${ns_appbindir}/Emacs.pdmp):
(links): Use mixed case 'Emacs.pdmp' to match the executable name.

5 years agoFix recently extended delete-indentation behavior
Basil L. Contovounesios [Wed, 27 Mar 2019 15:13:25 +0000 (15:13 +0000)]
Fix recently extended delete-indentation behavior

* doc/lispref/text.texi (User-Level Deletion): Document new optional
arguments of delete-indentation.

* lisp/simple.el (delete-indentation): Do not barf if called
interactively when region is inactive. (bug#35021)
Do not skip blank lines. (bug#35036)
Consistently deactivate mark even when no text was changed.
Handle active region spanning a single line.

* test/lisp/simple-tests.el (simple-test--buffer-substrings):
New convenience function.
(simple-test--dummy-buffer, simple-test--transpositions): Use it.
(simple-delete-indentation-no-region)
(simple-delete-indentation-inactive-region): Update commentary.
Call delete-indentation interactively when testing for behavior with
inactive region and region is not explicitly defined.
(simple-delete-indentation-blank-line)
(simple-delete-indentation-boundaries)
(simple-delete-indentation-region)
(simple-delete-indentation-prefix): New tests.

5 years agoCheck gnus-newsgroup-dependencies is hash table in gnus-id-to-thread
Eric Abrahamsen [Sun, 31 Mar 2019 15:36:56 +0000 (08:36 -0700)]
Check gnus-newsgroup-dependencies is hash table in gnus-id-to-thread

* lisp/gnus/gnus-sum.el (gnus-id-to-thread): If dependencies haven't
  been initialized yet, don't blow up. Mimicks previous (non hasht
  table) behavior.

5 years agoFix typo in regexp-opt example code
Mattias Engdegård [Sun, 31 Mar 2019 13:53:52 +0000 (15:53 +0200)]
Fix typo in regexp-opt example code

* doc/lispref/searching.texi (Regexp Functions):
Fix typo in example code (Bug#34596).

5 years agoAllow a CC Mode derived mode to have strings delimited by single quotes.
Alan Mackenzie [Sat, 30 Mar 2019 13:19:47 +0000 (13:19 +0000)]
Allow a CC Mode derived mode to have strings delimited by single quotes.

Also fix the bug where the delimiters of '\033', etc. got the error face.

* lisp/progmodes/cc-langs.el (c-single-quotes-quote-strings): Enhance the docr
string.
(c-string-delims): Change doc string to doc comment.

* listp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): In
searches and comparisons, take account of the string delimiters possibly
being '.  Fix argument in call of c-before-change-check-unbalanced-strings.
(c-parse-quotes-before-change, c-parse-quotes-after-change): Bind
case-fold-search to nil.  Analyze escape constructs inside character constants
more accurately, in particular accepting as valid more than one character
after /[0-7], /x, /u, and /U.  Amend calculations to account for this extra
length.

5 years agoFix a thinko in a recent commit
Eli Zaretskii [Sat, 30 Mar 2019 11:27:11 +0000 (14:27 +0300)]
Fix a thinko in a recent commit

* src/buffer.c (Fkill_buffer): Fix last change.  (Bug#31138)
Reported by Mattias Engdegård <mattiase@acm.org>.

5 years agoRelease regexp before signalling overflow error
Mattias Engdegård [Tue, 19 Mar 2019 12:47:13 +0000 (13:47 +0100)]
Release regexp before signalling overflow error

* src/search.c (looking_at_1, search_buffer_re): Unfreeze the regexp
buffer before signalling a matcher overflow, since the error
processing may require quite some regexp use as well (Bug#34910).

5 years agoFix spurious regexp reentrancy error
Mattias Engdegård [Tue, 19 Mar 2019 12:06:20 +0000 (13:06 +0100)]
Fix spurious regexp reentrancy error

* src/search.c (compile_pattern): Don't give up if the last regexp
cache entry is busy.  Instead, use the last (least recently used)
non-busy entry, and only signal a reentrancy error if there is no free
entry at all (Bug#34910).

5 years agoDon't run buffer-related hooks in " *code conversion work*" buffers
Eli Zaretskii [Sat, 30 Mar 2019 09:01:58 +0000 (12:01 +0300)]
Don't run buffer-related hooks in " *code conversion work*" buffers

Note: portions of this change were mistakenly pushed as part
of an unrelated commit a35a1f6a9.

* src/buffer.c (Fget_buffer_create): Set inhibit_buffer_hooks
non-zero for temporary buffers created by coding.c.  Don't run
buffer-list-update-hook for such buffers.
(Frename_buffer, Fkill_buffer, record_buffer)
(Fbury_buffer_internal): Don't run hooks for buffers whose
inhibit_buffer_hooks flag is set.
* src/buffer.h (struct buffer): New member
inhibit_buffer_hooks.
* src/pdumper.c (dump_buffer): Dump the new field.  Update the
hash value in HASH_buffer_XXX.
* src/coding.c (make_conversion_work_buffer): Function deleted;
code moved to code_conversion_save.
(code_conversion_save): Insert code from
make_conversion_work_buffer, but arrange for unwind-protecting
the current buffer before switching to the work buffer.  This
avoids leaving reused_workbuf_in_use set if user presses C-g
during encoding/decoding.
(Vcode_conversion_workbuf_name): Now external variable.
* src/coding.h (Vcode_conversion_reused_workbuf): Declare.