Eli Zaretskii [Sat, 31 Jan 2015 18:48:53 +0000 (20:48 +0200)]
Avoid aborts when keyboard-coding-system is raw-text (Bug#19532)
src/coding.c (raw_text_coding_system_p): New function.
src/keyboard.c (read_decoded_event_from_main_queue): Use it when the
keyboard coding-system is 'raw-text'.
src/coding.h (raw_text_coding_system_p): Add prototype.
Paul Eggert [Sat, 31 Jan 2015 07:11:55 +0000 (23:11 -0800)]
Simplify read_dirent's MSDOS hacks
* dired.c (read_dirent): Simplify by removing the need for the
DIR_ENTRY argument. All callers changed. This separates the
MS-DOS idiosyncrasies better from the rest of the code.
* lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove.
Use cl-check-type everywhere instead.
(eieio-class-object): Remove, use find-class instead when needed.
(class-p): Don't inline.
(eieio-object-p): Check more thoroughly, so we don't treat cl-structs,
such as eieio classes, as objects. Don't inline.
(object-p): Mark as obsolete.
(eieio-defclass-autoload, eieio-defclass-internal, eieio-oref)
(eieio--generic-tagcode): Avoid `class-p'.
(eieio-make-class-predicate, eieio-make-child-predicate): New functions.
(eieio-defclass-internal): Use current-load-list rather than
`class-location'.
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor):
Use find-lisp-object-file-name, help-fns-short-filename and new calling
convention for eieio-class-def.
(eieio-build-class-list): Remove function, unused.
(eieio-method-def): Remove button type, unused.
(eieio-class-def): Inherit from help-function-def.
(eieio--defclass-regexp): New constant.
(find-function-regexp-alist): Use it.
(eieio--specializers-apply-to-class-p): Handle eieio--static as well.
(eieio-help-find-method-definition, eieio-help-find-class-definition):
Remove functions.
* lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate
and eieio-make-child-predicate.
(eieio-class-parents): Use eieio--class-object.
(slot-boundp, find-class, eieio-override-prin1): Avoid class-p.
(slot-exists-p): Use find-class.
Stefan Monnier [Fri, 30 Jan 2015 21:00:29 +0000 (16:00 -0500)]
* lisp/emacs-lisp/backquote.el: Fix bug with unoptimized exp.
Fixes: debbugs:19734
* lisp/emacs-lisp/backquote.el (backquote-delay-process): Don't reuse `s'
since it may be "equivalent" in some sense, yet different.
* test/automated/core-elisp-tests.el (core-elisp-tests-3-backquote): New test.
Oleh Krehel [Wed, 28 Jan 2015 09:32:12 +0000 (10:32 +0100)]
lisp/outline.el: Add namespace prefixes.
* outline.el (outline-hide-entry): Rename from `hide-entry'.
(outline-show-entry): rename from `show-entry'
(outline-hide-body): Rename from `hide-body'.
(outline-hide-region-body): Rename from `hide-region-body'.
(outline-show-all): Rename from `show-all'.
(outline-hide-subtree): Rename from `hide-subtree'.
(outline-hide-leaves): Rename from `hide-leaves'.
(outline-show-subtree): Rename from `show-subtree'.
(outline-hide-sublevels): Rename from `hide-sublevels'.
(outline-hide-other): Rename from `hide-other'.
(outline-show-children): Rename from `show-children'.
(outline-show-branches): Rename from `show-branches'.
files.el: avoid asking whether to kill Emacs multiple times
* lisp/files.el (save-buffers-kill-emacs): If `confirm-kill-emacs' is
set, but user has just been asked whether they really want to kill Emacs
(for example with a ‘Modified buffers exist; exit anyway?’ prompt) , do
not ask them for another confirmation.
Eli Zaretskii [Fri, 30 Jan 2015 06:48:32 +0000 (08:48 +0200)]
Fix error messages when readdir cannot open a directory on MS-Windows
src/dired.c (read_dirent): Accept an additional argument
FIRST_ENTRY. If readdir fails with ENOENT or EACCES the first
time it is called, report the error as if it happened in
open_directory.
(directory_files_internal, file_name_completion): Adjust callers
or read_dirent.
Paul Eggert [Thu, 29 Jan 2015 23:32:15 +0000 (15:32 -0800)]
Report readdir failures
Previously, on non-MS-Windows platforms the code treated most
readdir failures as EOF. This was incorrect, e.g., when readdir
fails with errno == EOVERFLOW. Signal an error instead.
* dired.c (read_dirent):
New function, which signals an error when readdir fails.
(directory_files_internal, file_name_completion): Use it.
Eli Zaretskii [Thu, 29 Jan 2015 17:16:56 +0000 (19:16 +0200)]
Use bool for boolean in w32menu.c, w32font.c, w32uniscribe.c.
src/w32uniscribe.c (uniscribe_list, uniscribe_match): Use bool where
appropriate.
src/w32font.c (struct font_callback_data, w32font_list_internal)
(w32font_driver, w32font_match_internal): Use bool where appropriate.
src/w32menu.c (x_activate_menubar, set_frame_menubar)
(w32_dialog_show, initialize_frame_menubar, w32_menu_show)
(is_simple_dialog): Use bool where appropriate.
Paul Eggert [Wed, 28 Jan 2015 19:11:14 +0000 (11:11 -0800)]
Use bool, not int, to track face changes
* xfaces.c (face_change): Rename from face_change_count, and
change from int to bool. The var is now true (instead of nonzero)
if attributes have changed; this is simpler. All uses changed. Fixes: bug#19698
Eli Zaretskii [Wed, 28 Jan 2015 17:42:28 +0000 (19:42 +0200)]
Improve the fix for bug #19701
src/dired.c (directory_files_internal, file_name_completion)
[WINDOWSNT]: Signal an error when errno is set non-zero by
'readdir', regardless of its value.
src/w32.c (sys_readdir): Set errno to ENOENT when the directory
doesn't exist and to EACCES when it's not accessible to the
current user. Set errno to zero when FindNextFile exhausts the
directory, so that callers don't interpret that as an error and
don't signal a file-error.
(open_unc_volume): Set errno to ENOENT if WNetOpenEnum fails.
Tassilo Horn [Wed, 28 Jan 2015 09:32:50 +0000 (10:32 +0100)]
Fix issues with BibTeX entries containing ")".
* textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and )
punctuation syntax since to allow bibtex fields with values such
as {Test 1) and 2)} (bug#19205, bug#19707).
(reftex--prepare-syntax-tables): New function.
(reftex-mode): Use it.
Tassilo Horn [Wed, 28 Jan 2015 09:32:50 +0000 (10:32 +0100)]
Fix issues with BibTeX entries containing ")".
* textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and )
punctuation syntax since to allow bibtex fields with values such
as {Test 1) and 2)} (bug#19205, bug#19707).
(reftex--prepare-syntax-tables): New function.
(reftex-mode): Use it.
Paul Eggert [Wed, 28 Jan 2015 06:24:19 +0000 (22:24 -0800)]
Merge from gnulib and try to repair bad merge
This attempts to repair problems introduced by the bad merge 5491fd1098d27b3ba3db054076b9ab60fb3558dc. The easiest way for me
to fix the badly-merged gnulib files was to run
'admin/merge-gnulib', so I did that, which also imported the
following changes:
* build-aux/update-copyright, m4/gnulib.m4:
Update from gnulib, incorporating:
2015-01-15 time: port to MinGW32 3.21
2015-01-15 update-copyright: apply to self
2015-01-11 update-copyright: recognize groff's \(co marker
9664def Signal a file-error from directory-files on MS-Windows (Bug#19701) fd4e65e Added missing test for previous commit 5485e3e5 python.el: New non-global state dependent indentation engine. 3b23e6a Fix the description of --insert command-line option (Bug#19694) 7a7e594 Add a cross-reference in ELisp manual. (Bug#19668) b4f4075 Fixes: debbugs:19660 83b3c31 * test/automated/regexp-tests.el: Require regexp-opt
a3505cb doc/lispref/variables.texi (Creating Buffer-Local): Improve indexing (Bug#19608) d132c7b erc-backend.el: Give hook-name a default value of nil and add-to-list unconditionally. Fixes debbugs:19363 61cc7bf Fix support of non-ASCII frame titles on MS-Windows (Bug#19590) 1e5902a * filenotify.el (file-notify--descriptor): Do not cons for remote files. b1ea160 Handle watching of several files in the same directory for inotify.
b544ab5 Fix return value of vertical-motion at ZV (Bug#19553) 1f179ea Fix encoding of I/O in net-utils.el for MS-Windows. (Bug#19458) 70f298f Fix the description of -nl in --help text. (Bug#19542)
Stefan Monnier [Wed, 28 Jan 2015 03:41:31 +0000 (22:41 -0500)]
Tighten up the tagcode used for eieio and cl-struct objects
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Set the function
slot of the tag symbol to :quick-object-witness-check.
(eieio-object-p): Use :quick-object-witness-check.
(eieio--generic-tagcode): Use cl--generic-struct-tag.
* lisp/emacs-lisp/cl-preloaded.el: New file.
* lisp/emacs-lisp/cl-macs.el (cl--bind-inits): Remove, unused.
(cl--transform-lambda, cl-destructuring-bind): Remove cl--bind-inits.
(cl--make-usage-args): Strip away &aux args.
(cl-case, cl-typecase, cl--parse-loop-clause): Use macroexp-let2.
(cl-the, cl-check-type): Use macroexp-let2 and cl-typep.
(cl-defstruct): Use `declare' and cl-struct-define.
* lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): New function.
(cl--generic-struct-tagcode): Use it to tighten the tagcode.
* lisp/loadup.el: Load cl-preloaded.
* src/lisp.mk (lisp): Add cl-preloaded.
Ivan Shmakov [Tue, 27 Jan 2015 21:25:56 +0000 (21:25 +0000)]
Allow for adding new members to Tar archives.
* lisp/tar-mode.el: Allow for adding new archive members.
(tar-new-regular-file-header, tar--pad-to, tar--put-at)
(tar-header-serialize): New functions.
(tar-current-position): Split from tar-current-descriptor.
(tar-current-descriptor): Use it.
(tar-new-entry): New command.
(tar-mode-map): Bind it.
* doc/emacs/files.texi (File Archives): Document "I" for tar-new-entry.
* etc/NEWS: Mention the new tar-new-entry command.
Eli Zaretskii [Tue, 27 Jan 2015 19:02:13 +0000 (21:02 +0200)]
Signal a file-error from directory-files on MS-Windows (Bug#19701)
src/dired.c (directory_files_internal) [WINDOWSNT]: If readdir
returns NULL and errno is ENOTDIR, behave as if opendir failed to
open the directory.
src/w32.c (sys_readdir): If FindFirstFile fails because the
directory doesn't exist, set errno to ENOTDIR.
Sam Steingold [Tue, 27 Jan 2015 18:20:57 +0000 (13:20 -0500)]
minor tweaks for `python-check'
* lisp/progmodes/python.el (python-check-custom-command): Buffer local
because it usually includes the buffer name.
(python-check-command): Set to epylint when pyflakes is not available.
Paul Eggert [Tue, 27 Jan 2015 06:34:25 +0000 (22:34 -0800)]
Port autogen.sh hook creation to Apple Git
* autogen.sh: Do not assume that the hook samples exist.
This ports to git version 1.9.3 (Apple Git-50).
For some reason Apple decided to populate the git hooks directory
in a different way from the way that standard Git does it.
The downside is that patch applications won't be checked on Apple,
but that's better than autogen.sh failing.
Problem reported by Sam Steingold in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00898.html
python.el: New non-global state dependent indentation engine.
Fixes: debbugs:18319 Fixes: debbugs:19595
* lisp/progmodes/python.el (python-syntax-comment-or-string-p): Accept
PPSS as argument.
(python-syntax-closing-paren-p): New function.
(python-indent-current-level)
(python-indent-levels): Mark obsolete.
(python-indent-context): Return more context cases.
(python-indent--calculate-indentation)
(python-indent--calculate-levels): New functions.
(python-indent-calculate-levels): Use them.
(python-indent-calculate-indentation, python-indent-line):
(python-indent-line-function): Rewritten to use new API.
(python-indent-dedent-line): Simplify logic.
(python-indent-dedent-line-backspace): Use `unless`.
(python-indent-toggle-levels): Delete function.