1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00
Commit Graph

123407 Commits

Author SHA1 Message Date
Michael Albinus
bec57a486a Some final fixes in file notification before merging with master
* lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg.
(file-notify-callback): Improve check for `stopped' event.  Call
`file-notify-rm-watch' rather than `file-notify--rm-descriptor'.
(file-notify-add-watch): In case FILE is not a directory, call the
file monitor for the kqueue backend.  Otherwise, call the
directory monitor for the upper directory.

* src/inotify.c (inotifyevent_to_event): Extract file name from
watch_object if the event doesn't provide it.
(Finotify_add_watch): Add file name to watch_object.

* test/automated/file-notify-tests.el (file-notify--test-timeout):
Use different timeouts for different libraries.
(file-notify--test-with-events): Suppress lock files.  Flush
outstanding events before running the body.
(file-notify-test02-events, file-notify-test04-file-validity): Do
not skip cygwin tests.  Add additional test for file creation.
Adapt expected result for different backends.
(file-notify-test03-autorevert): Some of the tests don't work for
w32notify.
(file-notify-test06-many-events): Rename into both directions.
2015-11-25 15:07:12 +01:00
Michael Albinus
0247489fed Rework file notifications, kqueue has problems with directory monitors
* lisp/filenotify.el (file-notify-add-watch): Call the native
add-watch function on the file, not on the dir.

* src/kqueue.c (kqueue_compare_dir_list): Make also bookkeeping
about already deleted entries.

* test/automated/auto-revert-tests.el
(auto-revert-test01-auto-revert-several-files): Do not call "cp -f"
since this deletes the target file first.

* test/automated/file-notify-tests.el (file-notify--test-event-test):
Make stronger checks.
(file-notify-test01-add-watch, file-notify-test02-events)
(file-notify-test04-file-validity, file-notify-test05-dir-validity):
Rewrite in order to call file monitors but directory monitors.
(file-notify-test06-many-events): Ler rename work in both directions.
2015-11-25 15:07:12 +01:00
Michael Albinus
5154781141 Continie with pending events
* src/kqueue.c (pending_events): Remove global variable.
(kqueue_compare_dir_list): Create `write' event for not used
pending events.
(globals_of_kqueue): Remove initialization of pending_events.
2015-11-25 15:07:12 +01:00
Michael Albinus
6b490c0709 Improve loops in file-notify-test06-many-events
* test/automated/file-notify-tests.el (file-notify-test06-many-events):
Use `read-event' pauses for the `write-file' loops; otherwise
events are lost in inotify and gfilenotify cases.
2015-11-25 15:07:12 +01:00
Michael Albinus
c8e266ff5f Handle more complex rename operation in kqueue
* src/kqueue.c (pending_events): New variable.
(kqueue_compare_dir_list): Handle more complex rename operation.
(globals_of_kqueue): Initialize pending_events.

* test/automated/file-notify-tests.el (file-notify-test06-many-events):
Adapt expected events in the `rename-file' case.
(file-notify-test06-many-events-remote): Declare.
2015-11-25 15:07:12 +01:00
Wolfgang Jenkner
5044bdfed7 New test with a larger number of events.
* test/automated/file-notify-tests.el (file-notify--test-with-events):
Make timeout heuristically depend on the number of events.

(file-notify-test06-many-events): Use it for new test.
2015-11-25 15:07:11 +01:00
Michael Albinus
65ba5a98d4 Further fixes for kqueue.
* lisp/filenotify.el (file-notify-callback): Raise also event if
directory name matches.
(file-notify-add-watch): Add `create' to the flags for `kqueue'.

* src/kqueue.c (kqueue_generate_event): Use watch_object as
argument instead of ident.  Remove callback argument.  Adapt
callees.  Check actions whether they are monitored flags.

* test/automated/file-notify-tests.el (file-notify--test-library):
New defun.
(file-notify-test00-availability, file-notify-test02-events)
(file-notify-test04-file-validity)
(file-notify-test05-dir-validity): Use it.
(file-notify-test02-events, file-notify-test04-file-validity): Add
`read-event' calls between different file actions, in order to
give the backends a chance to rais an event.  Needed especially
for kqueue.  In case of deleting a directory, there are two
`deleted' events.
2015-11-25 15:07:11 +01:00
Michael Albinus
13f3508443 Code cleanup of kqueue.c
* src/kqueue.c (kqueue_directory_listing): Skip "." and "..".
(kqueue_compare_dir_list): Do not loop when calling
directory_files_internal.  Remove checks for "." and "..", this is
done in kqueue_directory_listing now.
(Fkqueue_add_watch): Check for proper emacs_open flags.
2015-11-25 15:07:11 +01:00
Michael Albinus
99aa85535a Doc changes for kqueue
* doc/lispref/os.texi (File Notifications): Add kqueue as backend.
Fix some glitches in the example.
2015-11-25 15:07:11 +01:00
Michael Albinus
8deebe1ab8 Finish implementation in kqueue.c
* src/kqueue.c (kqueue_directory_listing, kqueue_callback):
Simplify access to list.
(kqueue_compare_dir_list): Simplify access to list.  Raise
`delete' event if directory does not exist any longer.  Otherwise,
wait until directory contents has changed.  Fix error in check.
2015-11-25 15:07:11 +01:00
Michael Albinus
90d6c698da * lisp/filenotify.el (file-notify-add-watch): Fix thinko. 2015-11-25 15:07:11 +01:00
Michael Albinus
e95b309ae4 More work on kqueue
* lisp/filenotify.el (file-notify-callback): Handle also the
`rename' event from kqueue.
(file-notify-add-watch): Do not register an entry twice.

* src/kqueue.c (kqueue_directory_listing): New function.
(kqueue_generate_event): New argument FILE1.  Adapt callees.
(kqueue_compare_dir_list): Rewrite in order to make it more robust.
2015-11-25 15:07:11 +01:00
Michael Albinus
41d9bd0c3b Implement directory events
* lisp/filenotify.el (file-notify-handle-event)
(file-notify-callback): Remove traces.

* src/kqueue.c: Include <sys/time.h>.
(kqueue_generate_event, kqueue_compare_dir_list): New functions.
(kqueue_callback): Use them.  Call kevent() with a zero timeout.
(Fkqueue_add_watch): Adapt docstring.  Support directory events.
Compute initial directory listing.  Close file descriptor in case
of errors.
(syms_of_kqueue): Declare Qcreate.
2015-11-25 15:07:11 +01:00
Wolfgang Jenkner
c571fc149a Build fixes for kqueue support.
* src/kqueue.c (Fkqueue_add_watch): O_BINARY is not a POSIX open(3)
flag.

* configure.ac (HAVE_KQUEUE): There is no pkg-config module for native
kqueue on *BSD.
2015-11-25 15:07:11 +01:00
Michael Albinus
e0a68f2587 Continue kqueue implementation
* lisp/filenotify.el (file-notify-handle-event)
(file-notify-callback): Enable trace messages.

* src/kqueue.c: Include also <sys/types.h>.
(kqueue_callback): Remove watch in case of NOTE_DELETE or NOTE_RENAME.
(Fkqueue_rm_watch, Fkqueue_valid_p): New functions.
(syms_of_kqueue): Add them.
2015-11-25 15:07:11 +01:00
Michael Albinus
7543d1cf46 Work on kqueue
* lisp/filenotify.el (file-notify--library)
(file-notify-descriptors, file-notify-callback)
(file-notify-add-watch, file-notify-rm-watch)
(file-notify-valid-p): Add kqueue support.

* src/keyboard.c (make_lispy_event): Check also for HAVE_KQUEUE.
2015-11-25 15:07:10 +01:00
Michael Albinus
e3354e2265 Add kqueue support
* configure.ac (--with-file-notification): Add kqueue.
(top): Remove special test for "${HAVE_NS}" and
${with_file_notification}, this is handled inside gfilenotify
tests.  Add kqueue tests.  Use NOTIFY_CFLAGS and NOTIFY_LIBS
instead of library specific variables.

* src/Makefile.in: Use NOTIFY_CFLAGS and NOTIFY_LIBS.

* src/emacs.c (main): Call globals_of_kqueue and syms_of_kqueue.

* src/kqueue.c: New file.

* src/lisp.h: Declare extern globals_of_kqueue and syms_of_kqueue.
2015-11-25 15:07:10 +01:00
João Távora
c6457cef92 Minor fix to comment indentation and typo in last commit
* linum.el (linum-update-window): Fix comment indentation and a
typo.
2015-11-17 22:28:50 +00:00
João Távora
b92307f670 linum-mode plays more nicely with other margin-setting extensions
linum.el will only modify the left margin if it needs to, and will
only reset the it back to 0 if it guesses that no-one has touched that
margin in the meantime.

As such, this is a more of a workaround than an actual fix, but fixes
the problems described in bug#20674 regarding the interaction with
modes such as darkroom-mode and olivetti-mode.

A similar fix was commited to nlinum.el in ELPA.git's
e7f5f549fbfb740b911fb7f33b42381ecece56d8

* linum.el (linum-delete-overlays): Restore margins more
criteriously.
(linum-update-window): Set margins more criteriously.
2015-11-17 22:24:53 +00:00
Daiki Ueno
58e6235007 * lisp/image-mode.el: Support encrypted file
(image-toggle-display-image): Read content from the buffer instead
of the file, if the buffer holds a decrypted data.  (Bug#21870)
2015-11-17 11:27:51 +09:00
Juanma Barranquero
937565268a * lisp/progmodes/verilog-mode.el (verilog-save-buffer-state): Add backquote 2015-11-16 04:32:31 +01:00
Juanma Barranquero
47f83b6fc0 ; ChangeLog.2 fixes 2015-11-16 00:09:59 +01:00
Artur Malabarba
7cc233e1e3 * lisp/emacs-lisp/package.el: Fix a decoding issue
(package--with-response-buffer): Use `url-insert-buffer-contents'.
The previous code had some issues with decoding. Refactoring that
function allows us to use the decoding from url-handlers while still
treating both sync and async requests the same.

* lisp/url/url-handlers.el (url-insert-file-contents): Move some code to
`url-insert-buffer-contents'.
(url-insert-buffer-contents): New function
2015-11-15 21:35:06 +00:00
Artur Malabarba
5f9153faaf * lisp/emacs-lisp/package.el: Refactor -with-work-buffer-async
(package--with-work-buffer-async): Reimplement as
`package--with-response-buffer'.
(package--with-work-buffer): Mark obsolete.
(package--with-response-buffer): New macro. This is a more self
contained and less contrived version of
`package--with-work-buffer-async'.  It uses keyword arguments,
doesn't have async on the name, doesn't fallback on
`package--with-work-buffer', and has _much_ simpler error
handling.

(package--check-signature, package--download-one-archive)
(package-install-from-archive, describe-package-1): Use it.

(package--download-and-read-archives): Let
`package--download-one-archive' take care of calling
`package--update-downloads-in-progress'.
2015-11-15 21:35:04 +00:00
Stefan Monnier
353f5e7664 * lisp/progmodes/verilog-mode.el: Use with-silent-modifications
(verilog-save-buffer-state): Use with-silent-modifications when available.
(verilog-save-font-no-change-functions): Don't bind
before/after-change-functions if it's not needed.
2015-11-15 14:04:30 -05:00
Glenn Morris
70f1fda4ae ; Auto-commit of ChangeLog files. 2015-11-15 06:26:33 -05:00
Xue Fuqiao
ae0653b5ab * CONTRIBUTE: Remove information about feature freeze. 2015-11-15 10:05:17 +08:00
Xue Fuqiao
9459456b50 Merge branch 'release-process-lowercase'
; Rename admin/FOR-RELEASE to admin/release-process and document the
; release process
2015-11-15 09:52:05 +08:00
Xue Fuqiao
9a4aa0f594 Document the release process
* admin/notes/versioning: Add information about RC releases.
* admin/release-process: Document the release process.
* admin/authors.el (authors-ignored-files):
* admin/README: Change FOR-RELEASE to release-process.
* CONTRIBUTE:
* admin/notes/bugtracker: Don't mention FOR-RELEASE.
2015-11-15 09:35:50 +08:00
Xue Fuqiao
f8cc14b597 * admin/release-process: Rename from admin/FOR-RELEASE. 2015-11-15 09:32:12 +08:00
David Engster
dcd5877a76 gitmerge: Fix git log command
* admin/gitmerge.el (gitmerge-missing): Use '--left-only' since we
only want commits from the branch that is to be merged.
(gitmerge-setup-log-buffer): Use the same symmetric range as in
`gitmerge-missing'.
2015-11-14 23:16:51 +01:00
David Engster
2ac79ae901 gitmerge: Try to detect cherry-picks
* admin/gitmerge.el (gitmerge-default-branch): Change to
origin/emacs-25.
(gitmerge-missing): Use symmetric difference ('...') between
branch and master so that cherry-picks can be detected.
2015-11-14 17:54:36 +01:00
Eli Zaretskii
5f7a2a9053 Increment Emacs version on master branch
* lisp/cus-edit.el (customize-changed-options-previous-release):
Increase previous version to 24.5.

* configure.ac:
* msdos/sed2v2.inp: Bump version to 25.1.50.
2015-11-14 10:38:58 +02:00
Xue Fuqiao
ed2e7e20ae Mention CONTRIBUTE in README
Mention CONTRIBUTE in README, since it was moved from etc/ to root.
* etc/TODO: Remove the reference to `etc/CONTRIBUTE'.
* README: Mention CONTRIBUTE.
2015-11-14 13:03:19 +08:00
Wilson Snyder
9e00a029c4 Update verilog-mode.el to 2015-11-09-b121d60-vpo.
* verilog-mode.el (verilog-auto, verilog-delete-auto)
(verilog-modi-cache-results, verilog-save-buffer-state)
(verilog-save-font-no-change-functions): When internally suppressing change
functions, use `inhibit-modification-hooks' and call
`after-change-funtions' to more nicely work with user hooks.  Reported by
Stefan Monnier.

(verilog-auto, verilog-delete-auto, verilog-delete-auto-buffer):
Create `verilog-delete-auto-buffer' to avoid double-calling
fontification hooks.

(verilog-restore-buffer-modified-p, verilog-auto)
(verilog-save-buffer-state): Prefer restore-buffer-modified-p over
set-buffer-modified-p. Reported by Stefan Monnier.

(verilog-diff-auto, verilog-diff-buffers-p)
(verilog-diff-ignore-regexp): Add `verilog-diff-ignore-regexp'.

(verilog-auto-inst-port, verilog-read-sub-decls-expr): Fix
AUTOINST with unpacked dimensional parameters, bug981. Reported by
by Amol Nagapurkar.

(verilog-read-decls, verilog-read-sub-decls-line): Avoid unneeded
properties inside internal structures. No functional change
intended.
2015-11-13 21:17:57 -05:00
Dmitry Gutov
138ad3d93b ; Fix warnings
* lisp/vc/diff-mode.el (diff-kill-applied-hunks):
Fix unused variable warnings.
2015-11-14 03:03:58 +02:00
Dmitry Gutov
7126e9a40b ; Update xref-etags-mode for the latest change 2015-11-14 02:41:38 +02:00
Dmitry Gutov
246d6605f7 Use generic dispatch for xref backends
* lisp/progmodes/xref.el (xref-backend-functions):
New variable.
(xref-find-function): Remove.
(xref-find-backend)
(xref--etags-backend): New functions.
(xref-identifier-at-point-function)
(xref-identifier-completion-table-function): Remove.
(xref-backend-definitions, xref-backend-references)
(xref-backend-apropos, xref-backend-identifier-at-point)
(xref-backend-identifier-completion-table):
New generic functions.

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add
`elisp--xref-backend' to the beginning of
`xref-backend-functions', locally.  Delete references to
removed functions and vars.
(elisp-xref-find): Remove.
(elisp--xref-backend): New function.
(elisp--xref-find-references, elisp--xref-find-apropos)
(elisp--xref-identifier-completion-table):
Turn into appropriately named generic methods.

* lisp/progmodes/etags.el (etags-xref-find): Remove.
(xref-backend-identifier-completion-table)
(xref-backend-references, xref-backend-definitions)
(xref-backend-apropos): New generic methods.
2015-11-14 02:41:38 +02:00
Juri Linkov
31f6e93933 Support rectangular regions for more commands
* lisp/simple.el (region-extract-function): Handle the arg value ‘bounds’.
(region-insert-function): New function.
(shell-command-on-region): Add arg ‘region-noncontiguous-p’.
If non-nil, operate on multiple chunks.
(region-noncontiguous-p): New function.

* lisp/rect.el: Add function rectangle--insert-region
around region-insert-function.
(extract-rectangle-bounds): New function.
(rectangle--extract-region): Handle the arg value ‘bounds’.
(rectangle--insert-region): New function.

* lisp/emulation/cua-rect.el: Add function cua--insert-rectangle
around region-insert-function.
(cua--extract-rectangle-bounds): New function.
(cua--rectangle-region-extract): Handle the arg value ‘bounds’.

* lisp/replace.el (query-replace, query-replace-regexp): Add arg
‘region-noncontiguous-p’.  Use ‘use-region-p’.
(query-replace-regexp-eval, map-query-replace-regexp)
(replace-string, replace-regexp): Use ‘use-region-p’.
(keep-lines, flush-lines, how-many): Use ‘use-region-p’.
(perform-replace): Add arg ‘region-noncontiguous-p’.
If non-nil, operate on multiple chunks.

* src/casefiddle.c (Fdowncase_region): Add arg ‘region-noncontiguous-p’.
If non-nil, operate on multiple chunks. (Bug#19829)
2015-11-14 01:28:03 +02:00
Dmitry Gutov
f103a2771b Handle multiple matches on the same line; add highlighting
* lisp/progmodes/xref.el (xref-location-marker): Interpret the
column value in characters.
(xref--collect-matches): Rename from `xref--collect-match'.
Search for all matches in the hit line.  Add `highlight' face to
the matched region in the summary.  Update both callers.
2015-11-14 01:11:52 +02:00
Dmitry Gutov
fe973fc270 Replace xref-match-bounds with xref-match-length
Relying on xref-location-marker to point to the beginning of the match

* lisp/progmodes/xref.el (xref-match-bounds): Remove.
(xref-match-length): Add.
(xref-make-match): Change the arguments.
(xref--match-buffer-bounds): Remove.
(xref-match-item): Store length, instead of end-column.
(xref-pulse-momentarily)
(xref--collect-match)
(xref--query-replace-1): Update accordingly.
(xref-query-replace): Ditto.  And check that the search results
are up-to-date.
2015-11-14 01:01:58 +02:00
Paul Eggert
92a501022e Merge from gnulib
This incorporates:
2015-11-13 xalloc-oversized: improve performance with GCC 5
* lib/xalloc-oversized.h: Copy from gnulib.
2015-11-13 12:40:52 -08:00
Paul Eggert
04ac097f34 Spruce up ftfont.c memory allocation
* src/ftfont.c (setup_otf_gstring):
Avoid O(N**2) behavior when reallocating.
(ftfont_shape_by_flt): Prefer xpalloc to xrealloc when
reallocating buffers; this simplifies the code.  Do not trust
mflt_run to leave the output areas unchanged on failure, as
this isn’t part of its interface spec.
2015-11-13 12:04:15 -08:00
Paul Eggert
4c4b520520 Port recent XCB changes to 64-bit ‘long int’
For historical reasons, libX11 represents 32-bit values like Atoms as
‘long int’ even on platforms where ‘long int’ is 64 bits.  XCB doesn’t
do that, so adapt the recent XCB code to behave properly on 64-bit
platforms.  Also, fix what appears to be a bug in the interpretation
of xcb_get_property_value_length, at least on my Fedora platform
which is running libxcb-1.11-5.fc21.
* src/xfns.c (x_real_pos_and_offsets):
* src/xterm.c (get_current_wm_state):
xcb_get_property_value_length returns a byte count, not a word count.
For 32-bit quantities, xcb_get_property_value returns a vector
of 32-bit words, not of (possibly 64-bit) long int.
2015-11-13 09:30:00 -08:00
Paul Eggert
4f0ce9c8ef * src/undo.c (run_undoable_change): Now static. 2015-11-13 08:44:34 -08:00
Eli Zaretskii
695a6f932b Remove support for ':timeout' from w32 tray notifications
* src/w32fns.c (Fw32_notification_notify): Delete the code that
supports ':timeout'.
(syms_of_w32fns): Don't DEFSYM ':timeout'.  This avoids clashes
with dbusbind.c when D-Bus is compiled in.

* doc/lispref/os.texi (Desktop Notifications): Don't mention
':timeout'.
2015-11-13 15:33:29 +02:00
Juanma Barranquero
a731c2f163 * test/automated/simple-test.el: Add test for bug#20698 (bug#21885)
(simple-test--transpositions): New macro.
(simple-transpose-subr): New test.
2015-11-13 14:09:35 +01:00
Juanma Barranquero
2b4c0c0cef * lisp/progmodes/elisp-mode.el: Declare function `project-roots' 2015-11-13 11:04:10 +01:00
Juanma Barranquero
66b9f7bdcf * src/undo.c: Small fixes for previous change
(run_undoable_change): Mark void argument list.
(record_property_change): Remove unused variable `boundary'.
2015-11-13 10:59:23 +01:00
Eli Zaretskii
2fac30eb8d Add a few more variables to redisplay--variables
* lisp/frame.el (redisplay--variables): Add bidi-paragraph-direction
and bidi-display-reordering to the list.
2015-11-13 11:56:08 +02:00