Eli Zaretskii [Wed, 30 Sep 2015 19:32:14 +0000 (22:32 +0300)]
Disable some display optimizations when frames need redisplay
These optimizations were previously disabled by the
windows_or_buffers_changed flag, which now is not set
when only some frames need to be redrawn.
* src/xdisp.c (redisplay_internal): Redisplay any frame whose
'redisplay' flag is set.
(try_window_reusing_current_matrix, try_window_id)
(try_cursor_movement): Disable these optimizations when the
frame's 'redisplay' flag is set.
* lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol):
(prettify-symbols--post-command-hook, prettify-symbols-mode): Don't
modify buffer when setting/removing custom prettify-symbols-start/end
text properties. Add them to font-lock-extra-managed-props, too.
Stefan Monnier [Wed, 30 Sep 2015 14:00:13 +0000 (10:00 -0400)]
Try to avoid redisplaying all frames when creating a new one
* src/xfns.c (x_set_menu_bar_lines, x_change_tool_bar_height):
* src/xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
(Finternal_set_lisp_face_attribute, update_face_from_frame_parameter):
* src/frame.c (x_set_screen_gamma): Set the specific frame's
`redisplay' bit rather than windows_or_buffers_changed.
* src/window.c (apply_window_adjustment): Remove redundant setting of
windows_or_buffers_changed.
* src/xdisp.c (redisplay_internal): Set the specific frame's
`redisplay' bit rather than update_mode_lines in response to
cursor_type_changed.
(syms_of_xdisp): Use hash-tables for redisplay_*_cause tables.
(AINC): Adjust accordingly.
* lisp/progmodes/prog-mode.el: Implement feature for unprettifying the
symbol at point.
(prettify-symbols--current-symbol-bounds): New variable.
(prettify-symbols--post-command-hook): New function.
(prettify-symbols-unprettify-at-point): New defcustom.
(prettify-symbols-mode): Use it.
(prettify-symbols--compose-symbol): Use them.
Phil Sainty [Wed, 30 Sep 2015 07:39:21 +0000 (10:39 +0300)]
Avoid empty -path arguments in rgrep
* lisp/progmodes/grep.el (rgrep-default-command): Remove nil from
the list produced according to grep-find-ignored-directories,
before passing it to Find/Grep invocation. (Bug#21548)
Eli Zaretskii [Wed, 30 Sep 2015 07:19:41 +0000 (10:19 +0300)]
Clarify documentation of pos-visible-in-window-p
* src/window.c (Fpos_visible_in_window_p): Clarify the meaning of
t for POS. See
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg01040.html
for the original report.
* doc/lispref/windows.texi (Window Start and End): Clarify the
meaning of t for the POSITION argument of pos-visible-in-window-p.
Stefan Monnier [Wed, 30 Sep 2015 03:28:32 +0000 (23:28 -0400)]
* lisp/progmodes/prolog.el: Fix various indentation cases
(prolog-operator-chars): New const (add \\).
(prolog-smie-forward-token, prolog-smie-backward-token): Use it.
(prolog-smie-rules): Add rules according to bug#21526.
Stefan Monnier [Wed, 30 Sep 2015 01:43:07 +0000 (21:43 -0400)]
* lisp/progmodes/sh-script.el: Old "dumb" continued line indent
(sh-indent-after-continuation): Add new value `always' (bug#17620)
(sh-smie-sh-rules): Remove old handling of continued lines.
(sh-smie--indent-continuation): New function.
(sh-set-shell): Use it.
Stefan Monnier [Tue, 29 Sep 2015 19:13:44 +0000 (15:13 -0400)]
* lisp/progmodes/octave.el: Use grammar more; Handle enumeration fun
Remove redundant :group keyword args.
(octave-begin-keywords, octave-else-keywords, octave-end-keywords):
Remove variables.
(octave-operator-table, octave-smie-bnf-table): Use let-when-compile to
turn them into compile-time variables.
Auto-generate the "foo ... end" rules from the "foo ... endfoo" rules.
Add rules for break, continue, return, global, and persistent.
Refine the rule for "until".
(octave-smie--funcall-p, octave-smie--end-index-p)
(octave-smie--in-parens-p): New functions.
(octave-smie-backward-token, octave-smie-forward-token): Use them to
distinguish the "enumeration" function and the "end" index from
their corresponding keywords.
(octave--block-offset-keywords): New constant.
(octave-smie-rules): Use it. Adjust rules for new global/persistent parsing.
(octave-reserved-words): Redefine using octave-smie-grammar.
(octave-font-lock-keywords): Use octave-smie--funcall-p and
octave-smie--end-index-p.
Nicolas Petton [Mon, 28 Sep 2015 20:18:26 +0000 (22:18 +0200)]
Add documentation for seq.el
* doc/lispref/sequences.texi: Add documentation regarding extending
seq.el, as well as missing documentation for seq-elt, seq-length, seq-p,
seq-do and seq-map.
Nicolas Petton [Mon, 28 Sep 2015 19:11:05 +0000 (21:11 +0200)]
Better documentation for seq-some
* doc/lispref/sequences.texi:
* lisp/emacs-lisp/seq.el: Update the documentation of seq-some to
guarantee that the returned value is the first non-nil value that
resulted from applying the predicate.
Eli Zaretskii [Mon, 28 Sep 2015 12:50:29 +0000 (15:50 +0300)]
Another attempt to fix crashes due to prematurely freed faces
* src/xdisp.c (redisplay_internal): Inhibit freeing of realized
faces for as long as we might have desired matrices that reference
those faces. (Bug#21428)
Alan Mackenzie [Sat, 26 Sep 2015 19:03:35 +0000 (19:03 +0000)]
Fix follow-scroll-up/down, making them replacements for scroll-up/down.
1. Allow point to move between follow windows in scroll operations.
2. Fix bug where `right-char' just before EOB caused spurious scrolling,
when EOB was isolated in the last follow window.
lisp/follow.el (follow-fixed-window): New variable.
(follow-get-scrolled-point): New function.
(follow-scrol-up, follow-scroll-down): Add autoload cookies.
Reformulate
the code. Put `scroll-command' properties on the functions. Correct
minor errors in ...-down's doc string and code.
(follow-calc-win-end): Amend incomplete doc string. Use
`pos-visible-in-window-p' to check whether EOB is in the window.
(follow-estimate-first-window-start): Correct an off-by-1 error.
(follow-adjust-window): Add handling for explicit scrolling operations.
Eli Zaretskii [Sat, 26 Sep 2015 06:50:58 +0000 (09:50 +0300)]
Make face realization be more frame-specific
* src/frame.h (struct f): New flag face_change.
* src/xfaces.c (Finternal_make_lisp_face)
(Finternal_copy_lisp_face, Finternal_set_lisp_face_attribute)
(update_face_from_frame_parameter): Set the face_change flag only
for the frame whose faces are affected.
* src/xdisp.c (init_iterator): If a frame's face_change flag is
set, free faces only on that frame.
(redisplay_internal): Disable "display optimization 1" if the
frame's face_change flag is set.
(redisplay_window): Don't allow skipping a window's redisplay if
its frame's face_change flag is set.
* src/frame.c (x_set_screen_gamma): Instead of calling
Fclear_face_cache, call clear_face_cache and set
windows_or_buffers_changed to a non-zero value. This avoids
setting the global face_change flag that triggers face realization
on all frames and thorough redisplay of all of them.
* lisp/term/tty-colors.el (tty-register-default-colors): Don't
clear face cache if the selected frame is a GUI frame.
Eli Zaretskii [Fri, 25 Sep 2015 17:29:27 +0000 (20:29 +0300)]
Avoid non-ASCII decoding errors in C src files
* src/nsterm.m:
* src/lisp.h:
* src/editfns.c:
* src/doprnt.c: Add 'coding' cookies -- these files include
Unicode characters and should be decoded as UTF-8.
Alan Mackenzie [Fri, 25 Sep 2015 11:31:50 +0000 (11:31 +0000)]
Resurrect edebug-set-initial-mode, repurposing it to set the global mode.
lisp/emacs-lisp/edebug.el (edebug-initial-mode-alist): Uncomment, and
amend to match current modes and functions.
(edebug-set-initial-mode): Uncomment and change from setting a defun's
`edebug-initial-mode''s property to setting the variable
`edebug-initial-mode'.
(top level): Create new binding C-x C-a C-m for
`edebug-set-initial-mode'.
doc/lispref/edebug.texi (Edebug Execution Modes): document
`edebug-set-initial-mode' and its new key binding.
(Edebug Options): Mention the new command in the pertinent place.
Paul Eggert [Fri, 25 Sep 2015 07:21:58 +0000 (00:21 -0700)]
Merge from gnulib
This incorporates:
2015-09-25 c-ctype: rewrite to use inline functions
2015-09-24 maint: add coding cookies to non-ASCII sources
2015-09-24 gitlog-to-changelog: trim only trailing whitespaces
* build-aux/gitlog-to-changelog, doc/misc/texinfo.tex:
* lib/acl-internal.c, lib/acl-internal.h, lib/c-ctype.c:
* lib/c-ctype.h, lib/get-permissions.c, lib/qcopy-acl.c:
* lib/set-permissions.c:
Copy from gnulib.
Ivan Andrus [Tue, 8 Sep 2015 22:37:06 +0000 (16:37 -0600)]
Allow major-modes full control over quoting nested comments
* newcomment.el (comment-quote-nested-function): New variable.
(comment-quote-nested-default): New function.
(comment-quote-nested): Use `comment-quote-nested-function'.
Michael Albinus [Wed, 23 Sep 2015 18:34:22 +0000 (20:34 +0200)]
Continue gfilenotify.c implementation of missing parts
* lisp/filenotify.el (file-notify-add-watch): Append `flags' to
`gfile-add-watch' call.
(file-notify-rm-watch): Modify `file-notify-descriptors' only
after calling the low level functions.
* src/gfilenotify.c (dir_monitor_callback): Check, whether
event_type is expected.
(Fgfile_add_watch): Allow also `change'and `attribute-change' for FLAGS.
(Fgfile_rm_watch): Fix typo.
(syms_of_gfilenotify): Declare Qchange and Qattribute_change.
Eli Zaretskii [Wed, 23 Sep 2015 13:20:10 +0000 (16:20 +0300)]
Support ':relative-width' space display spec on text-mode terminals
* src/xdisp.c (produce_stretch_glyph): Support ':relative-width'
space display spec on text-mode terminals, by calling
PRODUCE_GLYPHS instead of x_produce_glyphs. Remove the HAVE_WINDOW_SYSTEM
guards from the supporting code, as well as the test for a GUI frame.
Stefan Monnier [Tue, 22 Sep 2015 15:11:50 +0000 (11:11 -0400)]
* prolog.el: Fix indentation of empty line
* lisp/emacs-lisp/smie.el (smie-rules-function): Document new
`empty-line-token' element.
(smie-indent-empty-line): New function.
(smie-indent-functions): Add it.
* lisp/progmodes/prolog.el (prolog-smie-rules): Fix :list-intro behavior
and use the new `empty-line-token' element (bug#21526).
(prolog-mode-variables): Fix comment-start-skip setting to match
comment-start.
Alan Mackenzie [Tue, 22 Sep 2015 12:45:00 +0000 (12:45 +0000)]
Make description of `edebug-initial-mode' user friendly.
Fixes debbugs#21365.
dec/lispref/edebug.texi (Edebug Execution Modes): Change the
desscription
of `edebug-initial-mode' from that of its implementation to that of its
visual effect and use. Move the paragraph higher up.
* src/gfilenotify.c (dir_monitor_callback): Cancel the monitor if
the file or directory to be watched is deleted.
(Fgfile_add_watch): Make watch_object a triple.
(Fgfile_rm_watch): Check, whether watch is cancelled already.
(Fgfile_valid_p): New defun.
(syms_of_gfilenotify): Declare Sgfile_valid_p.
Mark Oteiza [Mon, 21 Sep 2015 20:45:58 +0000 (16:45 -0400)]
Use lunate epsilon for TeX \epsilon
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Add
\varepsilon using GREEK SMALL LETTER EPSILON, and change \epsilon to use
GREEK LUNATE EPSILON SYMBOL
Paul Eggert [Mon, 21 Sep 2015 18:56:01 +0000 (11:56 -0700)]
Improve git diff hunk headers for .el, .texi
Problem reported by Alan Mackenzie in:
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00826.html
* .gitattributes (*.el, *.texi): New patterns.
* autogen.sh: Configure diff.elisp.xfuncname and
diff.texinfo.xfuncname if using Git.
Paul Eggert [Mon, 21 Sep 2015 14:58:41 +0000 (07:58 -0700)]
Clarify or replace a few \u escapes.
* doc/lispref/nonascii.texi (Character Properties)
More-detailed commentary for \u escapes.
* lisp/progmodes/python.el (python--prettify-symbols-alist):
* lisp/replace.el (query-replace-from-to-separator):
* lisp/textmodes/rst.el (rst-bullets, rst-re-alist-def)
(rst-mode-syntax-table):
* lisp/whitespace.el (whitespace-display-mappings):
Prefer actual character to \u escape when this makes the code
easier to follow in the usual case where Unicode chars can be
displayed.
Paul Eggert [Mon, 21 Sep 2015 14:45:31 +0000 (07:45 -0700)]
Pacify GCC -Wmaybe-uninitialized in xdisp.c
* src/xdisp.c (face_before_or_after_it_pos): Use do-while rather
than while loop to avoid GCC -Wmaybe-uninitialized diagnostic with
charpos. The loop should always execute at least once anyway.