]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoFix more ungetc bugs with encoding errors
Paul Eggert [Sat, 8 Jul 2017 01:12:16 +0000 (18:12 -0700)]
Fix more ungetc bugs with encoding errors

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

... before first use

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

7 years agoAdd realgud faces
R. Bernstein [Mon, 3 Jul 2017 12:29:05 +0000 (08:29 -0400)]
Add realgud faces

7 years agoFix tramp-tests.el for hydra
Michael Albinus [Mon, 3 Jul 2017 11:21:39 +0000 (13:21 +0200)]
Fix tramp-tests.el for hydra

* test/Makefile.in: Remove instrumentation for tramp-tests.

* test/lisp/net/tramp-tests.el (tramp-test36-asynchronous-requests):
Remove instrumentation.  Wrap with a timeout.  Give hydra
another timer value.  Set `default-directory' in timer.

7 years ago; Instrument tramp-tests.el
Michael Albinus [Mon, 3 Jul 2017 07:21:32 +0000 (09:21 +0200)]
; Instrument tramp-tests.el

7 years agoMerge branch 'master' into scratch/org-mode-merge
Bastien [Mon, 3 Jul 2017 07:09:31 +0000 (09:09 +0200)]
Merge branch 'master' into scratch/org-mode-merge

7 years agoMerge branch 'master' into scratch/org-mode-merge
Bastien [Mon, 3 Jul 2017 07:06:29 +0000 (09:06 +0200)]
Merge branch 'master' into scratch/org-mode-merge

7 years agodired-do-shell-command: Fix check for wildcards
Tino Calancha [Mon, 3 Jul 2017 03:55:06 +0000 (12:55 +0900)]
dired-do-shell-command: Fix check for wildcards

* lisp/dired-aux.el (dired-do-shell-command): Replace just '?', '*'
and '`?' i.e., keep the whitespaces.
* test/lisp/dired-aux-tests.el (dired-test-bug27496): Add test.

7 years agoSplit shr-copy-url dwim behavior into separate functions (Bug#26826)
Noam Postavsky [Thu, 11 May 2017 23:40:45 +0000 (19:40 -0400)]
Split shr-copy-url dwim behavior into separate functions (Bug#26826)

* lisp/net/shr.el (shr-url-at-point, shr-probe-url)
(shr-probe-and-copy-url, shr-maybe-probe-and-copy-url): New functions,
split out from `shr-copy-url'.
(shr-copy-url): Only copy the url, don't fetch it.
(shr-map): Bind 'w' and 'u' to `shr-maybe-probe-and-copy-url', which
has the same behavior as the old `shr-copy-url'.
* etc/NEWS: Announce changes.

7 years agoMake eww-search-words prompt for query if nothing selected
Alex Branham [Sun, 2 Jul 2017 19:18:47 +0000 (21:18 +0200)]
Make eww-search-words prompt for query if nothing selected

* lisp/net/eww.el (eww-search-words): Make eww-search-words prompt the
user for a search query if the region is inactive or if the region is
just whitespace.

Copyright-paperwork-exempt: yes

7 years ago* lisp/emacs-lisp/cl-print.el (cl-print-compiled-button): t by default.
Noam Postavsky [Sun, 2 Jul 2017 00:54:41 +0000 (20:54 -0400)]
* lisp/emacs-lisp/cl-print.el (cl-print-compiled-button): t by default.

* lisp/emacs-lisp/debug.el (debugger-insert-backtrace):
* lisp/help-fns.el (describe-variable): No need to let-bind
`cl-print-compiled-button' to t anymore.

7 years agoElectric quotes: Improve support for Markdown mode (Bug#24709)
Philipp Stephani [Wed, 28 Jun 2017 21:47:57 +0000 (23:47 +0200)]
Electric quotes: Improve support for Markdown mode (Bug#24709)

Introduce a new user option 'electric-quote-context-sensitive'.  If
non-nil, have ' insert an opening quote if sensible.

Also introduce a new variable 'electric-quote-code-faces'.  Major
modes such as 'markdown-mode' can add faces to this list to treat text
as inline code and disable electric quoting.

* lisp/electric.el (electric-quote-context-sensitive): New user
option.
(electric-quote-code-faces): New variable.
(electric-quote-post-self-insert-function): Treat ' as ` if
desired and applicable; disable electric quoting for given faces.

* test/lisp/electric-tests.el (electric-quote-opening-single)
(electric-quote-closing-single, electric-quote-opening-double)
(electric-quote-closing-double)
(electric-quote-context-sensitive-backtick)
(electric-quote-context-sensitive-bob-single)
(electric-quote-context-sensitive-bob-double)
(electric-quote-context-sensitive-bol-single)
(electric-quote-context-sensitive-bol-double)
(electric-quote-context-sensitive-after-space-single)
(electric-quote-context-sensitive-after-space-double)
(electric-quote-context-sensitive-after-letter-single)
(electric-quote-context-sensitive-after-letter-double)
(electric-quote-context-sensitive-after-paren-single)
(electric-quote-context-sensitive-after-paren-double)
(electric-quote-markdown-in-text)
(electric-quote-markdown-in-code): New unit tests.

7 years ago* doc/misc/tramp.texi: Replace ftp:// and http:// URLs by https://.
Michael Albinus [Sun, 2 Jul 2017 15:11:12 +0000 (17:11 +0200)]
* doc/misc/tramp.texi: Replace ftp:// and http:// URLs by https://.

7 years agoAsk confirmation for all suspicious wildcards
Tino Calancha [Sun, 2 Jul 2017 13:09:21 +0000 (22:09 +0900)]
Ask confirmation for all suspicious wildcards

* lisp/dired-aux.el (dired-do-shell-command): Check that all
the wildcards are right.  Otherwise, ask for confirmation (Bug#27496).

7 years agoExtend dired-do-shell-command substitutions
Tino Calancha [Sun, 2 Jul 2017 13:09:02 +0000 (22:09 +0900)]
Extend dired-do-shell-command substitutions

Substitute "`?`" inside command with the current file name.
See details in:
https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00618.html
* lisp/dired-aux.el (dired-quark-subst-regexp, dired-star-subst-regexp):
Mark as obsolete.
(dired-isolated-string-re): New defun.
(dired--star-or-qmark-p): New predicate.
(dired-do-shell-command): Use dired--star-or-qmark-p.  Substitute "`?`"
with the current file name.
* doc/emacs/dired.texi (Shell Commands in Dired): Update manual.
; * etc/NEWS: Mention it.

7 years agoFix bug in yesterday's CC Mode commit.
Alan Mackenzie [Sun, 2 Jul 2017 12:58:27 +0000 (12:58 +0000)]
Fix bug in yesterday's CC Mode commit.

* lisp/progmodes/cc-mode.el (c-quoted-number-head-before-point): Check a
search has succeded before using the match data.
(c-quoted-number-head-before-point, c-quoted-number-head-after-point):
Specify that the position of the extremity of the head or tail is in the
match data.

7 years agoRemove FIXME comments about sentinel values
Philipp Stephani [Sun, 2 Jul 2017 11:15:52 +0000 (13:15 +0200)]
Remove FIXME comments about sentinel values

These FIXMEs can't be addressed because they would require breaking
changes to the module API.  Furthermore, other module functions don't
return sentinel values as well, so users generally have to call
non_local_exit_check anyway.

* src/emacs-module.c (module_set_user_ptr)
(module_set_user_finalizer, module_vec_set, module_vec_size): Remove
FIXME comments.

7 years agoAdapt Lisp reference to reader changes
Philipp Stephani [Sun, 2 Jul 2017 10:31:12 +0000 (12:31 +0200)]
Adapt Lisp reference to reader changes

The reader now warns about some unescaped character literals, but
still allows them for compatibility reasons.  Slightly adapt the
manual to forbid them officially.

* doc/lispref/objects.texi (Basic Char Syntax): Document that
backslashes are now required before some characters.

7 years ago; Instrument tramp-tests.el
Michael Albinus [Sun, 2 Jul 2017 10:16:33 +0000 (12:16 +0200)]
; Instrument tramp-tests.el

7 years agoFix Bug#27502
Michael Albinus [Sun, 2 Jul 2017 09:41:58 +0000 (11:41 +0200)]
Fix Bug#27502

* lisp/autorevert.el (auto-revert-find-file-function): New defun.
(find-file-hook): Use it.  (Bug#27502)
(auto-revert-remove-current-buffer): New defun.
(auto-revert-mode, auto-revert-buffers): Use it.

7 years ago; Instrument tramp-tests.el
Michael Albinus [Sun, 2 Jul 2017 08:06:09 +0000 (10:06 +0200)]
; Instrument tramp-tests.el

7 years agoLet test summary go through even if some logs were not generated
Noam Postavsky [Sun, 2 Jul 2017 02:37:12 +0000 (22:37 -0400)]
Let test summary go through even if some logs were not generated

* lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): Check
for existence of log files before reading.

7 years ago* src/module-env-25.h (copy_string_contents): Fix comment.
Philipp Stephani [Sat, 1 Jul 2017 18:00:34 +0000 (20:00 +0200)]
* src/module-env-25.h (copy_string_contents): Fix comment.

7 years agoAlso mark module init function as noexcept if possible
Philipp Stephani [Sat, 1 Jul 2017 17:58:57 +0000 (19:58 +0200)]
Also mark module init function as noexcept if possible

* src/emacs-module.h.in (emacs_module_init): Mark as noexcept if
possible.

7 years agoImprove C++98 compatibility
Philipp Stephani [Sat, 1 Jul 2017 17:57:41 +0000 (19:57 +0200)]
Improve C++98 compatibility

* src/emacs-module.h.in (emacs_funcall_exit): Lose trailing comma.
C++98 doesn't allow trailing commas in enumerations.

7 years agoMinor copyedits of manuals regarding bidi conformance
Eli Zaretskii [Sat, 1 Jul 2017 17:01:39 +0000 (13:01 -0400)]
Minor copyedits of manuals regarding bidi conformance

* doc/emacs/mule.texi (Bidirectional Editing):
* doc/lispref/display.texi (Bidirectional Display): Update the
bidi conformance text.

7 years agoMake C++ digit separators work. Amend the handling of single quotes generally
Alan Mackenzie [Sat, 1 Jul 2017 15:43:07 +0000 (15:43 +0000)]
Make C++ digit separators work.  Amend the handling of single quotes generally

Single quotes, even in strings and comments, are now marked with the
"punctuation" syntax-table property, except where they are validly bounding a
character literal.  They are font locked with font-lock-warning-face except
where they are valid.  This is done in C, C++, ObjC, and Java Modes.

* lisp/progmodes/cc-defs.el (c-clear-char-property-with-value-on-char-function)
(c-clear-char-property-with-value-on-char, c-put-char-properties-on-char): New
functions/macros.

* lisp/progmodes/cc-fonts.el (c-font-lock-invalid-single-quotes): New function.
(c-basic-matchers-before): invoke c-font-lock-invalid-single-quotes.

* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Remove
c-before-after-change-digit-quote from wherever it occurs.  Insert
c-parse-quotes-before-change into the entries for the languages where it is
needed.
(c-before-font-lock-functions): Remove c-before-after-change-digit-quote from
wherever it occurs.  Insert c-parse-quotes-after-change into the entries for
the languages which need it.
(c-has-quoted-numbers): New lang-defconst/-defvar.

* lisp/progmodes/cc-mode.el (c-before-after-change-digit-quote): Remove.
(c-maybe-quoted-number-head, c-maybe-quoted-number-tail)
(c-maybe-quoted-number): New defconsts.
(c-quoted-number-head-before-point, c-quoted-number-tail-after-point)
(c-quoted-number-straddling-point, c-parse-quotes-before-change)
(c-parse-quotes-after-change): New functions.

7 years agoIgnore mouse-movement for describe-key-briefly (Bug#12204)
Noam Postavsky [Sun, 18 Jun 2017 04:39:05 +0000 (00:39 -0400)]
Ignore mouse-movement for describe-key-briefly (Bug#12204)

* lisp/help.el (help-read-key-sequence): Add optional argument ot
ignore `mouse-movement' events.
(describe-key-briefly): Use it.
* doc/emacs/help.texi (Key Help):
* etc/NEWS: Mention that mouse movement is ignored.

7 years agoRefactor key describing commands
Noam Postavsky [Sun, 18 Jun 2017 00:33:56 +0000 (20:33 -0400)]
Refactor key describing commands

* lisp/help.el (help-read-key-sequence, help--analyze-key): New
functions, extracted from `describe-key' and `describe-key-briefly'.
(describe-key, describe-key-briefly): Use them.

7 years agoFix threads on NS (bug#25265)
Alan Third [Sat, 1 Jul 2017 11:58:49 +0000 (12:58 +0100)]
Fix threads on NS (bug#25265)

src/nsterm.h (ns_select): Compiler doesn't like sigmask being const.
(ns_run_loop_break) [HAVE_PTHREAD]: New function.
src/nsterm.m (ns_select): Call thread_select from within ns_select.
(ns_run_loop_break) [HAVE_PTHREAD]: New function.
(ns_send_appdefined): Don't wait for main thread when sending app
defined event.
src/process.c (wait_reading_process_output): Call thread_select from
within ns_select.
src/systhread.c (sys_cond_broadcast) [HAVE_NS]: Break ns_select out of
its event loop using ns_run_loop_break.

7 years ago; Auto-commit of loaddefs files.
Glenn Morris [Sat, 1 Jul 2017 10:26:53 +0000 (06:26 -0400)]
; Auto-commit of loaddefs files.

7 years ago; Fix last commit
Michael Albinus [Sat, 1 Jul 2017 08:32:27 +0000 (10:32 +0200)]
; Fix last commit

7 years ago; Instrument test/Makefile.in for tramp-tests output on hydra
Michael Albinus [Sat, 1 Jul 2017 08:30:34 +0000 (10:30 +0200)]
; Instrument test/Makefile.in for tramp-tests output on hydra

7 years ago* lisp/help-fns.el (describe-variable): Let-bind cl-print-compiled-button.
Noam Postavsky [Sat, 1 Jul 2017 03:25:42 +0000 (23:25 -0400)]
* lisp/help-fns.el (describe-variable): Let-bind cl-print-compiled-button.

7 years ago* lisp/emacs-lisp/cl-extra.el (cl--random-state): New defstruct
Stefan Monnier [Sat, 1 Jul 2017 02:01:38 +0000 (22:01 -0400)]
* lisp/emacs-lisp/cl-extra.el (cl--random-state): New defstruct

(cl--random-state, cl--random-time): Move from cl-lib.el.
(cl-random): Use struct accessors.
(cl-random-state-p): Remove, provided by the defstruct.
(cl-make-random-state): Rewrite to struct constructor.

7 years ago* lisp/emacs-lisp/debug.el (debugger-list-functions): Remove obsolete msg
Stefan Monnier [Fri, 30 Jun 2017 22:01:01 +0000 (18:01 -0400)]
* lisp/emacs-lisp/debug.el (debugger-list-functions): Remove obsolete msg

7 years agoRelease Tramp 2.3.2
Michael Albinus [Fri, 30 Jun 2017 16:38:32 +0000 (18:38 +0200)]
Release Tramp 2.3.2

* doc/misc/tramp.texi (Android shell setup): Show default file name.
Structure section.

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.2".

* test/lisp/net/tramp-tests.el (tramp-test-temporary-file-directory):
Offer home directory for mock method if it doesn't exist.

7 years ago; Merge: Backtrace printing improvements (Bug#6991)
Noam Postavsky [Thu, 29 Jun 2017 23:42:32 +0000 (19:42 -0400)]
; Merge: Backtrace printing improvements (Bug#6991)

7 years agoEscape NUL bytes in X selections (Bug#6991)
Noam Postavsky [Sun, 12 Feb 2017 00:47:55 +0000 (19:47 -0500)]
Escape NUL bytes in X selections (Bug#6991)

* lisp/term/w32-win.el (w32--set-selection):
* lisp/select.el (xselect--encode-string): Replace NUL bytes with
"\0".
* doc/emacs/killing.texi: Document new behavior.
* etc/NEWS (times): Announce it.

7 years agoHide byte code in backtraces (Bug#6991)
Noam Postavsky [Wed, 28 Jun 2017 11:23:47 +0000 (07:23 -0400)]
Hide byte code in backtraces (Bug#6991)

* lisp/emacs-lisp/debug.el (debugger-print-function): New defcustom,
defaulting to `cl-print'.
(debugger-insert-backtrace, debugger-setup-buffer): Use it instead of
`prin1'.
* etc/NEWS: Announce it.

7 years agoDon't redundantly cl-print arglist in function docstring again
Noam Postavsky [Sun, 28 May 2017 02:40:46 +0000 (22:40 -0400)]
Don't redundantly cl-print arglist in function docstring again

* lisp/emacs-lisp/cl-print.el (cl-print-object): Don't print arglist
part of docstring.
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-1): Update
test accordingly.

7 years agoEscape control characters in backtraces (Bug#6991)
Noam Postavsky [Sat, 11 Feb 2017 23:13:54 +0000 (18:13 -0500)]
Escape control characters in backtraces (Bug#6991)

* src/print.c (syms_of_print): Add new variable,
print-escape-control-characters.
(print_object): Print control characters with octal escape codes when
print-escape-control-characters is true.
* lisp/subr.el (backtrace):
* lisp/emacs-lisp/debug.el (debugger-setup-buffer): Bind
`print-escape-control-characters' to t.

7 years agoImprove ert backtrace recording
Noam Postavsky [Sat, 11 Feb 2017 22:19:41 +0000 (17:19 -0500)]
Improve ert backtrace recording

Change ert to use the new `backtrace-frames' function instead of
collecting frames one by one with `backtrace-frame'.  Additionally,
collect frames starting from `signal' instead the somewhat arbitrary
"6 from the bottom".  Skipping 6 frames would skip the expression that
actually caused the signal that triggered the debugger.  Possibly 6
was chosen because in the case of a failed test, the triggering frame
is an `ert-fail' call, which is not so interesting.  But in case of a
test throwing an error, this drops the `error' call which is too much.

* lisp/emacs-lisp/debug.el (debugger-make-xrefs): Remove.
* lisp/emacs-lisp/ert.el (ert--make-xrefs-region): Bring in relevant
code from `debugger-make-xrefs'.
(ert--print-backtrace): Add DO-XREFS parameter, delegate to
`debugger-insert-backtrace'.
(ert--run-test-debugger): Record the backtrace frames starting from
the instigating `signal' call.
(ert-run-tests-batch): Pass nil for `ert--print-backtrace's new
DO-XREFS parameter.
(ert-results-pop-to-backtrace-for-test-at-point): Pass t as DO-XREFS
to `ert--print-backtrace' and remove call to `debugger-make-xrefs'.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-record-backtrace): Check
the backtrace list instead of comparing its string representation.
Expect `signal' to be the first frame.

7 years agoOperate on frame list instead of printed backtrace
Noam Postavsky [Sat, 11 Feb 2017 14:19:00 +0000 (09:19 -0500)]
Operate on frame list instead of printed backtrace

* lisp/emacs-lisp/debug.el (debugger-insert-backtrace): New function,
prints the given backtrace frames.
(debugger-setup-buffer): Use it instead of editing the backtrace
buffer text.

7 years agoImprove timer handling when Tramp accepts output
Michael Albinus [Thu, 29 Jun 2017 16:22:38 +0000 (18:22 +0200)]
Improve timer handling when Tramp accepts output

* lisp/net/tramp-compat.el: Avoid compiler warning.

* lisp/net/tramp-sh.el (tramp-sh-file-name-handler):
Remove lock machinery.

* lisp/net/tramp.el (tramp-locked, tramp-locker): Move up.
(tramp-file-name-handler): Add lock machinery from
`tramp-sh-file-name-handler'.  Allow timers to run.
(tramp-accept-process-output): Remove nasty workaround.
Suppress timers.

* test/lisp/net/tramp-tests.el (shell-command-sentinel):
Suppress run in tests.
(tramp--instrument-test-case-p): New defvar.
(tramp--instrument-test-case): Use it in order to allow nested calls.
(tramp--test-message, tramp--test-backtrace): New defsubst,
will be used for occasional test instrumentation.
(tramp-test00-availability, tramp-test31-vc-registered): Use them.
(tramp-test28-shell-command)
(tramp--test-shell-command-to-string-asynchronously): Suppress
nasty messages.  Don't overwrite sentinel.
(tramp-test36-asynchronous-requests): Rewrite major parts.
Expect :passed.

7 years ago* lisp/url/url-history.el: Use lexical-binding
Stefan Monnier [Wed, 28 Jun 2017 14:44:18 +0000 (10:44 -0400)]
* lisp/url/url-history.el: Use lexical-binding

(url-completion-function): Mark as obsolete.
Mark unused args accordingly.

7 years agoDon't assume url structs are vectors (Bug#27333)
Noam Postavsky [Thu, 15 Jun 2017 00:23:29 +0000 (20:23 -0400)]
Don't assume url structs are vectors (Bug#27333)

* lisp/url/url-history.el (url-history-update-url): Use `url-p'
instead of `vectorp'.

7 years agoReplace with dolist some uses of while
Mark Oteiza [Wed, 28 Jun 2017 03:59:24 +0000 (23:59 -0400)]
Replace with dolist some uses of while

* lisp/calc/calc-units.el (calc-permanent-units):
(math-compare-unit-names, math-simplify-units-quotient):
(math-build-units-table-buffer): Use dolist to replace extra bindings
and some while loops.

7 years agoMake tcl-auto-fill-mode obsolete (Bug#10772)
Noam Postavsky [Sun, 2 Apr 2017 01:02:50 +0000 (21:02 -0400)]
Make tcl-auto-fill-mode obsolete (Bug#10772)

* lisp/progmodes/tcl.el (tcl-auto-fill-mode): Declare obsolete.
* etc/NEWS: Announce it.

7 years agoDon't read eshell/which output from *Help* buffer (Bug#26894)
Noam Postavsky [Sun, 4 Jun 2017 02:15:19 +0000 (22:15 -0400)]
Don't read eshell/which output from *Help* buffer (Bug#26894)

* lisp/help-fns.el (help-fns--analyse-function)
(help-fns-function-description-header): New functions, extracted from
describe-function-1.
(describe-function-1): Use them.
* lisp/eshell/esh-cmd.el (eshell/which): Use
`help-fns-function-description-header' instead of
`describe-function-1'.

7 years agoAvoid segfaults when some display vector is an empty string
Eli Zaretskii [Tue, 27 Jun 2017 15:45:22 +0000 (11:45 -0400)]
Avoid segfaults when some display vector is an empty string

* src/xdisp.c (next_element_from_display_vector): Don't try
accessing the dpvec[] array if its size is zero.  (Bug#27504)

7 years agoFix bug in handling GnuPG's TRUST_MARGINAL status
Teemu Likonen [Sun, 25 Jun 2017 17:50:54 +0000 (20:50 +0300)]
Fix bug in handling GnuPG's TRUST_MARGINAL status

* lisp/epg.el (epg--status-TRUST_MARGINAL): Change symbol `marginal'
to `good'.

7 years ago; * src/emacs-module.c (module_make_string): Add another FIXME
Philipp Stephani [Mon, 26 Jun 2017 09:24:25 +0000 (11:24 +0200)]
; * src/emacs-module.c (module_make_string): Add another FIXME

7 years agoPrefer `when' instead of 1-branch `if'
Tino Calancha [Mon, 26 Jun 2017 08:20:42 +0000 (17:20 +0900)]
Prefer `when' instead of 1-branch `if'

* lisp/dired-aux.el (dired-do-shell-command): Store condition value
in local variable ok.
Use `when' instead of 1-branch `if'.

7 years agoUse #' instead of (function ...)
Tino Calancha [Mon, 26 Jun 2017 05:22:34 +0000 (14:22 +0900)]
Use #' instead of (function ...)

* lisp/dired-aux.el (dired-do-chxxx, dired-clean-directory)
(dired-mark-confirm, dired-query, dired-byte-compile)
(dired-load, dired-update-file-line, dired-after-subdir-garbage)
(dired-relist-file, dired-rename-subdir, dired-do-create-files)
(dired-mark-read-file-name, dired-do-copy, dired-do-symlink)
(dired-do-hardlink, dired-do-rename, dired-do-rename-regexp)
(dired-do-copy-regexp, dired-do-hardlink-regexp)
(dired-do-symlink-regexp, dired-create-files-non-directory)
(dired-upcase, dired-downcase)

* lisp/dired.el (dired-mode, dired-copy-filename-as-kill)
(dired-internal-do-deletions, dired-internal-do-deletions):
Prefer #' instead of (function ...).