* lisp/vc/vc-dispatcher.el: Use lexical-binding.
(vc--process-sentinel): Rename from vc-process-sentinel.
Change last arg to be the code to run. Don't use vc-previous-sentinel
and vc-sentinel-commands any more.
(vc-exec-after): Allow code to be a function. Use add/remove-function.
(compilation-error-regexp-alist, view-old-buffer-read-only): Declare.
Erik Charlebois [Sat, 20 Apr 2013 07:32:31 +0000 (10:32 +0300)]
Better full-screen frame support on MS-Windows.
src/w32fns.c (w32_fullscreen_rect): New function to compute the
window rectangle for the given fullscreen mode.
(w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
longer tunes the window size. This keeps the window's edges flush
with the screen and allows the taskbar to hide itself in fullboth.
src/w32term.c (w32fullscreen_hook): 'fullboth' now shows without
window decorations and uses the entire screen.
src/w32term.h (w32_fullscreen_rect) Add prototype.
(struct w32_output): Replace normal_width, normal_height,
normal_top, and normal_left members with a single normal_placement
struct.
(FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
Remove macros.
(FRAME_NORMAL_PLACEMENT): New macro.
* files.el (auto-mode-alist): Delete OpenDocument and StarOffice
file extensions from the archive-mode entry in order to prefer
doc-view-mode-maybe with archive-mode as fallback (bug#14188).
Replace AC_PROG_LN_S by a less strict configure test
* configure.ac (AC_PROG_LN_S): Remove, too restrictive.
(LN_S_FILEONLY): New output variable.
* Makefile.in (LN_S): Remove.
(LN_S_FILEONLY): New, set by configure.
(install-arch-dep): Use LN_S_FILEONLY rather than LN_S.
Stefan Monnier [Thu, 18 Apr 2013 00:12:33 +0000 (20:12 -0400)]
* 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.
Stefan Monnier [Wed, 17 Apr 2013 20:52:02 +0000 (16:52 -0400)]
* lisp/emacs-lisp/lisp.el (lisp-completion-at-point): Provide specialized
completion tables when completing error conditions and
`declare' arguments.
(lisp-complete-symbol, field-complete): Mark as obsolete.
(check-parens): Unmatched parens are user errors.
* lisp/minibuffer.el (minibuffer-completion-contents): Mark as obsolete.
textmodes/flyspell.el: Don't check pre-word if buffer was switched.
If command changed the buffer, the decision may be made based on the
current buffer even though it should based on the previous one. This
may lead to false positives and more importantly to errors since
`flyspell-pre-point' is buffer local so it may have unsanitised value
(such as nil) in previous buffer.
To be honest, I'm not sure how this can happen since
`flyspell-pre-point' is set in previous buffer, but nonetheless, I've
been encountering the error for quite some time and finally decided to
fix it. Interestingly, line making `flyspell-pre-point'
a buffer-local variable has a very revealing "Why?? --Stef" comment.
To avoid the problem, change flyspell-check-pre-word-p so that it does
not allow checking of pre-word if command changed buffer
(ie. `flyspell-pre-buffer' is not current buffer).
* progmodes/python.el (python-syntax--context-compiler-macro): New defun.
(python-syntax-context): Use named compiler-macro for backwards
compatibility with Emacs 24.x.
Stefan Monnier [Tue, 16 Apr 2013 17:28:11 +0000 (13:28 -0400)]
* lisp/progmodes/python.el (python-mode-skeleton-abbrev-table): Rename from
python-mode-abbrev-table.
(python-skeleton-define): Adjust accordingly.
(python-mode-abbrev-table): New table that inherits from it so that
python-skeleton-autoinsert does not affect non-skeleton abbrevs.
* lisp/abbrev.el (abbrev--symbol): New function, extracted from abbrev-symbol.
(abbrev-symbol): Use it.
(abbrev--before-point): Use it since we already handle inheritance.
* lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun)
(ruby-end-of-defun, ruby-move-to-block): Bind `case-fold-search'
to nil.
(ruby-end-of-defun): Remove the unused arg, change the docstring
to reflect that this function is only used as the value of
`end-of-defun-function'.
(ruby-beginning-of-defun): Remove "top-level" from the docstring,
to reflect an earlier change that beginning/end-of-defun functions
jump between methods in a class definition, as well as top-level
functions.
Stefan Monnier [Mon, 15 Apr 2013 19:55:41 +0000 (15:55 -0400)]
* lisp/minibuffer.el (minibuffer-complete): Don't just scroll
a *Completions* that's been iconified.
(minibuffer-force-complete): Make sure repetitions do cycle when going
through completion-in-region -> minibuffer-complete.
Alan Mackenzie [Mon, 15 Apr 2013 16:10:24 +0000 (16:10 +0000)]
Correct the placement of c-cpp-delimiters when there're #s not at col 0.
* progmodes/cc-langs.el (c-anchored-cpp-prefix): Reformulate and
place a submatch around the #.
* progmodes/cc-mode.el(c-neutralize-syntax-in-and-mark-CPP): Start
a search at BOL. Put the c-cpp-delimiter category text propertiy
on the #, not BOL.
Stefan Monnier [Mon, 15 Apr 2013 15:06:51 +0000 (11:06 -0400)]
* lisp/emacs-lisp/nadvice.el: Properly test names when adding advice.
(advice--member-p): New arg `name'.
(advice--add-function, advice-member-p): Use it.
Alan Mackenzie [Mon, 15 Apr 2013 14:32:20 +0000 (14:32 +0000)]
Reformulate java imenu-generic-expression.
The old expression contained ill formed regexps.
* progmodes/cc-menus.el (cc-imenu-java-ellipsis-regexp)
(cc-imenu-java-type-spec-regexp, cc-imenu-java-comment-regexp)
(cc-imenu-java-method-arg-regexp): New defconsts.
(cc-imenu-java-build-type-args-regex): New defun.
(cc-imenu-java-generic-expression): Fixed, to remove "ambiguous"
handling of spaces in the regexp.
Michael Albinus [Mon, 15 Apr 2013 09:43:20 +0000 (11:43 +0200)]
* net/ange-ftp.el (ange-ftp-run-real-handler-orig): New defun,
uses code from the previous `ange-ftp-run-real-handler'.
(ange-ftp-run-real-handler): Set it to `tramp-run-real-handler'
only in case that function exist. This is needed for proper
unloading of Tramp.
Eli Zaretskii [Mon, 15 Apr 2013 07:27:56 +0000 (10:27 +0300)]
More debugging code to investigate bug #14062.
src/w32fns.c (w32_wnd_proc): Add more assertions to investigate
bug#14062.
src/frame.h (WINDOW_FRAME): Protect macro and its argument with
parentheses.
src/dispextern.h (CURRENT_MODE_LINE_HEIGHT)
(CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
(WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
parentheses where appropriate.
Eli Zaretskii [Sun, 14 Apr 2013 06:51:15 +0000 (09:51 +0300)]
Improve doc strings of left/right-margin/fringe-width.
src/buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
<left-fringe-width, right-fringe-width, fringes-outside-margins>:
Mention in the doc string that setting these variables takes
effect only after a call to set-window-buffer. (Bug#14200)
Erik Charlebois [Sun, 14 Apr 2013 00:58:45 +0000 (20:58 -0400)]
* src/w32fns.c (w32_fullscreen_rect): New function to compute the
window rectangle for the given fullscreen mode.
(w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING
no longer tunes the window size. This keeps the window's edges
flush with the screen and allows the taskbar to hide itself in
fullboth.
* src/w32term.c (w32fullscreen_hook): fullboth now shows without
window decorations and uses the entire screen.
Roland Winkler [Sat, 13 Apr 2013 20:38:52 +0000 (15:38 -0500)]
lisp/textmodes/bibtex.el (bibtex-initialize): If the current buffer does not visit a BibTeX file, exclude it from the list of buffers returned by bibtex-initialize
Eli Zaretskii [Sat, 13 Apr 2013 08:54:02 +0000 (11:54 +0300)]
Fix vertical cursor motion when there are overlay strings at EOL.
src/indent.c (Fvertical_motion): Don't consider display strings on
overlay strings as display strings on the buffer position we
started from. This prevents vertical cursor motion from jumping
more than one line when there's an overlay string with a display
property at end of line.
Reported by Karl Chen <Karl.Chen@quarl.org> in
http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
Eli Zaretskii [Thu, 11 Apr 2013 16:06:47 +0000 (19:06 +0300)]
Fix bug #14170 with window-end returning a stale value.
This bug was introduced in 2012-10-15T09:03:56Z!rudalics@gmx.at
while solving bug #12600.
src/window.c (Fwindow_end): Test more flags, including the buffer's
last_overlay_modified flag, to determine whether the window's
display is really up-to-date. Prevents the function from
returning a stale value.
(Fwindow_line_height): Fix the test for up-to-date-ness of the
current matrix.
Eli Zaretskii [Wed, 10 Apr 2013 15:38:20 +0000 (18:38 +0300)]
Fix bug #13864 with flickering of TTY frames in an emacslient session.
src/frame.c (do_switch_frame): Mark the TTY frame we switch to as
garbaged only if it is not already the top frame on its TTY. This
prevents flickering due to constant redrawing of TTY frames when
there are GUI frames open in the same session.
Stefan Monnier [Wed, 10 Apr 2013 13:31:35 +0000 (09:31 -0400)]
* src/keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
of marking the idle timers directly.
* lisp/emacs-lisp/timer.el (timer--check): New function.
(timer--time, timer-set-function, timer-event-handler): Use it.
(timer-set-idle-time): Simplify.
(timer--activate): CSE.
(timer-event-handler): Give more info in error message.
(internal-timer-start-idle): New function, moved from C.
Stefan Monnier [Wed, 10 Apr 2013 13:17:27 +0000 (09:17 -0400)]
* lisp/mpc.el (mpc-proc): Add `restart' argument.
(mpc-proc-cmd): Use it.
(mpc--status-timer-run): Also catch signals from `mpc-proc'.
(mpc-status-buffer-show, mpc-tagbrowser-dir-toggle): Call `mpc-proc'
less often.
* lisp/progmodes/sh-script.el: Implement `sh-mode' own
`add-log-current-defun-function'.
(sh-current-defun-name): New function.
(sh-mode): Use the function.