]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoFix recently-introduced file descriptor leak
Paul Eggert [Sat, 19 Aug 2017 06:52:19 +0000 (23:52 -0700)]
Fix recently-introduced file descriptor leak

* src/fileio.c (Fmake_temp_file_internal):
Don’t leak a file descriptor if write_region signals an error.

7 years agoImprove make-temp-file performance on local files
Paul Eggert [Sat, 19 Aug 2017 03:36:10 +0000 (20:36 -0700)]
Improve make-temp-file performance on local files

* lisp/files.el (make-temp-file): Let make-temp-file-internal do
the work of inserting the text.
* src/fileio.c (Fmake_temp_file_internal): New arg TEXT.
All callers changed.

7 years agoDon't lose arguments to eshell aliases (Bug#27954)
Noam Postavsky [Mon, 7 Aug 2017 12:56:42 +0000 (08:56 -0400)]
Don't lose arguments to eshell aliases (Bug#27954)

* lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Use ARGS.

7 years ago; * test/lisp/auth-source-tests.el: Require `cl-lib' instead of `cl'.
Noam Postavsky [Sat, 19 Aug 2017 02:27:08 +0000 (22:27 -0400)]
; * test/lisp/auth-source-tests.el: Require `cl-lib' instead of `cl'.

7 years ago* lisp/files.el (make-temp-file): Fix directory use case.
Ted Zlatanov [Sat, 19 Aug 2017 02:07:36 +0000 (22:07 -0400)]
* lisp/files.el (make-temp-file): Fix directory use case.

7 years agoFix and document make-temp-file optional text parameter
Ted Zlatanov [Sat, 19 Aug 2017 01:55:11 +0000 (21:55 -0400)]
Fix and document make-temp-file optional text parameter

* lisp/files.el (make-temp-file): Fix initial TEXT parameter.
(files--make-magic-temp-file): Support optional TEXT parameter.
* etc/NEWS: Document it.
* doc/lispref/files.texi: Document it.
* test/lisp/auth-source-tests.el: Minor reformat.

7 years ago* test/lisp/auth-source-tests.el: Avoid `string-join' to be simple.
Ted Zlatanov [Sat, 19 Aug 2017 01:14:17 +0000 (21:14 -0400)]
* test/lisp/auth-source-tests.el: Avoid `string-join' to be simple.

7 years ago* test/lisp/auth-source-tests.el: Minor cleanups to use CL.
Ted Zlatanov [Fri, 18 Aug 2017 22:44:58 +0000 (18:44 -0400)]
* test/lisp/auth-source-tests.el: Minor cleanups to use CL.

7 years agoFix default value of electric-pair-pairs and electric-pair-text-pairs
João Távora [Thu, 17 Aug 2017 09:44:38 +0000 (10:44 +0100)]
Fix default value of electric-pair-pairs and electric-pair-text-pairs

Fixes: debbugs:24901
A previous change, titled "Add support for curly quotation marks to
electric-pair-mode", attempted to add these characters to the default
value of these variables.  But it did so in a quoted list, preventing
evaluation of the relevant expressions and resulting in an invalid
format.

* lisp/elec-pair.el (electric-pair-pairs, electric-pair-text-pairs):
Use backquote and comma.

7 years ago* lisp/elec-pair.el (electric-pair-text-pairs): Don't autoload (Bug#24901).
Noam Postavsky [Thu, 17 Aug 2017 11:06:47 +0000 (07:06 -0400)]
* lisp/elec-pair.el (electric-pair-text-pairs): Don't autoload (Bug#24901).

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Require `elec-pair'
explicitly in the interactive case.

7 years ago* etc/tutorials/TUTORIAL.sv: synced with TUTORIAL
Mats Lidell [Fri, 18 Aug 2017 22:18:22 +0000 (00:18 +0200)]
* etc/tutorials/TUTORIAL.sv: synced with TUTORIAL

7 years agoAdd auth-source tests and codify its API better
Ted Zlatanov [Fri, 18 Aug 2017 22:30:37 +0000 (18:30 -0400)]
Add auth-source tests and codify its API better

The auth-source behavior was unclear in some API use cases, so these
extra tests codify and test it. For details see
https://github.com/DamienCassou/auth-password-store/issues/29

* lisp/files.el (make-temp-file): Add new initial TEXT parameter.
* test/lisp/auth-source-tests.el (auth-source-test-searches): Add
  auth-source tests and simplify them with the new `make-temp-file'.

7 years agoDon't call the same hook twice due to obsolete aliases
Eli Zaretskii [Fri, 18 Aug 2017 09:33:08 +0000 (12:33 +0300)]
Don't call the same hook twice due to obsolete aliases

* lisp/international/robin.el (robin-activate):
* lisp/international/quail.el (quail-activate):
* lisp/international/mule-cmds.el (deactivate-input-method):
* lisp/emulation/viper-init.el (viper-deactivate-input-method):
Don't call the same hook twice, when the obsolete and the
advertised symbols are aliased.  (Bug#28118)

7 years agoA new face for show-paren in expression mode
Felipe Ochoa [Fri, 18 Aug 2017 09:05:12 +0000 (12:05 +0300)]
A new face for show-paren in expression mode

* lisp/faces.el (show-paren-match-expression): Define the new face.
* lisp/paren.el (show-paren-function): Apply the different face
when in expression mode.  (Bug#28047)

Copyright-paperwork-exempt: yes

7 years agoNon-ASCII support for man page section and header names
Eli Zaretskii [Fri, 18 Aug 2017 08:47:29 +0000 (11:47 +0300)]
Non-ASCII support for man page section and header names

* lisp/man.el (Man-name-regexp, Man-page-header-regexp)
(Man-heading-regexp): Replace ASCII character classes by
equivalent classes that allow non-ASCII characters.  Suggested by
Grégory Mounié <Gregory.Mounie@imag.fr>.  (Bug#27978)

7 years agoImplement HiDPI support for underwave on MS-Windows
Eli Zaretskii [Fri, 18 Aug 2017 08:32:10 +0000 (11:32 +0300)]
Implement HiDPI support for underwave on MS-Windows

* src/w32term.c (x_get_scale_factor): New function.
(w32_draw_underwave): Use it.
* src/xterm.c (x_draw_underwave): Offset the wave starting point
to make it identical with original code.

7 years agoSupport HiDPI displays for wave style underlines
Stephen Pegoraro [Fri, 18 Aug 2017 08:02:40 +0000 (11:02 +0300)]
Support HiDPI displays for wave style underlines

* src/xterm.c (x_draw_underwave): Compute height, length and thickness
based on scale factor.
(x_get_scale_factor): New function.

Copyright-paperwork-exempt: yes

7 years agoDelete library-of-babel.org
Bastien [Fri, 18 Aug 2017 07:39:54 +0000 (09:39 +0200)]
Delete library-of-babel.org

* etc/org/library-of-babel.org: Delete file.

7 years ago; Minor copyedits in manuals.
Eli Zaretskii [Fri, 18 Aug 2017 06:33:11 +0000 (09:33 +0300)]
; Minor copyedits in manuals.

* doc/lispref/variables.texi (Lexical Binding): The future is here.

* doc/emacs/files.texi (Copying and Naming): Use @w{..} around
constructs that could be split between lines, but shouldn't.

7 years ago* doc/emacs/files.texi (Copying and Naming): Avoid confusing texi2pdf.
Glenn Morris [Fri, 18 Aug 2017 01:49:27 +0000 (21:49 -0400)]
* doc/emacs/files.texi (Copying and Naming): Avoid confusing texi2pdf.

7 years agoRemove custom version parsing from epg-config.el (Bug#27963)
Noam Postavsky [Sun, 23 Jul 2017 03:54:34 +0000 (23:54 -0400)]
Remove custom version parsing from epg-config.el (Bug#27963)

* lisp/epg-config.el (epg-config--compare-version)
(epg-config--parse-version): Remove.
(epg-check-configuration): Use `version<=' instead.

7 years agoTreat control characters in JSON strings as invalid
Mark Oteiza [Fri, 18 Aug 2017 00:00:52 +0000 (20:00 -0400)]
Treat control characters in JSON strings as invalid

* lisp/json.el (json-peek): Reduce to following-char.
(json-pop, json-read): Zero (null char) means end of file.
(json-read-escaped-char): Delimit URL properly.
(json-read-string): Signal error for ASCII control characters.
* test/lisp/json-tests.el (test-json-peek): Check for zero instead of
:json-eof symbol.
(test-json-read-string): New test for control characters in JSON
strings.

7 years agoSupport Posix semantics of 'rename' on MS-Windows
Eli Zaretskii [Thu, 17 Aug 2017 16:48:49 +0000 (19:48 +0300)]
Support Posix semantics of 'rename' on MS-Windows

* src/w32.c (sys_rename_replace): Support Posix semantics of
'rename': return an error if OLD is a directory while NEW is not,
or vice versa.

7 years ago* src/w32.c (sys_rename_replace): Support renaming a directory.
Eli Zaretskii [Thu, 17 Aug 2017 14:58:08 +0000 (17:58 +0300)]
* src/w32.c (sys_rename_replace): Support renaming a directory.

7 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 17 Aug 2017 14:44:22 +0000 (17:44 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

7 years agoFix the MS-Windows build
Eli Zaretskii [Thu, 17 Aug 2017 14:43:19 +0000 (17:43 +0300)]
Fix the MS-Windows build

* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_open): Omit Gnulib module
'open'.

* lib-src/etags.c (O_CLOEXEC) [WINDOWSNT]: Restore definition.

7 years agoAdd flymake-backends defcustom
João Távora [Thu, 17 Aug 2017 13:18:00 +0000 (14:18 +0100)]
Add flymake-backends defcustom

* lisp/progmodes/flymake-proc.el (flymake-proc-can-syntax-check-buffer):
Rename from flymake-can-syntax-check-file.  Suitable for adding to
flymake-backends.
(flymake-proc-start-syntax-check): Rename from
flymake-start-syntax-check.  Don't check again if buffer can be
checked.
(add-to-list flymake-backends): Hook only flymake-ui.el

* lisp/progmodes/flymake-ui.el (flymake-backends): New
defcustom.
(flymake-on-timer-event, flymake-after-change-function)
(flymake-after-save-hook, flymake-find-file-hook): Call new
flymake--start-syntax-check-buffer and
flymake--can-syntax-check-buffer.
(flymake-mode): Call flymake--can-syntax-check-buffer and set
flymake-backend.
(flymake--backend): New buffer-local variable.

7 years agoSplit flymake.el into flymake-proc.el and flymake-ui.el
João Távora [Thu, 17 Aug 2017 11:43:05 +0000 (12:43 +0100)]
Split flymake.el into flymake-proc.el and flymake-ui.el

flymake.el is now a stub that requires both files.

* lisp/progmodes/flymake-proc.el: New file.

* lisp/progmodes/flymake-ui.el: New file.

* lisp/progmodes/flymake.el: Split into flymake-ui.el and
  flymake-proc.el.  Require both files.

7 years agoSet `default-directory' for watchdog in tramp-test.el
Michael Albinus [Thu, 17 Aug 2017 09:35:41 +0000 (11:35 +0200)]
Set `default-directory' for watchdog in tramp-test.el

* test/lisp/net/tramp-tests.el (tramp-test36-asynchronous-requests):
Set `default-directory' for watchdog.

7 years ago* lisp/term/konsole.el: New file.
Andreas Schwab [Thu, 17 Aug 2017 09:13:04 +0000 (11:13 +0200)]
* lisp/term/konsole.el: New file.

7 years ago* lisp/woman.el (woman-push, woman-pop): Remove. (Bug#27962)
Noam Postavsky [Fri, 30 Jun 2017 01:51:04 +0000 (21:51 -0400)]
* lisp/woman.el (woman-push, woman-pop): Remove.  (Bug#27962)

(woman2-RS): Use plain `push' instead of `woman-push'.
(woman2-RE): Conditionally `pop' instead of `woman-pop'.

7 years agoMerge from Gnulib; use ‘open’ for O_CLOEXEC
Paul Eggert [Wed, 16 Aug 2017 20:55:46 +0000 (13:55 -0700)]
Merge from Gnulib; use ‘open’ for O_CLOEXEC

This incorporates:
2017-08-15 renameat: ensure declaration in <stdio.h> on NetBSD
2017-08-15 extensions: enable NetBSD specific extensions
2017-08-14 open: support O_CLOEXEC
2017-08-13 reallocarray: new module
* admin/merge-gnulib (AVOIDED_MODULES): Remove ‘open’, since
it now supports O_CLOEXEC and this simplifies Emacs.
* build-aux/config.guess, lib/fcntl.in.h, lib/stdio.in.h:
* lib/stdlib.in.h, m4/extensions.m4, m4/stdlib_h.m4:
Copy from Gnulib.
* lib/cloexec.c, lib/cloexec.h, lib/open.c:
* m4/mode_t.m4, m4/open-cloexec.m4, m4/open.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/etags.c (O_CLOEXEC) [WINDOWSNT]:
Remove, as Gnulib does this for us.
* src/filelock.c (create_lock_file):
* src/sysdep.c (emacs_open, emacs_pipe):
Don’t worry about O_CLOEXEC == 0, as Gnulib no longer sets it to 0.

7 years agoAllow use of run-time OS version checks on macOS (bug#27810)
Alan Third [Thu, 6 Jul 2017 22:10:49 +0000 (23:10 +0100)]
Allow use of run-time OS version checks on macOS (bug#27810)

* src/nsterm.h (NSWindowTabbingMode): Define in pre-Sierra macOS.
(MAC_OS_X_VERSION_10_6, MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8,
MAC_OS_X_VERSION_10_9, MAC_OS_X_VERSION_10_12, HAVE_NATIVE_FS): Remove
defines.
(NSWindowStyleMaskFullScreen,
NSWindowCollectionBehaviorFullScreenPrimary,
NSApplicationPresentationFullScreen,
NSApplicationPresentationAutoHideToolbar): Define in macOS 10.6.
* src/nsterm.m (colorForEmacsRed, colorUsingDefaultColorSpace,
check_native_fs, ns_read_socket, ns_select, runAlertPanel,
initFrameFromEmacs, windowDidMiniaturize, windowDidEnterFullScreen,
windowDidExitFullScreen, isFullscreen, updateCollectionBehavior,
toggleFullScreen, constrainFrameRect, scrollerWidth, syms_of_nsterm):
Allow use of run-time checks and replace version check macros.
* src/nsfns.m (ns_screen_name): Use run-time OS version checks.
* src/macfont.m (macfont_draw): Use run-time OS version checks.
* src/nsmenu.m (menuWillOpen): Use run-time OS version checks.

Co-authored-by: Charles A. Roelli <charles@aurox.ch>
7 years agoAdd multiframe image support to NS port (bug#21714)
Alan Third [Sun, 13 Aug 2017 00:47:05 +0000 (01:47 +0100)]
Add multiframe image support to NS port (bug#21714)

* src/nsimage.m (ns_load_image): Handle multiple frames.
(EmacsImage::getMetadata, EmacsImage::setFrame): New functions.
* src/nsterm.h (EmacsImage::getMetadata, EmacsImage::setFrame): New
function prototypes.

7 years agofiles-tests.el: Remove unused lexical variable
Tino Calancha [Wed, 16 Aug 2017 11:14:48 +0000 (20:14 +0900)]
files-tests.el: Remove unused lexical variable

* test/lisp/files-tests.el (file-test--do-local-variables-test);
Remove unused var 'files-test-queried'.

7 years ago* doc/emacs/files.texi (Copying and Naming): Mention
Michael Albinus [Wed, 16 Aug 2017 10:11:37 +0000 (12:11 +0200)]
* doc/emacs/files.texi (Copying and Naming): Mention

restrictions to add-name-to-file and make-symbolic-link on
remote systems.

7 years ago* lisp/net/ange-ftp.el (ange-ftp-skip-msgs): Further support ftp-ssl.
Michael Albinus [Wed, 16 Aug 2017 09:52:12 +0000 (11:52 +0200)]
* lisp/net/ange-ftp.el (ange-ftp-skip-msgs): Further support ftp-ssl.

7 years agoAdd tests for previous commit
Noam Postavsky [Thu, 20 Jul 2017 02:06:02 +0000 (22:06 -0400)]
Add tests for previous commit

* test/lisp/progmodes/elisp-mode-tests.el
(elisp-mode-tests--face-propertized-string): New function.
(elisp--highlight-function-argument-indexed)
(elisp--highlight-function-argument-keyed-1)
(elisp--highlight-function-argument-keyed-2): New tests.

7 years agoFix eldoc highlighting for &key args (Bug#27272)
Thierry Volpiatto [Thu, 15 Jun 2017 03:26:05 +0000 (05:26 +0200)]
Fix eldoc highlighting for &key args (Bug#27272)

* lisp/progmodes/elisp-mode.el (elisp--highlight-function-argument):
Only switch to keyword-based searching if INDEX point beyond `&key' in
the argument list.  All arguments prior to the `&key' are position
based.  Additionally, be more strict about what is a keyword when
searching for the current keyword.

7 years agoDo not assume regular Git .git/hooks dir
Paul Eggert [Tue, 15 Aug 2017 20:31:03 +0000 (13:31 -0700)]
Do not assume regular Git .git/hooks dir

Apparently Gitlab doesn’t create .git/hooks, like regular Git does.
Problem reported by Ted Zlatanov in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00380.html
* autogen.sh (git_sample_hook_src): New function.  Use it to work
even if .git/hooks or its samples do not exist.

7 years agoNew manual section "Copying and Naming"
Paul Eggert [Tue, 15 Aug 2017 17:06:44 +0000 (10:06 -0700)]
New manual section "Copying and Naming"

* doc/emacs/files.texi (Copying and Naming):
New section, split off from Misc File Ops and containing the
operations that copy, name or rename files.  This fixes some
confusion caused by the incorrect phrase "The same rule applies
to all the remaining commands in this section" in the old manual.
This change does not affect the confusion about directories (see
Bug#27986 for ongoing discussion).

7 years agoFix the MS-Windows build
Eli Zaretskii [Tue, 15 Aug 2017 16:17:41 +0000 (19:17 +0300)]
Fix the MS-Windows build

* src/fileio.c (Frename_file): Don't use ENOTSUP if it is equal to
ENOSYS.  (Bug#28097)  (Bug#27986)

7 years ago* .gitlab-ci.yml: run "autogen.sh autoconf" to avoid Git.
Ted Zlatanov [Tue, 15 Aug 2017 14:07:42 +0000 (10:07 -0400)]
* .gitlab-ci.yml: run "autogen.sh autoconf" to avoid Git.

7 years ago* .gitlab-ci.yml: add Git to the installed packages.
Ted Zlatanov [Tue, 15 Aug 2017 13:59:45 +0000 (09:59 -0400)]
* .gitlab-ci.yml: add Git to the installed packages.

7 years agoSupport indentation of detached Less CSS rulesets
Simen Heggestøyl [Tue, 15 Aug 2017 10:39:42 +0000 (12:39 +0200)]
Support indentation of detached Less CSS rulesets

* lisp/textmodes/css-mode.el (css-smie-rules): Provide better support
for indentation of detached rulesets passed to Less mixins.

* test/manual/indent/less-css-mode.less: New file.

7 years agoFixes and tweaks for the new Less CSS mode
Simen Heggestøyl [Tue, 1 Aug 2017 18:23:21 +0000 (20:23 +0200)]
Fixes and tweaks for the new Less CSS mode

* etc/NEWS: Add an entry for the new mode.

* lisp/textmodes/less-css-mode.el (less-css): Tweak docstring.
(less-css-lessc-command): Tweak docstring. Don't mark it as
safe. Don't autoload.
(less-css-compile-at-save, less-css-lessc-options)
(less-css-output-directory): Tweak docstrings. Don't autoload.
(less-css-output-file-name): Tweak docstring. Don't mark it as safe.
(less-css-input-file-name): Tweak docstring. Don't autoload.
(less-css-compile-maybe): Use `when' for one-armed `if'.
(less-css--output-path): Tweak docstring.
(less-css--maybe-shell-quote-command): Remove function.
(less-css-compile): Don't autoload. Tweak docstring and message. Fix
compiler warning. Use `string-join' instead of `mapconcat'.
(less-css-font-lock-keywords): Use `font-lock-variable-name-face' for
variables.
(less-css-mode-syntax-table, less-css-mode-map): New variables.
(less-css-mode): Change status line mode name from "LESS" to
"Less". Tweak docstring. Move syntax table definitions to
`less-css-mode-syntax-table'.
(less-css-indent-line): Remove function.

7 years agoNew major mode: Less CSS mode
Steve Purcell [Tue, 1 Aug 2017 18:15:45 +0000 (20:15 +0200)]
New major mode: Less CSS mode

* lisp/textmodes/less-css-mode.el: New file.

7 years agoarchive-int-to-mode: Fix order of testing S_ISUID, S_ISGID bits
Tino Calancha [Tue, 15 Aug 2017 06:43:16 +0000 (15:43 +0900)]
archive-int-to-mode: Fix order of testing S_ISUID, S_ISGID bits

* lisp/arc-mode.el (archive-int-to-mode):
Swap order of 2048 and 1024 tests (Bug#28092).
* test/lisp/arc-mode-tests.el (arc-mode-test-archive-int-to-mode):
Update test.

7 years agoImprove rename-file port to macOS
Paul Eggert [Tue, 15 Aug 2017 01:16:04 +0000 (18:16 -0700)]
Improve rename-file port to macOS

* src/fileio.c (Frename_file): On macOS, renameat_noreplace can
fail with errno == ENOTSUP on file systems where it is not
supported, according to the Apple documentation.

7 years agoSpeed up ./configure with more caching (Bug#27960)
Noam Postavsky [Sun, 9 Apr 2017 00:58:20 +0000 (20:58 -0400)]
Speed up ./configure with more caching (Bug#27960)

* configure.ac: Cache the 'GTK compiles', 'GSettings is in gio',
'LN_S', '-znocombreloc', 'sysinfo', 'gcc autodepends', '-b link',
'Xkb', 'Xpm preprocessor', 'tputs library' 'GLib', 'signals via
characters', and 'Windows API header' checks.  Remove pause after
warning about GTK bug.

7 years agoImprove rename-file behavior on macOS
Paul Eggert [Mon, 14 Aug 2017 22:25:13 +0000 (15:25 -0700)]
Improve rename-file behavior on macOS

Problem reported by Philipp Stephani (Bug#27986).
* src/fileio.c (Frename_file):
Worry about file name case sensitivity only if CYGWIN or DOS_NT.
* src/sysdep.c (renameat_noreplace): Use renameatx_np on macOS,
since this provides the necessary atomicity guarantees.

7 years agoClean up temp files after some tests
Glenn Morris [Mon, 14 Aug 2017 21:23:18 +0000 (17:23 -0400)]
Clean up temp files after some tests

* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--with-temp-file): Also delete .elc file if present.
* test/lisp/progmodes/etags-tests.el
(etags-buffer-local-tags-table-list): Delete temp file at end.

7 years agoImplement renameat_noreplace for MS-Windows
Eli Zaretskii [Mon, 14 Aug 2017 16:31:12 +0000 (19:31 +0300)]
Implement renameat_noreplace for MS-Windows

* src/sysdep.c (renameat_noreplace) [WINDOWSNT]: Implement minimal
emulation for MS-Windows.  (Bug#27986)

7 years agoFix 'rename' on MS-Windows
Eli Zaretskii [Mon, 14 Aug 2017 16:17:22 +0000 (19:17 +0300)]
Fix 'rename' on MS-Windows

* src/w32.c (sys_rename_replace): Use the FORCE argument only if
the primitive rename errors out with EEXIST.

7 years ago* lisp/net/ange-ftp.el (ange-ftp-skip-msgs): Support ftp-ssl.
Michael Albinus [Mon, 14 Aug 2017 16:05:58 +0000 (18:05 +0200)]
* lisp/net/ange-ftp.el (ange-ftp-skip-msgs): Support ftp-ssl.

7 years agoTiny JSON performance improvement
Mark Oteiza [Mon, 14 Aug 2017 05:54:11 +0000 (01:54 -0400)]
Tiny JSON performance improvement

Get rid of some needless uses of apply.  Measuring with
  (benchmark-run 10 (json-read-file "test.json"))
showed 1.5-2.5% reduction of execution time.
* lisp/json.el (json-peek): Nix let-binding.
(json-read-string): Use concat for making a string from chars.
(json-read-array): Use cond and more appropriate conversion instead
of blindly applying.

7 years agoBe consistent in spelling 'ok-if-already-exists'.
Paul Eggert [Sun, 13 Aug 2017 18:54:46 +0000 (11:54 -0700)]
Be consistent in spelling 'ok-if-already-exists'.

7 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sun, 13 Aug 2017 15:58:24 +0000 (18:58 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

7 years agoUse 'header-line-highlight' face in proced and erc
Alexander Gramiak [Sun, 13 Aug 2017 14:56:31 +0000 (17:56 +0300)]
Use 'header-line-highlight' face in proced and erc

* lisp/erc/erc-list.el (erc-list-button):
* lisp/proced.el (proced-format): Use the 'header-line-highlight
face.  (Bug#28033)

7 years agoRemove feeds with dead uris from newsticker--raw-url-list-defaults
Ulf Jasper [Sun, 13 Aug 2017 14:50:19 +0000 (16:50 +0200)]
Remove feeds with dead uris from newsticker--raw-url-list-defaults

* lisp/net/newst-backend.el (newsticker--raw-url-list-defaults):
  Remove feeds with dead uris.

7 years agoFix vertical cursor motion when cursor is on the fringe
Eli Zaretskii [Sun, 13 Aug 2017 14:53:48 +0000 (17:53 +0300)]
Fix vertical cursor motion when cursor is on the fringe

* lisp/simple.el (line-move-visual): Fix an off-by-one error in
setting temporary-goal-column when newline overflows into the
fringe.  Support that use case in R2L paragraphs as well.

7 years agoFix vertical cursor motion across too wide images
Eli Zaretskii [Sun, 13 Aug 2017 14:49:07 +0000 (17:49 +0300)]
Fix vertical cursor motion across too wide images

* src/indent.c (Fvertical_motion): If lines are truncated and we
end up beyond the right margin of the window, don't assume we are
in the next screen line, unless VPOS actually says so.  (Bug#28071)

7 years agoAdd test suites for arc-mode and tar-mode
Tino Calancha [Sun, 13 Aug 2017 14:41:01 +0000 (23:41 +0900)]
Add test suites for arc-mode and tar-mode

* test/lisp/arc-mode-tests.el (arc-mode-test-archive-int-to-mode)
* test/lisp/tar-mode-tests.el (tar-mode-test-tar-grind-file-mode):
New tests.

7 years ago* lisp/tar-mode.el (tar-grind-file-mode): Fix docstring
Tino Calancha [Sun, 13 Aug 2017 14:38:29 +0000 (23:38 +0900)]
* lisp/tar-mode.el (tar-grind-file-mode): Fix docstring

7 years agoFix uri of Emacs Wiki
Ulf Jasper [Sun, 13 Aug 2017 14:26:31 +0000 (16:26 +0200)]
Fix uri of Emacs Wiki

* lisp/net/newst-backend.el (newsticker--raw-url-list-defaults): Fix
  uri of Emacs Wiki.  (Bug#27981)

7 years ago; Do not mention ange-ftp-lovers ML in ange-ftp.el (Bug#28075)
Michael Albinus [Sun, 13 Aug 2017 08:45:22 +0000 (10:45 +0200)]
; Do not mention ange-ftp-lovers ML in ange-ftp.el (Bug#28075)

7 years agoFix make-temp-file bug with ""/"."/".." prefix
Paul Eggert [Sun, 13 Aug 2017 03:04:43 +0000 (20:04 -0700)]
Fix make-temp-file bug with ""/"."/".." prefix

The bug with "." and ".." has been present for a while; I
introduced the bug with "" earlier today in my patch for Bug#28023.
* lisp/files.el (make-temp-file): Do not use expand-file-name if
PREFIX is empty or "." or "..", as it does the wrong thing.
Compute absolute-prefix here ...
(files--make-magic-temp-file): ... instead of here ...
* src/fileio.c (Fmake_temp_file_internal): ... or here.

* lisp/files.el (make-temp-file): If the prefix is empty, append
"/" to the absolute prefix so that the new files are children
rather than siblings of temporary-file-directory.  This fixes a
bug introduced in the previous change.
* test/lisp/files-tests.el (files-test-make-temp-file-empty-prefix):
New test, for the bug.

7 years agoImprove make-temp-file performance on local files
Paul Eggert [Sat, 12 Aug 2017 21:00:17 +0000 (14:00 -0700)]
Improve make-temp-file performance on local files

For the motivation behind this patch, please see Bug#28023 and:
http://emacshorrors.com/posts/make-temp-name.html
Although, given the recent changes to Tramp, the related security
problem in make-temp-file is already fixed, make-temp-file still has
several unnecessary system calls.  In the typical case on GNU/Linux,
this patch replaces 8 syscalls (symlink, open, close, readlinkat, uname,
getpid, unlink, umask) by 2 (open, close).
* admin/merge-gnulib (GNULIB_MODULES): Add tempname, now
that Emacs is using it directly.
* configure.ac (AUTO_DEPEND): Remove AC_SYS_LONG_FILE_NAMES;
no longer needed.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lisp/files.el (files--make-magic-temp-file): Rename from
make-temp-file.
(make-temp-file): Use make-temp-file-internal for
non-magic file names.
* src/fileio.c: Include tempname.h.
(make_temp_name_tbl, make_temp_name_count)
(make_temp_name_count_initialized_p, make_temp_name): Remove.
(Fmake_temp_file_internal): New function.
(Fmake_temp_name): Use it.
* src/filelock.c (get_boot_time): Use Fmake_temp_file_internal
instead of make_temp_name.

7 years agoDocument internal-use naming conventions
Paul Eggert [Sat, 12 Aug 2017 17:54:32 +0000 (10:54 -0700)]
Document internal-use naming conventions

* doc/lispref/functions.texi (Function Names):
* doc/lispref/variables.texi (Tips for Defining):
Document naming conventions for internal-use functions and vars.
See Bug#28023#59.

7 years agoSimplify re and document 'autoconf.sh all'
Paul Eggert [Sat, 12 Aug 2017 16:06:55 +0000 (09:06 -0700)]
Simplify re and document 'autoconf.sh all'

* GNUmakefile (ALL_IF_GIT): Remove; no longer needed, now that
./autogen.sh defaults to "all".  All uses removed.
* README: Mention autoconf.sh's effect on Git configuration.

7 years agoDefault autogen.sh to 'all'
Paul Eggert [Sat, 12 Aug 2017 15:56:52 +0000 (08:56 -0700)]
Default autogen.sh to 'all'

This addresses a problem noted by RMS in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html
* autogen.sh (do_git): Set to true if this script is invoked
with no arguments and there is a .git subdirectory.

7 years agoAdjust jka-compr to recent Tramp changes.
Paul Eggert [Sat, 12 Aug 2017 15:52:25 +0000 (08:52 -0700)]
Adjust jka-compr to recent Tramp changes.

* lisp/jka-compr.el (jka-compr-write-region):
Two new args LOCKNAME and MUSTBENEW.

7 years agoImprove doc strings of 2 functions in simple.el
Eli Zaretskii [Sat, 12 Aug 2017 12:11:16 +0000 (15:11 +0300)]
Improve doc strings of 2 functions in simple.el

* lisp/simple.el (beginning-of-visual-line)
(move-beginning-of-line): Doc fix.  Reported by
Justin Burkett <justin@burkett.cc>.

7 years agoFix completion on directory names on MS-DOS/MS-Windows
Eli Zaretskii [Sat, 12 Aug 2017 11:44:20 +0000 (14:44 +0300)]
Fix completion on directory names on MS-DOS/MS-Windows

* src/msdos.c (faccessat):
* src/w32.c (faccessat): Support relative file names, and add D_OK
to 'mode' if the argument is a directory.  This unbreaks file-name
completion when the completion result is a directory.

7 years agoImplement EXCL of write-region for Tramp
Michael Albinus [Sat, 12 Aug 2017 10:30:39 +0000 (12:30 +0200)]
Implement EXCL of write-region for Tramp

* lisp/net/ange-ftp.el (ange-ftp-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region)
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region)
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
Implement MUSTBENEW.

* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file)
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-sh-handle-add-name-to-file)
(tramp-do-copy-or-rename-file)
* lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link):
Adapt error message for `file-already-exists'.

* src/lisp.h:
* src/eval.c (call8): New function.

* src/fileio.c (write_region): Pass also lockname and
mustbenew to the file name handler.

* test/lisp/net/tramp-tests.el (tramp-test10-write-region):
Add tests for MUSTBENEW.

7 years agoAdapt Proced display to display-line-numbers
Eli Zaretskii [Sat, 12 Aug 2017 10:18:13 +0000 (13:18 +0300)]
Adapt Proced display to display-line-numbers

* lisp/proced.el (proced-header-line): Account for the width taken
by display-line-numbers.  (Bug#27895)

7 years agoAdapt tabulated list when display-line-number is turned on
Eli Zaretskii [Sat, 12 Aug 2017 09:45:05 +0000 (12:45 +0300)]
Adapt tabulated list when display-line-number is turned on

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Add
a hook to revert the display when display-line-numbers is turned
on.  (Bug#27895)

7 years agoUse Gnulib 'tempname' on MS-Windows
Eli Zaretskii [Sat, 12 Aug 2017 08:29:37 +0000 (11:29 +0300)]
Use Gnulib 'tempname' on MS-Windows

* lib-src/ntlib.h (mkdir, open): Remove redefinitions.  They are
now in nt/inc/ms-w32.h.
* lib-src/ntlib.c (sys_mkdir, sys_open): New functions.
(mkostemp): Remove.

* src/w32.c (mkostemp): Remove.
(sys_mkdir): Accept a second (unused) argument.
* src/fileio.c (Fmake_directory_internal): Remove the WINDOWSNT
specific call to mkdir.  (Bug#28023)

* nt/inc/ms-w32.h (mkdir): Remove from "#ifdef emacs" and redefine
to accept 2 arguments.
(open): Remove from "#ifdef emacs".
* nt/mingw-cfg.site (ac_cv_func_mkostemp): Remove.
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_mkostemp)
(OMIT_GNULIB_MODULE_tempname): Remove.

7 years agoAdd new face 'header-line-highlight'
Alexander Gramiak [Sat, 12 Aug 2017 07:12:36 +0000 (10:12 +0300)]
Add new face 'header-line-highlight'

* lisp/faces.el: Define the face.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
* lisp/info.el (Info-fontify-node): Use the new face.
* doc/emacs/display.texi (Standard Faces):
* etc/NEWS: Document the new face.  (Bug#28033)

7 years agoMake a case-sensitive match for strings
Arash Esbati [Fri, 11 Aug 2017 21:57:35 +0000 (23:57 +0200)]
Make a case-sensitive match for strings

* lisp/textmodes/reftex.el (reftex-typekey-check): Temporarily
let-bind `case-fold-search' to nil in order to be case-sensitive
when matching a string.  (Bug#27518)

7 years agoFix a minor todo-mode regression
Stephen Berman [Fri, 11 Aug 2017 09:28:57 +0000 (11:28 +0200)]
Fix a minor todo-mode regression

* lisp/calendar/todo-mode.el (todo-get-overlay): Wrap in
save-excursion.  This fixes a regression introduced by the fix
for bug#27609, whereby trying to raise the priority of the
first item or lower the priority of the last item, which
should be noops, moves point to the item's start.  Clarify
comment.

* test/lisp/calendar/todo-mode-tests.el
(todo-test-raise-lower-priority): Add test cases for trying to
raise first item and lower last item.
(with-todo-test): Clear abbreviated-home-dir, since we change HOME.
(todo-test-toggle-item-header02): Remove ":expected-result
:failed" and tests of point after todo-next-item, since the
effect when using Todo mode is not reproducible in the test
environment.  Add commentary about this.

7 years agoImprove performance for rename-file etc.
Paul Eggert [Fri, 11 Aug 2017 08:04:30 +0000 (01:04 -0700)]
Improve performance for rename-file etc.

Although this does not fix Bug#27986, it is a step forward.
I plan to propose a more-significant patch later.
* lisp/files.el (directory-name-p): Move from here ...
* src/fileio.c (Fdirectory_name_p): ... to here.
(directory_like, cp_like_target): New static functions.
(Fcopy_file, Frename_file, Fadd_name_to_file)
(Fmake_symbolic_link):
Use them, to avoid directory-testing syscalls on file names that
must be directories if they exist.  Omit unnecessary
initializations and CHECK_STRING calls.
(Frename_file): Don't call file_name_case_insensitive_p
twice on the same file.  Compare both file names expanded, instead
of the old name expanded and the new one unexpanded.

7 years agoRespect buffer-local value of tags-table-list (Bug#27772)
Noam Postavsky [Mon, 7 Aug 2017 01:35:04 +0000 (21:35 -0400)]
Respect buffer-local value of tags-table-list (Bug#27772)

* lisp/progmodes/etags.el (visit-tags-table-buffer): Save the current
buffer around the `tags-table-including' calls so as to get buffer
local variables from the right buffer later.
* test/lisp/progmodes/etags-tests.el (etags-visit-tags-table-buffer):
New test.
* test/lisp/progmodes/etags-tests.el (etags-tests--test-dir): New
constant.
(etags-bug-158, etags-bug-23164): Use it so that when running the test
interactively, setting EMACS_TEST_DIRECTORY is not needed.

7 years agoFix auto-filling regression
Tom Tromey [Wed, 9 Aug 2017 22:06:23 +0000 (16:06 -0600)]
Fix auto-filling regression

Bug#28003
* lisp/newcomment.el (comment-indent-new-line): Check
comment-auto-fill-only-comments.  Reverts earlier change.
* lisp/simple.el (internal-auto-fill): Call auto-fill-function, not
do-auto-fill.

7 years agoMerge from gnulib
Paul Eggert [Wed, 9 Aug 2017 18:38:04 +0000 (11:38 -0700)]
Merge from gnulib

This incorporates:
2017-08-09 tempname: do not depend on secure_getenv
2017-08-08 extensions: add _OPENBSD_SOURCE
2017-08-06 manywarnings: Add support for C++
2017-08-06 warnings, manywarnings: Add support for multiple languages
* admin/merge-gnulib: Don't use m4/manywarnings-c++.m4.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/secure_getenv.c, m4/secure_getenv.m4: Remove.
* lib/tempname.c, m4/extensions.m4, m4/manywarnings.m4, m4/warnings.m4:
Copy from gnulib.

7 years agoFix crashing emacs-module tests on MS-Windows
Eli Zaretskii [Wed, 9 Aug 2017 17:15:46 +0000 (20:15 +0300)]
Fix crashing emacs-module tests on MS-Windows

* src/w32fns.c (syms_of_w32fns) <w32-disable-abort-dialog>: New
variable.
(emacs_abort): If w32-disable-abort-dialog is non-nil, abort right
away, without displaying the Abort dialog, which waits for the user.

* test/src/emacs-module-tests.el (module--test-assertion): Run the
inferior Emacs with the w32 abort dialog disabled.  Expect the
status of the aborted Emacs sub-process to be 3 on MS-Windows and
2 on MS-DOS.

7 years agodired-delete-file: Dont't ask for empty dirs
Tino Calancha [Wed, 9 Aug 2017 05:47:15 +0000 (14:47 +0900)]
dired-delete-file:  Dont't ask for empty dirs

* lisp/dired.el (dired--yes-no-all-quit-help): New defun.
(dired-delete-file): Use it.  Dont't ask for empty dirs (Bug#27940).

* test/lisp/dired-tests.el (dired-test-with-temp-dirs):
New auxiliar macro.
(dired-test-bug27940): Add new test.

7 years agoAsk files for deletion in buffer order: top first, botton later
Tino Calancha [Wed, 9 Aug 2017 05:37:21 +0000 (14:37 +0900)]
Ask files for deletion in buffer order: top first, botton later

* lisp/dired.el (dired-do-flagged-delete, dired-do-delete):
Call `nreverse' t invert the output of `dired-map-over-marks'.

7 years agoUse help-mode xrefs in describe-font
Alexander Gramiak [Sat, 5 Aug 2017 22:09:54 +0000 (16:09 -0600)]
Use help-mode xrefs in describe-font

* lisp/international/mule-diag.el (describe-font): Use help-setup-xref
(Bug#27890).

7 years agoDon't try to jump to non-existent part (bug#28013)
Katsumi Yamaoka [Tue, 8 Aug 2017 23:40:27 +0000 (23:40 +0000)]
Don't try to jump to non-existent part (bug#28013)

* lisp/gnus/gnus-art.el (gnus-article-edit-part): Don't try to jump to
the next part if there is the only one part in the article (bug#28013).

7 years agoReplace some uses of eval
Mark Oteiza [Tue, 8 Aug 2017 19:10:49 +0000 (15:10 -0400)]
Replace some uses of eval

There are a number of places where eval is used unnecessarily to get
or set the value of a symbol.
* lisp/calendar/calendar.el (diary-date-forms): Use default-value in
custom setter.
* lisp/desktop.el (desktop-clear): Use set-default instead.
* lisp/international/ogonek.el (ogonek-read-encoding): Use
symbol-value.

7 years agoConvert uses of looking-at in viper-ex to following-char
Mark Oteiza [Tue, 8 Aug 2017 19:00:21 +0000 (15:00 -0400)]
Convert uses of looking-at in viper-ex to following-char

* lisp/emulation/viper-ex.el (viper-get-ex-token): Bind
(following-char) and use it in the subsequent cond's clauses.
(viper-ex, ex-quit, viper-get-ex-file): Use following-char instead.
Convert single branch ifs to when

7 years agoSome cleanup in message.el
Mark Oteiza [Tue, 8 Aug 2017 18:09:38 +0000 (14:09 -0400)]
Some cleanup in message.el

* lisp/gnus/message.el (message-cross-post-insert-note):
(message-strip-forbidden-properties): Mark unused args.
(message-canlock-generate): Remove extinct variable
sha1-maximum-internal-length.
(message-make-mail-followup-to): Use loop's thereis clause.

7 years agoDocument make-temp-name magic limitations
Paul Eggert [Tue, 8 Aug 2017 16:49:40 +0000 (09:49 -0700)]
Document make-temp-name magic limitations

* doc/lispref/files.texi (Unique File Names):
* src/fileio.c (Fmake_temp_name): Document that make-temp-name
does not guarantee uniqueness on magic file names.

7 years agoShow number of errors in compilation-mode mode-line
Tom Tromey [Sun, 5 Mar 2017 17:48:41 +0000 (10:48 -0700)]
Show number of errors in compilation-mode mode-line

Bug#25354
* lisp/progmodes/compile.el (compilation-num-errors-found): Provide
default value.
(compilation-num-warnings-found, compilation-num-infos-found): New
defvars.
(compilation-mode-line-errors): New defconst.
(compilation-face): Remove.
(compilation-type, compilation--note-type): New functions.
(compilation-parse-errors): Call compilation--note-type.
(compilation-start): Include compilation-mode-line-errors in
mode-line-process.
(compilation-setup): Initialize compilation-num-* variables to 0.
(compilation-handle-exit): Include compilation-mode-line-errors in
mode-line-process.
* doc/emacs/building.texi (Compilation): Document new feature.

7 years agoDo some cleanup in mailcap.el
Mark Oteiza [Tue, 8 Aug 2017 01:50:11 +0000 (21:50 -0400)]
Do some cleanup in mailcap.el

* lisp/net/mailcap.el: Use lexical-binding.
(mailcap--set-user-mime-data, mailcap-possible-viewers): Use pcase
destructuring.
(mailcap-mime-data): Remove some entries for ancient functions.
(mailcap-parse-mailcaps, mailcap-mime-info): Nix single-branch ifs.
(mailcap-parse-mimetype-file): Just use append.
(mailcap-command-p): Remove unused function.

7 years agoquery-replace: Undo replacements performed with 'comma
Tino Calancha [Tue, 8 Aug 2017 01:25:27 +0000 (10:25 +0900)]
query-replace: Undo replacements performed with 'comma

During a `query-replace', the char ',' replaces the character
at point and doesn't move point;  right after, the char 'u'
must undo such replacement (Bug#27268).
* lisp/replace.el (replace--push-stack):
New macro extracted from `perform-replace'.
(perform-replace): Use it.
* test/lisp/replace-tests.el (query-replace--undo): Add test.

7 years ago; Merge: Fixes for macroexpansion and compilation
Noam Postavsky [Tue, 8 Aug 2017 01:09:19 +0000 (21:09 -0400)]
; Merge: Fixes for macroexpansion and compilation

7 years agoDon't define gv expanders in compiler's runtime (Bug#27016)
Noam Postavsky [Thu, 13 Jul 2017 04:42:38 +0000 (00:42 -0400)]
Don't define gv expanders in compiler's runtime (Bug#27016)

This prevents definitions being compiled from leaking into the current
Emacs doing the compilation.
* lisp/emacs-lisp/gv.el (gv-define-expander): Use function-put instead
of `put' with `eval-and-compile'.
* test/lisp/emacs-lisp/gv-tests.el: New tests.

7 years agoLet the cl-typep effects of defclass work during compilation (Bug#27718)
Noam Postavsky [Fri, 4 Aug 2017 23:50:21 +0000 (19:50 -0400)]
Let the cl-typep effects of defclass work during compilation (Bug#27718)

* lisp/emacs-lisp/eieio.el (defclass): Use `define-symbol-prop'
instead of `put'.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-tests--dummy-function): Remove.
(eieio-test-25-slot-tests, eieio-test-23-inheritance-check): Don't
expect to fail if compiled.