1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-20 10:23:57 +00:00
Commit Graph

129170 Commits

Author SHA1 Message Date
Noam Postavsky
e7b6751c0a Fix lisp-indent-region and indent-sexp (Bug#26619)
The new lisp-indent-region introduced in 2017-04-22 "Add new
`lisp-indent-region' that doesn't reparse the code." is broken because
it doesn't save the calculated indent amounts for already seen sexp
depths.  Fix this by unifying the indent-sexp and lisp-indent-region
code.  Furthermore, only preserve position 2 of the running parse
when the depth doesn't change.
* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Use an OLDSTATE that
corresponds with the start point when calling parse-partial-sexp.
(lisp-indent-state): New struct.
(lisp-indent-calc-next): New function, extracted from indent-sexp.
(indent-sexp, lisp-indent-region): Use it.
(lisp-indent-line): Take indentation, instead of parse state.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-mode-tests--correctly-indented-sexp): New constant.
(lisp-indent-region, lisp-indent-region-defun-with-docstring):
(lisp-indent-region-open-paren, lisp-indent-region-in-sexp): New
tests.
2017-05-09 20:50:19 -04:00
Dmitry Gutov
17e540aa42 Simplify url-encode-url and add a test
* lisp/url/url-util.el (url-encode-url): Simplify.
url-generic-parse-url copes with multibyte strings just fine
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24117#185).

* test/lisp/url/url-parse-tests.el
(url-generic-parse-url/multibyte-host-and-path): New test.
2017-05-10 03:34:58 +03:00
Glenn Morris
58326f0f11 More informative error when required feature missing
* src/fns.c (Frequire): Include file name in missing feature error.
* doc/lispref/loading.texi (Named Features): Don't quote actual error.
2017-05-09 19:47:16 -04:00
Glenn Morris
db30296bae Put re-loaded file back at start of load-history (bug#26837)
* src/lread.c (readevalloop): Fix the "whole buffer" check to
operate in the correct buffer.
(Feval_buffer): Move point back to the start after checking
for lexical binding.
* test/src/lread-tests.el (lread-test-bug26837): New test.
* test/data/somelib.el, test/data/somelib2.el: New test data files.
2017-05-09 19:44:09 -04:00
Glenn Morris
d6d5020c25 Don't duplicate autoload code in package.el
* lisp/emacs-lisp/autoload.el (autoload-rubric): Add a package option.
* lisp/emacs-lisp/package.el (autoload-rubric): Declare.
(package-autoload-ensure-default-file): Use autoload-rubric.
2017-05-09 13:03:04 -04:00
Michael Albinus
4c08509b3a * test/lisp/net/tramp-tests.el: Keep additional test. 2017-05-09 14:35:56 +02:00
Noam Postavsky
daaec72a82 Revert "Output number of characters added to file (Bug#354)"
The extra message text turned out to be quite annoying in practice,
and is generally more trouble than it's worth.  Also revert several
related changes.

Partially revert "Handle `write-region' messages in Tramp properly"
Revert "New var write-region-verbose, default nil"
Revert "* src/fileio.c (write_region): Don't say "1 characters".  (Bug#26796)"
Revert "Minor tuneup of write-region change"
Revert "Adjust write-region so file name is at the beginning again"
Revert "Fix handling of non-integer START param to write-region"
Revert "Output number of characters added to file (Bug#354)"

* doc/emacs/files.texi (Misc File Ops):
* etc/NEWS:
* lisp/epa-file.el (epa-file-write-region):
* lisp/gnus/mm-util.el (mm-append-to-file):
* lisp/jka-compr.el (jka-compr-write-region):
* 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):
* lisp/net/tramp.el (tramp-handle-write-region-message):
* src/fileio.c (write_region, syms_of_fileio):
* test/lisp/net/tramp-tests.el (tramp-test10-write-region): Remove
extra characters from file writing messages.
2017-05-08 23:28:32 -04:00
Ken Brown
5e2cf8c804 Skip a test from filenotify-tests.el on Cygwin
* test/lisp/filenotify-tests.el (file-notify-test02-rm-watch):
Skip the last part of the test on Cygwin; it fails due to timing
issues.
(file-notify--test-read-event):  Remove `sit-for' that was added
for Cygwin.
2017-05-08 15:11:23 -04:00
Paul Eggert
7ff7624a7a Merge from gnulib
This incorporates:
2017-05-08 intprops: don’t depend on ‘verify’
2017-05-07 utimens: on native Windows, improve resolution if fd < 0
2017-05-07 utimens: Improve error code on native Windows
* lib/intprops.h, lib/utimens.c: Copy from gnulib.
2017-05-08 10:49:12 -07:00
Wilson Snyder
e93f39d2e6 Fix various verilog-mode.el issues.
* lisp/progmodes/verilog-mode.el (verilog-read-decls): Fix SystemVerilog
2012 import breaking AUTOINST.  Reported by Johannes Schaefer.
(verilog-auto-wire-type, verilog-insert-definition): Fix AUTOWIRE using
logic in top-level non-SystemVerilog module, bug1142.  Reported by Marcin K.
(verilog-define-abbrev-table) (verilog-mode-abbrev-table): Don't expand
abbrev inside comment/strings, bug1102. Reported by Slava Yuzhaninov.
(verilog-auto): Fix AUTORESET widths pulling from AUTOREGINPUT,
msg2143. Reported by Galen Seitz.
(verilog-modify-compile-command): Fix expansion of __FLAGS__ when
compile-command is globally set, bug1119.  Reported by Galen Seitz.
2017-05-08 13:44:47 -04:00
Michael Albinus
73e3ed48e2 Handle `write-region' messages in Tramp properly
* lisp/net/tramp.el (tramp-handle-write-region-message): New defsubst.
* 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): Use it.

* lisp/net/tramp.el (tramp-password-prompt-regexp)
(tramp-completion-mode-p):
* lisp/net/tramp-cmds.el (tramp-reporter-dump-variable)
(tramp-append-tramp-buffers):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
Use `bound-and-true-p'.

* lisp/net/tramp-compat.el (tramp-compat-delete-file):
Don't check for `boundp' anymore.

* test/lisp/net/tramp-tests.el (ert-x): Require it.
(tramp--test-messages): New defvar.
(tramp-test10-write-region): Extend test.
2017-05-08 17:27:50 +02:00
YAMAMOTO Mitsuharu
52f7440b8e Fix glyph string generation for multi-font compositions (Bug#26742)
* src/xdisp.c (glyph_string_containing_background_width): New function.
(draw_glyphs): Use it to get correct background width.
(compute_overhangs_and_x): Don't change x in the middle of composite
characters.
2017-05-08 08:20:53 +09:00
Philipp Stephani
3c4c8ca06e Fix all unescaped character literals 2017-05-07 13:22:34 +02:00
Alan Mackenzie
bcbd8f7e4e CC Mode internal cache: Handle a cache pos being inside a two-char construct.
Cache c-state-semi-nonlit-pos-cache was failing when a cache position was,
e.g., between the two characters of an opening comment "/*", and additionally
there were an odd number of quote marks (apostrophes) in the comment.  This
happened in .../src/xdisp.c in the Emacs master branch around 2017-05-02 at
buffer position 615001.

* lisp/progmodes/cc-defs.el (c-emacs-features): Repurpose symbol
pps-extended-state to mean that there are at least 11 elements in the parser
state.

* lisp/progmodes/cc-engine.el (c-cache-to-parse-ps-state)
(c-parse-ps-state-to-cache): Rewrite these to use enhanced cache element list
types which indicate potentially being inside two-char constructs.
(c-parse-ps-state-below): Rewrite to use the new versions of the above two
functions.
2017-05-07 09:27:00 +00:00
Glenn Morris
55b07d3379 ; Update contributor name
; Ref http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00114.html
2017-05-06 18:38:18 -07:00
Paul Eggert
723b16a875 ; Spelling fixes 2017-05-06 18:30:14 -07:00
Glenn Morris
09d750fcb6 Silence an mh-compat compiler warning
* lisp/mh-e/mh-compat.el (mh-url-unreserved-chars): Always define.
2017-05-06 18:21:04 -07:00
Glenn Morris
1f8036a522 Evaluate mh-require when compiling
* lisp/mh-e/mh-alias.el, lisp/mh-e/mh-folder.el:
* lisp/mh-e/mh-gnus.el, lisp/mh-e/mh-search.el:
Evaluate mh-require when compiling, as require is automatically.
* lisp/mh-e/mh-gnus.el: No longer disable byte-compilation.
2017-05-06 18:20:21 -07:00
Glenn Morris
233cfb0ea9 Remove obsolete method of changing byte-compile-dest-file
* lisp/emacs-lisp/bytecomp.el (byte-compile-dest-file):
Define unconditionally.
2017-05-06 18:06:17 -07:00
Paul Eggert
c311b8b15e New var write-region-verbose, default nil
By popular demand, write-region char counts are now off by default
(Bug#26796).
* src/fileio.c (write-region-verbose): New Lisp var.
(write_region): Output char count only if the var is non-nil.
* doc/emacs/files.texi (Misc File Ops), etc/NEWS: Document this.
2017-05-06 18:05:25 -07:00
Glenn Morris
7f3d63908c Write autoloads file atomically
* lisp/emacs-lisp/autoload.el (autoload--save-buffer):
New function, to save buffer atomically.
(autoload-save-buffers, update-directory-autoloads):
Use autoload--save-buffer.
* lisp/Makefile.in ($(lisp)/loaddefs.el):
No longer write to a temp file by hand.
2017-05-06 17:58:20 -07:00
Glenn Morris
03d941982f Write autoloads file once only
* lisp/emacs-lisp/autoload.el (autoload-find-generated-file):
Simplify.  Don't bother about ensuring the output file exists.
(autoload-generated-file): Add doc.
(autoload-ensure-writable): Update doc.
(autoload-ensure-file-writeable): Handle non-existing file.
(autoload-ensure-default-file): Remove function.
2017-05-06 17:07:10 -07:00
Paul Eggert
f31689c803 Port .gdbinit to GDB 7.11.1 + Python 2.7.12
* src/.gdbinit (Lisp_Object_Printer.to_string):
Explicitly convert integer val to 'int', so that
older GDBs do not complain about the conversion.
* src/lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]:
Give the struct a tag, so that older GDB pretty-printers have a
tag to hang their hat on.
2017-05-06 15:33:16 -07:00
Paul Eggert
7cd7f5b403 Pretty-print const Lisp_Objects in .gdbinit
* src/.gdbinit (Emacs_Pretty_Printers.__call__):
Compare unqualified type to Lisp_Object, to do the right thing
when the expression has type ‘Lisp_Object const’.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html
2017-05-06 14:25:13 -07:00
Paul Eggert
0a13c72513 Pacify GCC setjmp/longjmp warning
* src/eval.c (internal_lisp_condition_case): Do not modify local
var VAR, to pacify GCC’s setjmp/longjmp warning which in some
cases mistakenly diagnoses VAR possibly being modified between a
setjmp and a longjmp.
2017-05-06 14:25:13 -07:00
Philipp
cea3b22bc7 Fix bootstrap build of files.el
* lisp/files.el (file-name-non-special): Don't use cl-letf.
2017-05-06 23:23:45 +02:00
Noam Postavsky
5772b920f4 ; INSTALL.REPO: Mention cases that 'make bootstrap' can't handle (Bug#26246). 2017-05-06 16:28:54 -04:00
Eli Zaretskii
b104d76421 ; Fix last change
* test/src/emacs-module-tests.el (module-function-object): Fix thinko
in last change.
2017-05-06 23:23:36 +03:00
Eli Zaretskii
89b5a82833 Fix last change for MS-Windows
* test/src/emacs-module-tests.el (module-function-object): Port to
MS-Windows.
2017-05-06 23:00:34 +03:00
Eli Zaretskii
1784ce6080 ; * src/alloc.c (make_module_function): Avoid compiler warning. 2017-05-06 22:54:45 +03:00
Philipp Stephani
a3e9694078 Introduce new misc type for module function
This resolves a couple of FIXMEs in emacs-module.c.

* src/lisp.h (MODULE_FUNCTIONP, XMODULE_FUNCTION): New functions.

* src/alloc.c (make_module_function): New function.
(mark_object): GC support.

* src/data.c (Ftype_of, syms_of_data): Handle module function type.

* src/print.c (print_object): Print support for new type.

* src/emacs-module.c (module_make_function, Finternal_module_call):
Use new module function type, remove FIXMEs.
(module_format_fun_env): Adapt and give it external linkage.

* test/src/emacs-module-tests.el (module-function-object): Add unit
test.
2017-05-06 21:29:08 +02:00
Philipp Stephani
5e47c2e52b Fix quoted files for 'verify-visited-file-modtime'
Fixes Bug#25951.

* lisp/files.el (file-name-non-special): Set the file name for the
correct buffer.

* test/lisp/files-tests.el (files-tests--file-name-non-special--buffers):
Add unit test.
(files-tests--with-advice, files-tests--with-temp-file): New helper
macros.
2017-05-06 21:26:04 +02:00
Noam Postavsky
26c71bfe8c ; etc/NEWS: Fix default-frame-alist reference (Bug#26280). 2017-05-06 14:03:06 -04:00
Eli Zaretskii
6555f1abeb * src/fileio.c (write_region): Don't say "1 characters". (Bug#26796) 2017-05-06 13:39:36 +03:00
Eli Zaretskii
3472666f82 Turn on GC_CHECK_MARKED_OBJECTS by default under ENABLE_CHECKING
* src/alloc.c (GC_CHECK_MARKED_OBJECTS): Define to 1 by default of
ENABLE_CHECKING is defined.
(mark_object): Test for GC_CHECK_MARKED_OBJECTS being non-zero,
instead of being defined.
2017-05-06 11:22:44 +03:00
Eli Zaretskii
ff315081a1 ; * lisp/replace.el (query-replace-regexp, replace-regexp): Doc fixes. 2017-05-06 11:06:38 +03:00
Tom Tromey
927dcbd2e6 Fix erc-join with channel password
Bug#25349
* lisp/erc/erc-join.el (erc-autojoin-after-ident): Switch order of
server names.
(erc-autojoin-channels, erc-autojoin-add, erc-autojoin-remove):
Likewise.
(erc-server-join-channel): Move to erc.el.
* lisp/erc/erc.el (erc-server-join-channel): Move from erc-join.el.
(erc-cmd-JOIN): Use erc-server-join-channel.
2017-05-05 21:45:02 -06:00
Tino Calancha
966020bc52 Ensure the created temp file in a test is new
* test/lisp/buff-menu-tests.el (buff-menu-24962): Use `make-temp-file'
to create the temp file.
2017-05-06 12:30:48 +09:00
Glenn Morris
a95fefd1e6 Decruftify dns-mode.el a little bit
* lisp/textmodes/dns-mode.el (dns-mode-control-entities):
New constant.
(dns-mode-control-entity, dns-mode-bad-control-entity)
(dns-mode-type, dns-mode-class): New faces.
(dns-mode-control-entity-face, dns-mode-bad-control-entity-face)
(dns-mode-type-face, dns-mode-class): Make these variables use the
new faces, and mark as obsolete.
(dns-mode-font-lock-keywords): Use dns-mode-control-entities.
2017-05-05 21:44:09 -04:00
Paul Eggert
2b91f3d1ea Pretty-print Lisp_Object values in GDB
* src/.gdbinit: Add a pretty-printer for Lisp_Object values.  Now,
GDB displays them as "XIL(0xXXX)" rather than displaying them
as "..." when CHECK_LISP_OBJECT_TYPE is in effect and as "DDDDD"
otherwise.
2017-05-05 16:04:49 -07:00
Peder O. Klingenberg
1c9c02f51c Tweak dns-mode font-lock
* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
Highlight $TTL as a control entity.  (Bug#26780)
2017-05-05 14:03:04 -04:00
Glenn Morris
4af24317b4 Fontify the doc-string in some CL forms as such
* lisp/emacs-lisp/lisp-mode.el (defconstant, defparameter):
Add the doc-string-elt property.  (Bug#26778)
2017-05-04 23:15:53 -07:00
Glenn Morris
b8732c652a * lisp/emacs-lisp/cl-lib.el (cl-mapcar): Remove recent autoload cookie. 2017-05-04 22:26:17 -07:00
Dmitry Gutov
ee0dd3031c cl-defmethod: Make the edebug spec more technically correct
* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Denote the
edebug spec part for qualifiers as [&rest atom], per
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00053.html.
2017-05-05 03:43:44 +03:00
Mike Kupfer
167f47d202 Fix MH-E not to load cl at runtime (Bug#25552)
* lisp/mh-e/mh-acros.el (defun-mh): Check at runtime, not
compile time, whether the target is bound.
* lisp/mh-e/mh-compat.el: Enable compilation.  Pull in
mh-acros at compile time.
Authored-by: Glenn Morris <rgm@gnu.org>, Noam Postavsky
<npostavs@users.sourceforge.net>
2017-05-04 15:30:17 -07:00
Jean-Christophe Helary
d15a4805d6 Multiline support in NS "Open Selected File" service.
* lisp/term/ns-win.el (ns-open-file-service): new function. Wraps the
original call in a (split-string) to create as many calls as there
are lines.
(ns-spi-service-call): Call `ns-open-file-service' instead of
`dnd-open-file'.
2017-05-04 20:32:40 +02:00
Dmitry Gutov
f5ca518b92 ; xref-collect-matches: Add a TODO 2017-05-04 18:27:15 +03:00
Eli Zaretskii
53348c6b9f ; Remove redundant definition of the 'DebPrint' macro
* nt/inc/ms-w32.h (DebPrint): Remove redundant definition (defined
in src/conf_post.h).
2017-05-04 18:11:53 +03:00
Göktuğ Kayaalp
4a3e392252 Require cl-lib at runtime in vc-hg
* lisp/vc/vc-hg.el: Require cl-lib at runtime as well (bug#26609).
2017-05-04 15:46:51 +03:00
Tino Calancha
fed13bd8c8 Inherit incompatible/obsolete package faces from error
Don't use the same face for installed packages as for incompatible
or obsolete ones.
* lisp/emacs-lisp/package.el (package-status-incompat): Inherit from error.
2017-05-04 19:47:45 +09:00