Xue Fuqiao [Sat, 10 Aug 2013 04:58:31 +0000 (12:58 +0800)]
* doc/misc/ido.texi (Working Directories):
(Flexible Matching, Regexp Matching, Find File At Point)
(Ignoring, Misc Customization): Use @defopt for user options.
Eli Zaretskii [Fri, 9 Aug 2013 10:18:48 +0000 (13:18 +0300)]
Define a few variables of obscure types to aid debugging exceptions on Windows.
src/w32.c (PEXCEPTION_POINTERS, PEXCEPTION_RECORD, PCONTEXT): Define
variables of these types so that GDB would know about them, as aid
for debugging fatal exceptions. (Bug#15024) See also
http://sourceware.org/ml/gdb/2013-08/msg00010.html for related
discussions.
Katsumi Yamaoka [Fri, 9 Aug 2013 08:05:56 +0000 (08:05 +0000)]
Gnus: delete temporary files when Gnus exits instead of using timers
lisp/gnus/mm-decode.el (mm-temp-files-to-be-deleted,
mm-temp-files-cache-file): New internal variables.
(mm-temp-files-delete): New function; add it to gnus-exit-gnus-hook.
(mm-display-external): Use it to delete temporary files instead of
using timers.
lisp/frameset.el (frameset-p): Add autoload cookie.
(frameset--jump-to-register): New function, based on code moved from
register.el.
(frameset-to-register): Move from register.el. Adapt to `registerv'.
* lisp/comint.el:
Do not use an overlay to highlight the last prompt. (Bug#14744)
(comint-mode): Make comint-last-prompt buffer local.
(comint-last-prompt): New variable.
(comint-last-prompt-overlay): Remove. Superseded by
comint-last-prompt.
(comint-snapshot-last-prompt, comint-output-filter): Use
comint-last-prompt.
Dmitry Antipov [Thu, 8 Aug 2013 14:51:07 +0000 (18:51 +0400)]
Redesign redisplay interface to drop global variable updated_window.
Always pass currently updated window as a parameter to update routines.
* dispextern.h (updated_window): Remove declaration.
(struct redisplay_interface): Pass window parameter to
write_glyphs, insert_glyphs, clear_end_of_line, cursor_to
and after_update_window_hook.
(x_write_glyphs, x_insert_glyphs, x_clear_end_of_line, x_cursor_to):
Adjust prototypes.
* dispnew.c (updated_window): Remove.
(redraw_overlapped_rows, update_marginal_area, update_text_area)
(update_window_line): Adjust to match redisplay interface changes.
* nsterm.m (ns_update_window_begin, ns_update_window_end)
(ns_scroll_run, ns_after_update_window_line):
* w32term.c (x_update_window_begin, x_update_window_end)
(x_after_update_window_line, x_scroll_run):
* xterm.c (x_update_window_begin, x_update_window_end)
(x_after_update_window_line, x_scroll_run):
* xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
Likewise. Adjust comments where appropriate.
(x_cursor_to): Simplify because this is always called during window
update (but install debugging check anyway).
(expose_window): Check must_be_updated_p flag to see whether this
function is called during window update.
lisp/frameset.el: Revert to built-in frameset-p; document slot accessors.
(frameset): Do not disable creation of the default frameset-p predicate.
Doc fix.
(frameset-valid-p): New function, copied from the old predicate-p.
Add additional checks.
(frameset-restore): Check with frameset-valid-p.
(frameset-p, frameset-version, frameset-timestamp, frameset-app)
(frameset-name, frameset-description, frameset-properties)
(frameset-states): Add docstring.
Dmitry Antipov [Thu, 8 Aug 2013 04:42:40 +0000 (08:42 +0400)]
Do not reset window modification event counters excessively.
These leftovers and poor man's tricky methods to catch extra
redisplay's attention are no longer needed.
* frame.c (set_menu_bar_lines_1):
* minibuf.c (read_minibuf_unwind):
* window.c (Fset_window_start, set_window_buffer, window_resize_apply)
(grow_mini_window, shrink_mini_window, window_scroll_pixel_based)
(window_scroll_line_based, Fset_window_configuration):
* xdisp.c (redisplay_window): Do not reset last_modified and
last_overlay_modified counters.
Stefan Monnier [Thu, 8 Aug 2013 01:37:47 +0000 (21:37 -0400)]
* lisp/emacs-lisp/bytecomp.el (byte-compile-function-warn): New function,
extracted from byte-compile-callargs-warn and byte-compile-normal-call.
(byte-compile-callargs-warn, byte-compile-function-form): Use it.
(byte-compile-normal-call): Remove obsolescence check.
lisp/frameset.el: Convert `frameset' to vector and add new slots.
(frameset): Use type vector, not list (incompatible change).
Do not declare a new constructor, use the default one.
Upgrade suggested properties `app', `name' and `desc' to slots `app',
`name' and `description', respectively, and add read-only slot `timestamp'.
Doc fixes.
(frameset-copy, frameset-persistent-filter-alist)
(frameset-filter-alist, frameset-switch-to-gui-p)
(frameset-switch-to-tty-p, frameset-filter-tty-to-GUI)
(frameset-filter-sanitize-color, frameset-filter-minibuffer)
(frameset-filter-iconified, frameset-keep-original-display-p):
Doc fixes.
(frameset-filter-shelve-param, frameset-filter-unshelve-param):
Rename from frameset-filter-(save|restore)-param. All callers changed.
Doc fix.
(frameset-p): Adapt to change to vector and be more thorough.
Change arg name to OBJECT. Doc fix.
(frameset-prop): Rename arg PROP to PROPERTY. Doc fix.
(frameset-session-filter-alist): Rename from frameset-live-filter-alist.
All callers changed.
(frameset-frame-with-id): Rename from frameset-locate-frame-id.
All callers changed.
(frameset--record-minibuffer-relationships): Rename from
frameset--process-minibuffer-frames. All callers changed.
(frameset-save): Add new keyword arguments APP, NAME and DESCRIPTION.
Use new default constructor (again). Doc fix.
(frameset--find-frame-if): Rename from `frameset--find-frame.
All callers changed.
(frameset--reuse-frame): Rename arg FRAME-CFG to PARAMETERS.
(frameset--initial-params): Rename arg FRAME-CFG to PARAMETERS.
Doc fix.
(frameset--restore-frame): Rename args FRAME-CFG and WINDOW-CFG to
PARAMETERS and WINDOW-STATE, respectively.
(frameset-restore): Add new keyword argument PREDICATE.
Reset frameset--target-display to nil. Doc fix.
lisp/desktop.el (desktop-save-frameset): Use new frameset-save args.
Use lexical-binding.
Stefan Monnier [Wed, 7 Aug 2013 22:53:18 +0000 (18:53 -0400)]
* lisp/progmodes/bat-mode.el (bat--syntax-propertize): New var.
(bat-mode): Use it.
(bat-mode-syntax-table): Mark \n as end-of-comment.
(bat-font-lock-keywords): Remove comment rule.
Stefan Monnier [Wed, 7 Aug 2013 17:33:30 +0000 (13:33 -0400)]
* lisp/emacs-lisp/bytecomp.el: Check existence of f in #'f.
(byte-compile-callargs-warn): Use `push'.
(byte-compile-arglist-warn): Ignore higher-order "calls".
(byte-compile-file-form-autoload): Use `pcase'.
(byte-compile-function-form): If quoting a symbol, check that it exists.
Eli Zaretskii [Wed, 7 Aug 2013 16:37:04 +0000 (19:37 +0300)]
Minor fixes in lisp/progmodes/dos.el.
lisp/progmodes/dos.el (dos-font-lock-keywords): Rename LINUX to UNIX
and add a few popular commands found in batch files.
(dos, dos-label-face, dos-cmd-help, dos-run, dos-run-args)
(dos-mode): Doc fixes.
Stefan Monnier [Wed, 7 Aug 2013 15:50:16 +0000 (11:50 -0400)]
* lisp/progmodes/dos.el (auto-mode-alist): Add entries for dos-mode.
(dos-mode): Use setq-local. Add space after "rem".
(dos-mode-syntax-table): Don't use "w" for symbol chars.
(dos-font-lock-keywords): Try to adjust font-lock rules accordingly.
Eli Zaretskii [Wed, 7 Aug 2013 14:15:23 +0000 (17:15 +0300)]
Minor fixes in the ToDo Mode manual.
doc/misc/todo-mode.texi: Update @dircategory.
(Overview, Todo Items as Diary Entries, Todo Mode Entry Points)
(File Editing, Marked Items, Item Prefix): Fix usage of @xref and
@ref.
Eli Zaretskii [Wed, 7 Aug 2013 13:58:41 +0000 (16:58 +0300)]
Fix bug #15038 with incorrect Texinfo in Emacs Lisp Intro manual.
doc/lispintro/emacs-lisp-intro.texi (Beginning init File): Rename from
"Beginning a .emacs File", since a node name cannot include a
period.
(Top, Emacs Initialization, Change a defun): All references
changed.
Dmitry Antipov [Wed, 7 Aug 2013 10:32:08 +0000 (14:32 +0400)]
Be more careful if selected window shows the buffer other than current,
use window_outdated only if this is not so. This change should also
address some weird issues discussed in Bug#13012.
* window.h (window_outdated): New prototype.
* window.c (window_outdated): Now here. Convert from static and
always assume window's buffer.
(Fwindow_end, Fwindow_line_height): Use it.
* xdisp.c (reconsider_clip_changes): Remove prototype, drop 2nd arg
and always assume window's buffer.
(redisplay_window): Adjust user.
(redisplay_internal): Call to reconsider_clip_change once and
check whether mode line should be updated only if selected window
shows current buffer.
(run_window_scroll_functions): Use eassert for debugging check.
(Fmove_point_visually, note_mouse_highlight): Use window_outdated.
Glenn Morris [Tue, 6 Aug 2013 23:53:49 +0000 (19:53 -0400)]
calendar.el: Add new faces, and day-header-array
* lisp/calendar/calendar.el (calendar-weekday-header)
(calendar-weekend-header, calendar-month-header): New faces.
(calendar-day-header-construct): New function.
(calendar-day-header-width): Also :set calendar-day-header-array.
(calendar-american-month-header, calendar-european-month-header)
(calendar-iso-month-header): Use calendar- faces.
(calendar-generate-month):
Use calendar-day-header-array for day headers; apply faces to them.
(calendar-mode): Check calendar-font-lock-keywords non-nil.
(calendar-abbrev-construct): Add optional maxlen argument.
(calendar-day-name-array): Doc fix.
(calendar-day-name-array, calendar-abbrev-length)
(calendar-day-abbrev-array):
Also :set calendar-day-header-array, and maybe redraw.
(calendar-day-header-array): New option.
(calendar-font-lock-keywords): Use calendar-day-header-array,
and calendar- faces. Make obsolete.
(calendar-day-name): Add option to use header array.
* net/shr.el (shr-render-td): Remove debugging.
(shr-render-td): Make width computation consistent by defaulting
all zero-width columns to 10 characters. This may not be optimal,
but it's at least consistent.
Paul Eggert [Tue, 6 Aug 2013 14:17:25 +0000 (07:17 -0700)]
* process.c: Fix minor off-by-one issues in descriptor counts.
This shouldn't fix any real bugs, but it cleans up the code a bit.
(max_process_desc, max_input_desc): -1, not 0, means none.
All uses changed.
(delete_input_desc): New function.
(delete_write_fd, delete_keyboard_wait_descriptor): Use it.
(deactivate_process): Scan backwards when recomuting max_process_desc;
that should be faster.
(init_process_emacs): Initialize max_input_desc.
Dmitry Antipov [Tue, 6 Aug 2013 06:53:09 +0000 (10:53 +0400)]
Use region cache to speedup bidi_find_paragraph_start.
* src/buffer.h (struct buffer): New member bidi_paragraph_cache.
Rename cache_long_line_scans to cache_long_scans.
* src/buffer.c (bset_cache_long_line_scans): Rename to
bset_cache_long_scans.
(Fget_buffer_create, Fmake_indirect_buffer, Fkill_buffer)
(Fbuffer_swap_text, init_buffer_once): Take bidi_paragraph_cache
into account.
(syms_of_buffer): Rename cache-long-line-scans to
cache-long-scans. Adjust docstring.
* src/search.c (newline_cache_on_off):
* src/indent.c (width_run_cache_on_off): Adjust users.
* src/bidi.c (bidi_paragraph_cache_on_off): New function.
(bidi_find_paragraph_start): Use bidi_paragraph_cache if needed.
* src/insdel.c (prepare_to_modify_buffer): Invalidate
bidi_paragraph_cache if enabled.
* doc/lispref/positions.texi (Motion by Screen Lines):
* doc/lispref/display.texi (Truncation): Rename `cache-long-line-scans'
to `cache-long-scans'.
lisp/frameset.el: Various fixes.
(frameset-p): Don't check non-nullness of the `properties'
slot , which can indeed be nil.
(frameset-live-filter-alist, frameset-persistent-filter-alist):
Move entry for `left' from persistent to live filter alist.
(frameset-filter-alist, frameset--minibufferless-last-p, frameset-save):
Doc fixes.
(frameset-filter-params): When restoring a frame, copy items added to
`filtered', to avoid unwittingly modifying the original parameters.
(frameset-move-onscreen): Rename from frameset--move-onscreen. Doc fix.
(frameset--restore-frame): Fix reference to frameset-move-onscreen.
Stefan Monnier [Mon, 5 Aug 2013 18:05:46 +0000 (14:05 -0400)]
Revert introduction of isearch-filter-predicates.
Rely on add-function instead.
* lisp/loadup.el: Preload nadvice.
* lisp/isearch.el (isearch-filter-predicates): Rename it back to
isearch-filter-predicate.
(isearch-message-prefix): Use advice-function-mapc and advice
properties to get the isearch-message-prefix.
(isearch-search, isearch-lazy-highlight-search): Revert to funcall
instead of run-hook-with-args-until-failure.
(isearch-filter-visible): Not obsolete any more.
* lisp/replace.el (perform-replace): Revert to funcall
instead of run-hook-with-args-until-failure.
* lisp/wdired.el (wdired-change-to-wdired-mode): Use add-function.
* lisp/dired-aux.el (dired-isearch-filenames-mode): Rename from
dired-isearch-filenames-toggle; make it into a proper minor mode.
Use add/remove-function.
(dired-isearch-filenames-setup, dired-isearch-filenames-end):
Call the minor-mode rather than add/remove-hook.
(dired-isearch-filter-filenames):
Remove isearch-message-prefix property.
* lisp/info.el (Info--search-loop): New function, extracted from Info-search.
Funcall isearch-filter-predicate instead of
run-hook-with-args-until-failure isearch-filter-predicates.
(Info-search): Use it.
(Info-mode): Use isearch-filter-predicate instead of
isearch-filter-predicates.
* src/lisp.mk (lisp): Add nadvice.elc.
* lib-src/makefile.w32-in (lisp2): Add nadvice.elc.
Eli Zaretskii [Mon, 5 Aug 2013 17:09:28 +0000 (20:09 +0300)]
Fix bugs in update-game-score, on MS-Windows and elsewhere.
lib-src/update-game-score.c (read_score): Try reading a character before
probing the stream for EOF. Initialize score->score to zero,
before reading and accumulating the score.
(read_scores): Fix logic that determines which value to return.
Close the input stream when finished reading the scores (avoids
failures in overwriting the file with a new one on MS-Windows,
since a file that is open cannot be deleted).
lib-src/ntlib.h (rename): Don't undefine.
lib-src/ntlib.c (sys_rename): New function, needed for
update-game-score.
* lisp/frameset.el: Miscellaneous cleanups.
(frameset): Add docstring. Move :version property to its
own `version' slot.
(frameset-copy): Rename from copy-frameset.
(frameset-p): Check more thoroughly.
(frameset-prop): Do not check for :version, which is no longer a prop.
(frameset-live-filter-alist, frameset-persistent-filter-alist):
Use new :never value instead of t.
(frameset-filter-alist): Expand and clarify docstring.
(frameset-filter-tty-to-GUI, frameset-filter-sanitize-color)
(frameset-filter-minibuffer, frameset-filter-save-param)
(frameset-filter-restore-param, frameset-filter-iconified):
Add pointer to docstring of frameset-filter-alist.
(frameset-filter-params): Rename filter values to be more meaningful:
:never instead of t, and reverse the meanings of :save and :restore.
(frameset--process-minibuffer-frames): Clarify error message.
(frameset-save): Avoid unnecessary and confusing call to framep.
Use new BOA constructor for framesets.
(frameset--reuse-list): Doc fix.
(frameset--restore-frame): Rename from frameset--get-frame. Doc fix.
(frameset--minibufferless-last-p): Rename from frameset--sort-states.
(frameset-minibufferless-first-p): Doc fix.
Rename from frameset-sort-frames-for-deletion.
(frameset-restore): Doc fixes. Use new function names.
Most changes suggested by Drew Adams <drew.adams@oracle.com>.
* lisp/desktop.el (desktop-clear): Use new name of sort predicate.
Glenn Morris [Mon, 5 Aug 2013 01:32:00 +0000 (18:32 -0700)]
Extract truncate-string-to-width tests to a separate file
* test/automated/mule-util.el: New file, with tests extracted from
lisp/international/mule-util.el.
Copyright years based on when the original test-suite comment was
added to lisp/international/mule-util.el (in 2002).
* lisp/international/mule-util.el: Extract comment test-suite out to
separate file.
* lisp/frameset.el: Add new predicate values for frameset-restore args.
(frameset-live-filter-alist, frameset-persistent-filter-alist):
New variables.
(frameset-filter-alist): Use them. Add autoload cookie.
(frameset-filter-tty-to-GUI): Move from desktop.el and rename.
(frameset--set-id, frameset--reuse-frame): Rename `frame-id' to
`frameset--id' (it's supposed to be internal to frameset.el).
(frameset--process-minibuffer-frames): Ditto. Doc fix.
(frameset--initial-params): New function.
(frameset--get-frame): Use it. Doc fix.
(frameset--move-onscreen): Accept new PRED value for FORCE-ONSCREEN.
Accept :all, not 'all.
(frameset-restore): Add new predicate values for FORCE-ONSCREEN and
FORCE-DISPLAY. Use :keywords for constant arguments to avoid collision
with fbound symbols. Fix frame id matching, and remove matching ids if
the frame being restored is deleted. Obey :delete.
* lisp/desktop.el (desktop-restore-forces-onscreen)
(desktop-restore-reuses-frames): Document :keyword constant values.
(desktop-filter-parameters-alist): Remove, now identical to
frameset-filter-alist.
(desktop--filter-tty*): Remove, moved to frameset.el.
(desktop-save-frameset, desktop-restore-frameset):
Do not pass :filters argument.
Stefan Monnier [Sun, 4 Aug 2013 20:18:11 +0000 (16:18 -0400)]
* lisp/subr.el (macrop): New function.
(text-clone--maintaining): New var.
(text-clone--maintain): Rename from text-clone-maintain. Use it
instead of inhibit-modification-hooks.
* lisp/emacs-lisp/nadvice.el (advice--normalize): For aliases to macros, use
a proxy, so as handle autoloads and redefinitions of the target.
(advice--defalias-fset, advice-remove): Use advice--symbol-function.
* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Remove bogus (arrayp . stringp) pair. Add entries for `vectorp'.
(pcase--mutually-exclusive-p): New function.
(pcase--split-consp): Use it.
(pcase--split-pred): Use it. Optimize the case where `pat' is a qpat
mutually exclusive with the current predicate.
* test/automated/advice-tests.el (advice-tests-nadvice): Test removal
before definition.
(advice-tests-macroaliases): New test.
* lisp/emacs-lisp/edebug.el (edebug-lookup-function): Remove function.
(edebug-macrop): Remove. Use `macrop' instead.
* lisp/emacs-lisp/advice.el (ad-subr-p): Remove. Use `subrp' instead.
(ad-macro-p):
* lisp/eshell/esh-cmd.el (eshell-macrop):
* lisp/apropos.el (apropos-macrop): Remove. Use `macrop' instead.