Commit graph

1211 commits

Author SHA1 Message Date
Juanma Barranquero
d77974bfca lisp/subr.el (delay-warning): New function. 2013-07-11 03:49:17 +02:00
Juanma Barranquero
ed095bd758 lisp/subr.el (read-quoted-char): Remove unused local variable `char'. 2013-07-08 00:50:34 +02:00
Stefan Monnier
321e1a9c42 * lisp/subr.el (read-quoted-char): Use read-key.
(sit-for): Let read-event decode tty input.

Fixes: debbugs:14782
2013-07-05 20:10:54 -04:00
Michael Albinus
864c58ca5f * filenotify.el: New package.
* autorevert.el (top): Require filenotify.el.
(auto-revert-notify-enabled): Remove.  Use `file-notify-support'
instead.
(auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
(auto-revert-notify-handler): Use `file-notify-*' functions.

* subr.el (file-notify-handle-event): Move function to filenotify.el.

* net/tramp.el (tramp-file-name-for-operation): Handle
`file-notify-add-watch' and `file-notify-rm-watch'.

* net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add handler
for `file-notify-add-watch' and `file-notify-rm-watch'.
(tramp-process-sentinel): Improve trace.
(tramp-sh-handle-file-notify-add-watch)
(tramp-sh-file-notify-process-filter)
(tramp-sh-handle-file-notify-rm-watch)
(tramp-get-remote-inotifywait): New defuns.
2013-07-04 11:39:36 +02:00
Glenn Morris
1399490e2b Merge from emacs-24; up to 2012-12-29T12:57:49Z!fgallina@gnu.org 2013-07-02 20:20:04 -07:00
Glenn Morris
208dee4daa * lisp/subr.el (y-or-n-p): Handle empty prompts.
Fixes: debbugs:14770
2013-07-02 20:13:07 -07:00
Paul Eggert
89561f72e5 Add log2 support and make log10 obsolete for consistency.
* configure.ac (log2): Check for this function.
* doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10.
* lisp/subr.el (log10): Move here from C code, and declare as obsolete.
All uses of (log10 X) replaced with (log X 10).
* src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
base is 2; this is more accurate.
(Flog10): Move to Lisp (marked obsolete there).
2013-06-20 07:15:42 -07:00
Stefan Monnier
bf1e6ae81d * lisp/subr.el (eval-after-load, set-temporary-overlay-map): Use indirection
through a symbol rather than letrec.
2013-06-14 00:11:00 -04:00
Stefan Monnier
de0503df97 * lisp/subr.el (with-eval-after-load): New macro.
(eval-after-load): Allow form to be a function.
take advantage of lexical-binding.
(do-after-load-evaluation): Use dolist and adjust to new format.
* lisp/simple.el (bad-packages-alist): Use dolist and with-eval-after-load.
* doc/lispref/loading.texi (Hooks for Loading): Document with-eval-after-load
instead of eval-after-load.  Don't document after-load-alist.
* src/lread.c (syms_of_lread):
* src/fns.c (Fprovide): Adjust to new format of after-load-alist.
2013-06-13 18:24:52 -04:00
Vitalie Spinu
c23d55f45b * lisp/subr.el (internal-push-keymap, internal-pop-keymap): New functions.
(set-temporary-overlay-map): Use them; and take advantage of
lexical-binding.

Fixes: debbugs:14095
2013-06-13 16:43:53 -04:00
Stefan Monnier
5a3eb0c6e4 * lisp/subr.el (function-arity): Remove (mistakenly added).
Fixes: debbugs:14590
2013-06-11 17:53:40 -04:00
Juanma Barranquero
fa6bc6fd50 Fix typos.
* lisp/replace.el (query-replace, occur-read-regexp-defaults-function)
  (replace-search):
* lisp/subr.el (declare-function, number-sequence, local-set-key)
  (substitute-key-definition, locate-user-emacs-file)
  (with-silent-modifications, split-string, eval-after-load):
  Fix typos, remove unneeded backslashes and reflow some docstrings.
2013-06-11 18:51:12 +02:00
Stefan Monnier
781b4af61d * lisp/emacs-lisp/edebug.el (edebug-result): Move before first use.
* lisp/subr.el (load-history-regexp, load-history-filename-element)
(eval-after-load, after-load-functions, do-after-load-evaluation)
(eval-next-after-load, display-delayed-warnings)
(collapse-delayed-warnings, delayed-warnings-hook): Move after the
definition of save-match-data.
(overriding-local-map): Remove accidental obsolescence declaration.
2013-06-05 10:57:45 -04:00
Stefan Monnier
bfa3acd65b * src/keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
* src/keyboard.c (menu_bar_items, tool_bar_items):
* src/doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
not override local keymaps any more.
2013-06-04 21:58:43 -04:00
Michael Albinus
c9628c79bb * configure.ac (file-notification): New option, replaces inotify option.
(HAVE_W32): Remove w32notify.o.
(with_file_notification): Add checks for glib and w32. Adapt check
for inotify.
(Summary): Add entry for file notification.

* autogen/config.in: Add entries for HAVE_GFILENOTIFY,
HAVE_W32NOTIFY and USE_FILE_NOTIFY.

* lisp/autorevert.el (auto-revert-notify-enabled)
(auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
(auto-revert-notify-event-p, auto-revert-notify-event-file-name)
(auto-revert-notify-handler): Handle also gfilenotify.

* lisp/subr.el: (file-notify-handle-event): New defun. Replacing ...
(inotify-event-p, inotify-handle-event, w32notify-handle-event):
Removed.

* src/Makefile.in (NOTIFY_OBJ): New variable.
(base_obj): Replace inotify.o by $(NOTIFY_OBJ).

* src/emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
Call syms_of_gfilenotify.

* src/gfilenotify.c: New file.

* src/keyboard.c (Qfile_notify): New variable.  Replaces Qfile_inotify
and Qfile_w32notify.
(top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
HAVE_W32NOTIFY and USE_FILE_NOTIFY.

* src/lisp.h: Declare syms_of_gfilenotify.

* src/termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
2013-06-03 15:03:05 +02:00
Juri Linkov
e5e4a94293 Search and highlight symbol at point.
* doc/emacs/display.texi (Highlight Interactively): Add global keybindings
with the key prefix `M-s h'.  Document old command `highlight-phrase'.
Document new command `highlight-symbol-at-point'.

* lisp/bindings.el (search-map): Bind `highlight-symbol-at-point' to
`M-s h .'. 

* lisp/hi-lock.el (highlight-symbol-at-point): New alias for the new
command `hi-lock-face-symbol-at-point'.
(hi-lock-face-symbol-at-point): New command.
(hi-lock-map): Bind `highlight-symbol-at-point' to `C-x w .'.
(hi-lock-menu): Add `highlight-symbol-at-point'.
(hi-lock-mode): Doc fix.

* lisp/isearch.el (isearch-forward-symbol-at-point): New command.
(search-map): Bind `isearch-forward-symbol-at-point' to `M-s .'.
(isearch-highlight-regexp): Add a regexp which matches
words/symbols for word/symbol mode.

* lisp/subr.el (find-tag-default-bounds): New function with the body
mostly moved from `find-tag-default'.
(find-tag-default): Move most code to `find-tag-default-bounds',
call it and apply `buffer-substring-no-properties' afterwards.

Fixes: debbugs:14427
2013-06-03 11:51:50 +03:00
Eli Zaretskii
bc1dd793bd Rename unmsys--filename to unmsys--file-name. 2013-05-25 19:05:19 +03:00
Eli Zaretskii
a052ef3bef Rename reveal-filename into unmsys--filename.
lisp/subr.el (unmsys--filename): Renamed from reveal-filename.
 lisp/Makefile.in (custom-deps, finder-data, autoloads)
 ($(MH_E_DIR)/mh-loaddefs.el, $(TRAMP_DIR)/tramp-loaddefs.el)
 ($(CAL_DIR)/cal-loaddefs.el, $(CAL_DIR)/diary-loaddefs.el)
 ($(CAL_DIR)/hol-loaddefs.el): All users changed.

 leim/Makefile.in (leim-list.el, check-declare): Replace
 reveal-filename with unmsys--filename.
2013-05-25 10:19:50 +03:00
Leo Liu
c7a8fcacf9 * subr.el (delete-consecutive-dups): New function.
* ido.el (ido-set-matches-1): Use it.
* progmodes/octave.el (inferior-octave-completion-table): Use it.
* ido.el (ido-remove-consecutive-dups): Remove.
2013-05-17 10:43:41 +08:00
Eli Zaretskii
629ecae369 Fix comments to reveal-filename. 2013-05-16 13:14:30 +03:00
Eli Zaretskii
d14365f941 Merge from trunk, configury not fixed yet. 2013-05-15 19:15:07 +03:00
Juri Linkov
180ed21842 * lisp/subr.el (find-tag-default-as-regexp): Return nil if `tag' is nil.
Fixes: debbugs:14390
2013-05-15 02:38:14 +03:00
Glenn Morris
0114073ac0 * subr.el (user-emacs-directory-warning): New option.
(locate-user-emacs-file): Handle non-accessible .emacs.d. 

Not in NEWS, because you only need to know about this if you encounter
it in the wild.

Fixes: debbugs:13930
2013-05-14 09:01:16 -07:00
Eli Zaretskii
b1cb82edff Merge from trunk. 2013-05-01 20:47:50 +03:00
Juri Linkov
0208ede7ab * src/callint.c (Fcall_interactively): Call `Qread_number' for
interactive code letter `n' instead of using duplicate code.

* lisp/subr.el (read-number): Doc fix about using it by interactive
code letter `n'.

Fixes: debbugs:14254
2013-04-28 00:12:17 +03:00
Glenn Morris
af80458d7e Merge from emacs-24; up to 2012-12-27T08:21:08Z!rgm@gnu.org 2013-04-26 00:34:54 -07:00
Glenn Morris
e5271cf20c * subr.el (read-number): Once more use `read'
rather than `string-to-number', to trap non-numeric input.

Fixes: debbugs:14254
2013-04-24 10:31:43 -07:00
Eli Zaretskii
1c0977a951 Add reveal-filename function instead of 3 set-generated-*-file funcs, as suggested by Glenn Morris. 2013-04-19 11:42:34 +03:00
Stefan Monnier
d36ed1c8e7 * lisp/subr.el (with-wrapper-hook): Declare obsolete.
* lisp/simple.el (filter-buffer-substring-function): New hook.
(filter-buffer-substring): Use it.
(filter-buffer-substring-functions): Mark obsolete.
* lisp/minibuffer.el (completion-in-region-function): New hook.
(completion-in-region): Use it.
(completion-in-region-functions): Mark obsolete.
* lisp/mail/mailabbrev.el (mail-abbrevs-setup): Use abbrev-expand-function.
* lisp/abbrev.el (abbrev-expand-function): New hook.
(expand-abbrev): Use it.
(abbrev-expand-functions): Mark obsolete.
* lisp/emacs-lisp/nadvice.el (advice--where-alist): Add :filter-args
and :filter-return.
* lisp/org/org-agenda.el (org-agenda-mode):
* lisp/org/org-indent.el (org-indent-mode): Use the `local' arg of
add-hook/remove-hook.
2013-04-17 20:12:33 -04:00
Ted Zlatanov
0b93819010 Move forward-whitespace, forward-symbol, forward-same-syntax commands to subr.el. Use forward-symbol in supermode.el again.
* subr.el (forward-whitespace, forward-symbol)
(forward-same-syntax): Move from thingatpt.el.

* progmodes/subword.el: Back to using `forward-symbol'.
2013-03-29 21:32:12 -04:00
Stefan Monnier
9a1ff1644d * lisp/subr.el (posn-point, posn-string): Fix it here instead.
* lisp/mouse.el (mouse-on-link-p): Undo scroll-bar fix.

Fixes: debbugs:13979
2013-03-20 14:13:00 -04:00
Glenn Morris
48c6afa6a4 Fix doc typo in previous change 2013-03-08 00:11:59 -08:00
Jambunathan K
eb1a6e153a Provide for customizing default regexp in hi-lock commands (Bug#13892).
* lisp/hi-lock.el (hi-lock-read-regexp-defaults-function): New var.
(hi-lock-read-regexp-defaults):	 New defun.
(hi-lock-line-face-buffer, hi-lock-face-buffer)
(hi-lock-face-phrase-buffer): Propagate above change.  Update
docstring.

* lisp/subr.el (find-tag-default-as-regexp): New defun.
* lisp/replace.el (read-regexp): Propagate above change.
2013-03-08 09:48:16 +05:30
Eli Zaretskii
2d0504232e subr.el (buffer-file-type, default-buffer-file-type): Remove. 2013-02-09 18:20:29 +02:00
Stefan Monnier
37a5665636 * lisp/url/url-cache.el (url-cache-create-filename-using-md5): Don't waste your
time `requiring' a builtin feature.
* lisp/subr.el (internal--called-interactively-p--get-frame): Remove
left-over message.
2013-02-03 11:13:36 -05:00
Stefan Monnier
659a901046 * lisp/subr.el (internal--called-interactively-p--get-frame): Avoid filling
current-load-list.

Fixes: debbugs:13366
2013-02-03 10:28:47 -05:00
Stefan Monnier
e5b5a34dd1 * lisp/jit-lock.el (jit-lock-debug-mode): New minor mode.
(jit-lock--debug-fontifying): New var.
(jit-lock--debug-fontify): New function.
* lisp/subr.el (condition-case-unless-debug): Don't prevent catching the
error, just let the debbugger run.
* lisp/emacs-lisp/timer.el (timer-event-handler): Don't prevent debugging
timer code and don't drop errors silently.
2013-01-12 20:23:48 -05:00
Stefan Monnier
c0bd248ccb * lisp/subr.el (internal--called-interactively-p--get-frame): Find aliases
of called-interactively-p as well.

Fixes: debbugs:13237
2013-01-03 22:42:11 -05:00
Glenn Morris
0a8bf3afca Merge from emacs-24; up to 2012-12-06T07:33:20Z!rgm@gnu.org 2013-01-02 18:37:57 -08:00
Glenn Morris
ed5bdeb968 eval-after-load fix
* lisp/subr.el (eval-after-load): Don't purecopy the form, so that it
can be nconc'd later on; reverts 2009-11-11 change.

Fixes: debbugs:13331
2013-01-02 16:50:35 -08:00
Paul Eggert
0877d0dc24 Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca 2013-01-02 08:13:04 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Stefan Monnier
96c052a5d1 * lisp/subr.el (special-form-p): Don't signal errors on undef aliases. 2012-12-30 23:43:35 -05:00
Eli Zaretskii
3907e630a7 Merge from trunk + rename the event. Not tested yet. 2012-12-10 14:08:02 +02:00
Rüdiger Sonderfeld
81606b1050 Support filesystem notification through inotify on GNU/Linux.
configure.ac (inotify): New option.
 (HAVE_INOTIFY): Test for inotify.

 src/termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
 FILE_NOTIFY_EVENT.
 src/lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
 src/keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
 (syms_of_keyboard): DEFSYM it.
 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
 Qfile_inotify events.
 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
 special-event-map to inotify-handle-event.
 src/emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
 src/Makefile.in (base_obj): Add inotify.o.
 src/inotify.c: New file.

 lisp/subr.el (inotify-event-p, inotify-handle-event): New functions.

 test/automated/inotify-test.el: New test.
2012-12-10 06:17:21 -05:00
Chong Yidong
454eb09524 * subr.el (text-clone-maintain): Fix clone overlay deletion
when a syntax is specified.

Fixes: debbugs:13025
2012-12-08 00:25:28 +08:00
Paul Eggert
f24f2e22aa Spelling fixes. 2012-12-06 18:37:20 -08:00
Glenn Morris
5c9cf0a3f9 Merge from emacs-24; up to 2012-11-20T20:06:17Z!monnier@iro.umontreal.ca 2012-11-26 19:10:32 -08:00
Eli Zaretskii
33a488e4e6 Partial fix for bug #12989 with buffer-file-type annoyances.
lisp/subr.el (buffer-file-type): Declare with defvar-local.  Doc fix.
 lisp/dos-w32.el (find-file-not-found-set-buffer-file-coding-system):
 Don't set buffer-file-type.  Return nil.
2012-11-26 19:09:04 +02:00
Stefan Monnier
23ba2705e2 Make called-interactively-p work for edebug or advised code.
* lisp/subr.el (called-interactively-p-functions): New var.
(internal--called-interactively-p--get-frame): New macro.
(called-interactively-p, interactive-p): Rewrite in Lisp.
* lisp/emacs-lisp/nadvice.el (advice--called-interactively-skip): New fun.
(called-interactively-p-functions): Use it.
* lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): New fun.
(called-interactively-p-functions): Use it.
* lisp/allout.el (allout-called-interactively-p): Don't assume
called-interactively-p is a subr.
* src/eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
(syms_of_eval): Remove corresponding defsubr.
* src/bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
* test/automated/advice-tests.el (advice-tests--data): Remove.
(advice-tests): Move the tests directly here instead.
Add called-interactively-p tests.
2012-11-19 23:24:09 -05:00