Edward Reingold [Mon, 20 Aug 2012 07:23:51 +0000 (00:23 -0700)]
* calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): New function.
(This is basically cal-tex-cursor-filofax-week with a different
papersize, mini-calendars, and color.)
Paul Eggert [Sun, 19 Aug 2012 21:00:09 +0000 (14:00 -0700)]
Rely on <unistd.h> to declare 'environ',
as gnulib does this if the system doesn't.
* lib-src/emacsclient.c (environ): Remove decl.
* src/callproc.c, src/editfns.c, src/process.c (environ) [!USE_CRT_DLL]:
* src/emacs.c (environ) [DOUG_LEA_MALLOC]:
* src/vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
* src/vm-limit.c: Include <unistd.h>, for 'environ'.
Alp Aker [Sun, 19 Aug 2012 00:53:29 +0000 (20:53 -0400)]
* nsfont.m (ns_ascii_average_width): Ensure the string
ascii_printable is initialized with a null-terminated character
array. Otherwise, it can contain undesired extra characters.
Paul Eggert [Sat, 18 Aug 2012 23:53:43 +0000 (16:53 -0700)]
port new setting code to Sun C 5.8 2005/10/13
* chartab.c, lisp.h (char_table_set, char_table_set_range):
Return void, not Lisp_Object. Otherwise, the compiler
complains about (A?B:C) where B is void and C is Lisp_Object
when compiling CHAR_TABLE_SET, due to the recent change to
the API of sub_char_table_set_contents.
Chong Yidong [Sat, 18 Aug 2012 05:11:38 +0000 (13:11 +0800)]
Add yank-handled-properties; use it for `font-lock-face' and `category'
properties, instead of hard-coding these properties' special handling.
* lisp/simple.el (yank-handled-properties): New defcustom.
(yank-excluded-properties): Add font-lock-face and category.
(yank): Doc fix.
* lisp/subr.el (remove-yank-excluded-properties): Obey
yank-handled-properties. The special handling of font-lock-face
and category is now done this way, instead of being hard-coded.
(insert-for-yank-1): Remove font-lock-face handling.
(yank-handle-font-lock-face-property)
(yank-handle-category-property): New function.
Paul Eggert [Sat, 18 Aug 2012 02:49:24 +0000 (19:49 -0700)]
* process.h (PSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(PROCESS_INLINE): New macro.
(pset_childp): New setter function.
(pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
* process.c (PROCESS_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(pset_buffer, pset_command, pset_decode_coding_system)
(pset_decoding_buf, pset_encode_coding_system)
(pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
(pset_plist, pset_sentinel, pset_status, pset_tty_name)
(pset_type, pset_write_queue): New setter functions.
Paul Eggert [Sat, 18 Aug 2012 00:07:52 +0000 (17:07 -0700)]
* termhooks.h (TSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(TERMHOOKS_INLINE): New macro.
(tset_charset_list, tset_selection_alist): New setter functions.
* terminal.c (TERMHOOKS_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(tset_param_alist): New setter function.
Paul Eggert [Fri, 17 Aug 2012 23:38:43 +0000 (16:38 -0700)]
* keyboard.h (KSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(KEYBOARD_INLINE): New macro.
(kset_default_minibuffer_frame, kset_defining_kbd_macro)
(kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
(kset_prefix_arg, kset_system_key_alist, kset_window_system):
New setter functions.
* keyboard.c (KEYBOARD_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(kset_echo_string, kset_kbd_queue)
(kset_keyboard_translate_table, kset_last_prefix_arg)
(kset_last_repeatable_command, kset_local_function_key_map)
(kset_overriding_terminal_local_map, kset_real_last_command)
(kset_system_key_syms): New setter functions.
Paul Eggert [Fri, 17 Aug 2012 21:52:15 +0000 (14:52 -0700)]
* frame.h (FSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(FRAME_INLINE): New macro.
(fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
(fset_current_tool_bar_string, fset_desired_tool_bar_string)
(fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
(fset_menu_bar_vector, fset_menu_bar_window, fset_name)
(fset_param_alist, fset_root_window, fset_scroll_bars)
(fset_selected_window, fset_title, fset_tool_bar_items)
(fset_tool_bar_position, fset_tool_bar_window): New functions.
* frame.c (FRAME_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(fset_buffer_predicate, fset_minibuffer_window): New setter functions.
Paul Eggert [Fri, 17 Aug 2012 21:12:11 +0000 (14:12 -0700)]
A few more naming-convention fixes for getters and setters.
* buffer.c (set_buffer_overlays_before): Move here from buffer.h,
and rename from buffer_overlays_set_before.
(set_buffer_overlays_after): Move here from buffer.h, and rename
from buffer_overlays_set_after.
* buffer.h (buffer_intervals): Rename from buffer_get_intervals.
All uses changed.
(set_buffer_intervals): Rename from buffer_set_intervals.
* intervals.c (set_interval_object): Move here from intervals.h,
and rename from interval_set_object.
(set_interval_left): Move here from intervals.h, and rename from
interval_set_left.
(set_interval_right): Move here from intervals.h, and rename from
interval_set_right.
(copy_interval_parent): Move here from intervals.h, and rename from
interval_copy_parent.
* intervals.h (set_interval_parent): Rename from interval_set_parent.
(set_interval_plist): Rename from interval_set_plist.
Return void, not Lisp_Object, since no caller uses the result.
* lisp.h (string_intervals): Rename from string_get_intervals.
(set_string_intervals): Rename from string_set_intervals.
Glenn Morris [Fri, 17 Aug 2012 20:38:47 +0000 (16:38 -0400)]
rmail-output-read-file-name fix for bug#12214
This resembles the 2001-05-07 change to rmail-output-read-rmail-file-name,
which was never copied to rmail-output-read-file-name.
It's more complicated now due to Rmail's buffer swapping.
* lisp/mail/rmailout.el (rmail-output-read-file-name):
Check rmail-output-file-alist against the full message body
in the correct rmail buffer.
Paul Eggert [Fri, 17 Aug 2012 17:08:30 +0000 (10:08 -0700)]
* lisp.h (set_char_table_extras): Rename from char_table_set_extras.
(set_char_table_contents): Rename from char_table_set_contents.
(set_sub_char_table_contents): Rename from sub_char_table_sub_contents.
All uses changed. See the end of
<http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
Paul Eggert [Fri, 17 Aug 2012 16:48:22 +0000 (09:48 -0700)]
* lisp.h (CSET): Remove.
(set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
(set_char_table_purpose): New functions,
replacing CSET. All uses changed. For example, replace
"CSET (XCHAR_TABLE (char_table), parent, parent);" with
"char_table_set_parent (char_table, parent);".
The old version was confusing because it used the same name
'parent' for two different things.
Chong Yidong [Fri, 17 Aug 2012 09:10:31 +0000 (17:10 +0800)]
Allow face-remapping using :font, and use it in mouse-appearance-menu.
* mouse.el (mouse-appearance-menu): If x-select-font returns a
font spec, set the font directly.
* xfaces.c (merge_face_vectors): If the target font specfies a
font spec, make the font's attributes take precedence over
directly-specified attributes.
(merge_face_ref): Recognize :font.
Daniel Bergey [Fri, 17 Aug 2012 07:28:23 +0000 (00:28 -0700)]
quail-define-inscript-package tiny change
* leim/quail/indian.el (quail-define-inscript-package):
Set kbd-translate for all Inscript layouts. It's a positional
layout: vowels should be on the left hand regardless of the
underlying characters produced by those keys.
Dmitry Antipov [Fri, 17 Aug 2012 05:35:39 +0000 (09:35 +0400)]
Do not use memcpy for copying intervals.
* intervals.c (reproduce_interval): New function.
(reproduce_tree, reproduce_tree_obj): Use it.
(reproduce_tree_obj): Remove prototype.
Chong Yidong [Thu, 16 Aug 2012 06:40:57 +0000 (14:40 +0800)]
Fix average font width calculation on NS.
* src/nsfont.m (nsfont_open): Similar to the Xft backend, set
min_width to space_width and average_width to the average over
printable ASCII characters.
(ns_char_width): Code cleanup.
(ns_ascii_average_width): New utility function.
Phil Sainty [Thu, 16 Aug 2012 06:25:27 +0000 (23:25 -0700)]
Make subword.el easier to customize (tiny change)
* lisp/progmodes/subword.el (subword-forward-function)
(subword-backward-function, subword-forward-regexp, subword-backward-regexp):
New variables.
(subword-forward, subword-forward-internal, subword-backward-internal):
Use new variables, eg so that different "word" definitions can be easily used.
Stefan Monnier [Wed, 15 Aug 2012 19:20:26 +0000 (15:20 -0400)]
* lisp/vc/vc-mtn.el (vc-mtn-revision-completion-table): Handle completion
for composite selectors.
* lisp/vc/vc.el (vc-diff-build-argument-list-internal): Don't prevent
operation just because we can't find a previous revision.
Jan Djärv [Wed, 15 Aug 2012 18:58:19 +0000 (20:58 +0200)]
Improve event loop on NS so that no polling is used.
* nsmenu.m (popupSession): Remove.
(pop_down_menu): Remove endModalSession.
(timeout_handler:): New method.
(runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
Call runModalForWindow. Check timer_fired when it returns.
If not set, cancel timer and break out of loop.
Otherwise loop again, with a new timeout.
* nsterm.h (EmacsApp): fd_handler takes id argument.
(EmacsDialogPanel): Add timer_fired and timeout_handler.
* nsterm.m: Include fcntl.h if present.
(fd_entry, t_readfds, inNsSelect): Remove.
(select_writefds, select_valid, select_timeout, selfds)
(select_mutex, apploopnr): Add.
(EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
Otherwise call kbd_buffer_store_event.
(ns_send_appdefined): Remove release of fd_entry.
(ns_read_socket): Always send appdefined. Remove inNsSelect check.
Increment and decrement apploopnr.
(ns_select): If no file descriptors, just do a NSTimer.
Otherwise copy read/write masks and start select thread (fd_handler).
Start main loop and wait for application defined event.
Inform select thread to stop selecting after main loop is exited.
(ns_term_init): Create selfds pipe and set non-blocking.
Initialize select_mutex. Start the select thread (fd_handler).
(fd_handler:): Loop forever, wait for info from the main thread
to either start or stop selecting. When select returns, send
and appdefined event.
(sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
If not call kbd_buffer_store_event.
Dmitry Antipov [Wed, 15 Aug 2012 14:20:16 +0000 (18:20 +0400)]
Generalize and cleanup font subsystem checks.
* font.h (FONT_DEBUG, font_assert): Remove.
* font.c, fontset.c, w32font.c, xfont.c, xftfont.c: Change
font_assert to eassert. Use eassert where appropriate.
Chong Yidong [Wed, 15 Aug 2012 07:58:34 +0000 (15:58 +0800)]
Extract better font information from the GTK >= 3.2 font chooser.
* gtkutil.c (xg_get_font): Rename from xg_get_font_name. When
using the new font chooser, use gtk_font_chooser_get_font_desc to
extract the font descriptor instead of just the font name. In
that case, return a font spec instead of a string.
(x_last_font_name): Move to this file from xfns.c.
* xfns.c (Fx_select_font): The return value can also be a font
spec. Move x_last_font_name management to gtkutil.c.
* xfaces.c: Make font weight and style symbols non-static.
* lisp/frame.el (set-frame-font): Accept font objects.
Wolfgang Jenkner [Wed, 15 Aug 2012 03:37:07 +0000 (23:37 -0400)]
* lisp/man.el (Man-overstrike-face, Man-underline-face)
(Man-reverse-face): Remove variables.
(Man-overstrike, Man-underline, Man-reverse): New faces.
(Man-fontify-manpage): Use them instead of the variables.
(Man-cleanup-manpage): Comment change.
(Man-ansi-color-map): New variable.
(Man-fontify-manpage): Use it.
Call ansi-color-apply-on-region to replace ad hoc code.
Wolfgang Jenkner [Wed, 15 Aug 2012 03:33:55 +0000 (23:33 -0400)]
Implement ANSI SGR parameters 22-27.
* lisp/ansi-color.el (ansi-colors): Doc fix.
(ansi-color-context, ansi-color-context-region): Doc fix.
(ansi-color--find-face): New function.
(ansi-color-apply, ansi-color-apply-on-region): Use it.
Rename the local variable `face' to `codes' since it is now a list of
ansi codes. Doc fix.
(ansi-color-get-face): Remove.
(ansi-color-parse-sequence): New function, derived from
ansi-color-get-face.
(ansi-color-apply-sequence): Use it. Rewrite, and support ansi
codes 22-27.
Eli Zaretskii [Tue, 14 Aug 2012 18:48:39 +0000 (21:48 +0300)]
Fix and improve GUD Tooltip mode.
lisp/tooltip.el (tooltip-identifier-from-point): Don't treat tokens
inside comments and strings as identifiers.
lisp/progmodes/gud.el (gud-tooltip-print-command): Quote the
expression to evaluate. This allows to evaluate expressions with
embedded whitespace.
(gud-tooltip-tips): Add a blank before the newline in the
message-box text, for the benefit of message-box emulation on
MS-Windows.
lisp/progmodes/gdb-mi.el (gdb-tooltip-print): Don't ignore error
messages from GDB, pop them up in a tooltip to give feedback to
user.
(gdb-tooltip-print-1): Quote the expression to evaluate. This
allows to evaluate expressions with embedded whitespace.
(gdb-inferior-io--init-proc): Don't send "-inferior-tty" command
if the TTY name is nil or empty (which happens when communicating
with the inferior via pipes, e.g. on MS-Windows).
(gdb-internals): If GDB sends a "&\n" empty debugging message,
don't send that to the GUD buffer.
doc/emacs/building.texi (Debugger Operation): Correct and improve
documentation of the GUD Tooltip mode.
Eli Zaretskii [Tue, 14 Aug 2012 18:25:47 +0000 (21:25 +0300)]
Fix a problem with disabled mouse movement events.
src/keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
iteration through the command loop. Fixes a problem whereby mouse
movements are ignored until the first mouse click.
Paul Eggert [Tue, 14 Aug 2012 17:45:25 +0000 (10:45 -0700)]
Use bool for Emacs Lisp booleans.
This is more natural, and on my platform (GCC 4.7.1 x86-64) it
makes Emacs's text size .03% smaller and presumably a bit faster.
* admin/merge-gnulib (GNULIB_MODULES): Add stdbool. This documents a
new direct dependency; stdbool was already being used indirectly
via other gnulib modules.
* lib-src/make-docfile.c (enum global_type): Sort values roughly in
decreasing alignment, except put functions last.
(compare_globals): Use this new property of enum global_type.
(write_globals): Use bool, not int, for booleans.
* src/lisp.h: Include <stdbool.h>.
(struct Lisp_Boolfwd, defvar_bool):
* src/lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
* src/regex.c [!emacs]: Include <stdbool.h>.
(false, true): Remove; <stdbool.h> does this for us now.
Dmitry Gutov [Tue, 14 Aug 2012 12:38:11 +0000 (08:38 -0400)]
* lisp/progmodes/ruby-mode.el (ruby-syntax-methods-before-regexp): New const.
(ruby-syntax-propertize-function): Use it to recognize regexps.
Don't look at the text after regexp, just use the whitelist.
* test/indent/ruby.rb: Rearrange examples, add new ones.
Dmitry Gutov [Tue, 14 Aug 2012 12:28:12 +0000 (08:28 -0400)]
* lisp/progmodes/ruby-mode.el: Improve percent literals.
(ruby-percent-literal-beg-re): New constant.
(ruby-syntax-general-delimiters-goto-beg): Rename to
`ruby-syntax-enclosing-percent-literal', improve literal type check.
(ruby-syntax-propertize-general-delimiters): Rename to
`ruby-syntax-propertize-percent-literal', it's a shorter and more
popular term. Adjust comments everywhere.
(ruby-syntax-propertize-percent-literal): Only propertize when not
inside a simple string or comment. When the literal is unclosed,
leave the text after it unpropertized.
Chong Yidong [Tue, 14 Aug 2012 06:52:59 +0000 (14:52 +0800)]
Fix highlight-regexp's use of Font Lock mode.
* hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock.
(hi-lock-set-pattern): When deciding whether to use font lock or
overlays, look at font-lock-mode instead of font-lock-fontified.
(hi-lock-mode, hi-lock-line-face-buffer, hi-lock-unface-buffer)
(hi-lock-face-buffer, hi-lock-face-phrase-buffer): Doc fix.