bpt/emacs.git
11 years ago* src/alloc.c: Remove build_string.
Dmitry Antipov [Tue, 26 Jun 2012 05:00:30 +0000 (09:00 +0400)]
* src/alloc.c: Remove build_string.
* src/lisp.h: Define build_string as static inline.  This provides
a better opportunity to optimize away calls to strlen when the
function is called with compile-time constant argument.
* src/image.c (imagemagick_error): Convert to build_string.
* src/w32proc.c (sys_spawnve): Likewise.
* src/xterm.c (x_term_init): Likewise.
* admin/coccinelle/build_string.cocci: Semantic patch
to convert from make_string to build_string.

11 years agoUse sprintf return value instead of invoking strlen on result.
Paul Eggert [Tue, 26 Jun 2012 02:33:51 +0000 (19:33 -0700)]
Use sprintf return value instead of invoking strlen on result.

In the old days this wasn't portable, since some sprintf
implementations returned char *.  But they died out years ago and
Emacs already assumes sprintf returns int.
Similarly for float_to_string.
This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
* ccl.c (ccl_driver):
* character.c (string_escape_byte8):
* data.c (Fnumber_to_string):
* doprnt.c (doprnt):
* print.c (print_object):
* xdisp.c (message_dolog):
* xfns.c (syms_of_xfns):
Use sprintf or float_to_string result to avoid need to call strlen.
* data.c (Fnumber_to_string):
Use make_unibyte_string, since the string must be ASCII.
* lisp.h, print.c (float_to_string): Now returns int length.
* term.c (produce_glyphless_glyph):
Use sprintf result rather than recomputing it.

11 years agoClean out last vestiges of the old HAVE_CONFIG_H stuff.
Paul Eggert [Tue, 26 Jun 2012 01:05:39 +0000 (18:05 -0700)]
Clean out last vestiges of the old HAVE_CONFIG_H stuff.

11 years ago* Makefile.in (ALL_CFLAGS): Add -I../lib -I${srcdir}/../lib.
Paul Eggert [Tue, 26 Jun 2012 00:39:36 +0000 (17:39 -0700)]
* Makefile.in (ALL_CFLAGS): Add -I../lib -I${srcdir}/../lib.

This is needed for hosts that lack <alloca.h>, when Emacs is
configured --with-x-toolkit=no.  Problem reported by Herbert
J. Skuhra for FreeBSD.

11 years ago* lisp/server.el (server-process-filter): Remember dir in the
Jim Diamond [Mon, 25 Jun 2012 23:01:42 +0000 (19:01 -0400)]
* lisp/server.el (server-process-filter): Remember dir in the
process's `server-client-directory' properties.

11 years agoMerge from gnulib (comment-only change).
Paul Eggert [Mon, 25 Jun 2012 14:49:15 +0000 (07:49 -0700)]
Merge from gnulib (comment-only change).

11 years agoFix misspelling dispextern.h in ChangeLog.
Dmitry Antipov [Mon, 25 Jun 2012 14:28:51 +0000 (18:28 +0400)]
Fix misspelling dispextern.h in ChangeLog.

11 years ago* configure.in (AC_CHECK_FUNCS): Detect library functions
Dmitry Antipov [Mon, 25 Jun 2012 14:07:04 +0000 (18:07 +0400)]
* configure.in (AC_CHECK_FUNCS): Detect library functions
strcasecmp and strncasecmp.
* lib-src/etags.c (etags_strcasecmp, etags_strncasecmp): Define to
library functions strcasecmp and strncasecmp if available.
* lwlib/lwlib.c (my_strcasecmp): Rename to lwlib_strcasecmp, which
may be defined to library function strcasecmp if available.
* src/dispextern.c (xstrcasecmp): Define to library function
strcasecmp if available.
* src/xfaces.c: Do not use xstrcasecmp if strcasecmp is available.

11 years ago* keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
Andreas Schwab [Mon, 25 Jun 2012 10:28:47 +0000 (12:28 +0200)]
* keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
Avoid comma operator.
* menu.c (push_submenu_start, push_submenu_end)
(push_left_right_boundary, push_menu_pane): Likewise.
* msdos.c (dos_rawgetc): Likewise.

11 years agoAuto-commit of generated files.
Glenn Morris [Mon, 25 Jun 2012 10:17:31 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years ago* xfns.c (xic_create_fontsetname): Remove redundant calls
Dmitry Antipov [Mon, 25 Jun 2012 10:16:11 +0000 (14:16 +0400)]
* xfns.c (xic_create_fontsetname): Remove redundant calls
to memset.

11 years ago* gtkutil.c (get_utf8_string): Remove redundant assignment.
Paul Eggert [Mon, 25 Jun 2012 07:54:45 +0000 (00:54 -0700)]
* gtkutil.c (get_utf8_string): Remove redundant assignment.

sprintf already null-terminates its output.

11 years ago* xfns.c (x_window): Remove redundant cast.
Paul Eggert [Mon, 25 Jun 2012 07:45:49 +0000 (00:45 -0700)]
* xfns.c (x_window): Remove redundant cast.

11 years ago* xmenu.c (xmenu_show, xdialog_show): Explicit cast from
Dmitry Antipov [Mon, 25 Jun 2012 04:05:48 +0000 (08:05 +0400)]
* xmenu.c (xmenu_show, xdialog_show): Explicit cast from
`const char *' to `char *' to avoid compiler warning.

11 years ago* xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
Paul Eggert [Sun, 24 Jun 2012 23:14:39 +0000 (16:14 -0700)]
* xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string

instead of truncating it to 63 (admittedly a generous limit).

11 years ago* process.c: Fix spelling and caps in comments.
Paul Eggert [Sun, 24 Jun 2012 20:34:48 +0000 (13:34 -0700)]
* process.c: Fix spelling and caps in comments.

11 years ago* emacs.c (setpgrp): Remove definition, unused.
Dan Nicolaescu [Sun, 24 Jun 2012 20:22:22 +0000 (14:22 -0600)]
* emacs.c (setpgrp): Remove definition, unused.

11 years ago* sysdep.c (setpgrp): Remove definition, not used in this file.
Dan Nicolaescu [Sun, 24 Jun 2012 20:13:15 +0000 (14:13 -0600)]
* sysdep.c (setpgrp): Remove definition, not used in this file.

11 years agont/config.nt (_Noreturn): Don't reference __SUNPRO_C.
Eli Zaretskii [Sun, 24 Jun 2012 18:31:31 +0000 (21:31 +0300)]
nt/config.nt (_Noreturn): Don't reference __SUNPRO_C.

Fixes: debbugs:11750

11 years agosrc/makefile.w32-in: Update dependencies.
Juanma Barranquero [Sun, 24 Jun 2012 17:57:06 +0000 (19:57 +0200)]
src/makefile.w32-in: Update dependencies.

11 years agoSwitch from NO_RETURN to C11's _Noreturn.
Paul Eggert [Sun, 24 Jun 2012 17:39:14 +0000 (10:39 -0700)]
Switch from NO_RETURN to C11's _Noreturn.

Fixes: debbugs:11750

11 years agoImprove port of struct timespec to MS-Windows.
Eli Zaretskii [Sun, 24 Jun 2012 17:21:20 +0000 (20:21 +0300)]
Improve port of struct timespec to MS-Windows.

 lib/makefile.w32-in ($(BLD)/dtotimespec.$(O)):
 ($(BLD)/timespec-add.$(O)):
 ($(BLD)/timespec-sub.$(O)): Don't depend on
 $(EMACS_ROOT)/nt/inc/sys/time.h.
 lib/stat-time.h:
 lib/timespec.h:
 lib/utimens.h: Revert last change.
 src/makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
 (SYSTIME_H): Add nt/inc/sys/time.h.
 src/systime.h [WINDOWSNT]: Include sys/time.h.
 src/s/ms-w32.h (struct timespec): Definition moved from
 nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
 nt/inc/sys/time.h (struct timespec): Don't define it here, it is
 now defined in src/s/ms-w32.h.

Fixes: debbugs:9000

11 years ago* etc/NEWS: Move and improve the defun/defalias changes.
Lawrence Mitchell [Sun, 24 Jun 2012 17:07:26 +0000 (13:07 -0400)]
* etc/NEWS: Move and improve the defun/defalias changes.

Fixes: debbugs:11686

11 years agoFirst Coccinelle semantic patch.
Dmitry Antipov [Sun, 24 Jun 2012 16:18:41 +0000 (20:18 +0400)]
First Coccinelle semantic patch.
* coccinelle: New subdirectory
* coccinelle/README: Documentation stub.
* coccinelle/vector_contents.cocci: Semantic patch to replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.

11 years ago* xml.el (xml-parse-tag): Corrrectly handle comment embedded in non-tag text.
Chong Yidong [Sun, 24 Jun 2012 15:06:24 +0000 (23:06 +0800)]
* xml.el (xml-parse-tag): Corrrectly handle comment embedded in non-tag text.

11 years agoAuto-commit of generated files.
Glenn Morris [Sun, 24 Jun 2012 10:17:34 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years ago* emacsclient.c (set_local_socket): Fix a compiler warning.
Samuel Bronson [Sun, 24 Jun 2012 09:43:09 +0000 (17:43 +0800)]
* emacsclient.c (set_local_socket): Fix a compiler warning.

Fixes: debbugs:7838

11 years agoLisp manual -- improve discussion of ptys vs pipes.
Thien-Thi Nguyen [Sun, 24 Jun 2012 09:30:35 +0000 (17:30 +0800)]
Lisp manual -- improve discussion of ptys vs pipes.

* processes.texi (Asynchronous Processes): Make the pty vs pipe
discussion more prominent.

11 years agoFix bug when time_t is unsigned and as wide as intmax_t.
Paul Eggert [Sun, 24 Jun 2012 04:11:19 +0000 (21:11 -0700)]
Fix bug when time_t is unsigned and as wide as intmax_t.

* lisp.h (WAIT_READING_MAX): New macro.
* dispnew.c (Fsleep_for, sit_for):
* keyboard.c (kbd_buffer_get_event):
* process.c (Faccept_process_output):
Use it to avoid bogus compiler warnings with obsolescent GCC versions.
This improves on the previous patch, which introduced a bug
when time_t is unsigned and as wide as intmax_t.
See <http://bugs.gnu.org/9000#51>.

11 years agoAvoid compiler warnings in comparing time_t.
Eli Zaretskii [Sat, 23 Jun 2012 19:40:50 +0000 (22:40 +0300)]
Avoid compiler warnings in comparing time_t.

 src/dispnew.c (sit_for, Fsleep_for):
 src/keyboard.c (kbd_buffer_get_event):
 src/process.c (Faccept_process_output): Avoid compiler warnings when
 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.

11 years agosrc/makefile.w32-in: Update dependencies.
Juanma Barranquero [Sat, 23 Jun 2012 19:28:01 +0000 (21:28 +0200)]
src/makefile.w32-in: Update dependencies.

11 years agoFix misspelling in latest ChangeLog entry.
Paul Eggert [Sat, 23 Jun 2012 17:32:27 +0000 (10:32 -0700)]
Fix misspelling in latest ChangeLog entry.

11 years agoMerge from gnulib.
Paul Eggert [Sat, 23 Jun 2012 17:25:56 +0000 (10:25 -0700)]
Merge from gnulib.

* m4/getopt.m4: Copy new version from gnulib, incorporating:
getopt-gnu: Handle suboptimal getopt_long's abbreviation handling.

11 years agolisp/makefile.w32-in (COMPILE_FIRST): Synch with changes in 2012-06-22T21:24:54Z...
Juanma Barranquero [Sat, 23 Jun 2012 16:58:13 +0000 (18:58 +0200)]
lisp/makefile.w32-in (COMPILE_FIRST): Synch with changes in 2012-06-22T21:24:54Z!monnier@iro.umontreal.ca.

11 years agosrc/w32.c (ltime): Add return type and declare static.
Juanma Barranquero [Sat, 23 Jun 2012 16:56:47 +0000 (18:56 +0200)]
src/w32.c (ltime): Add return type and declare static.
(w32_get_internal_run_time): Remove usused variable `time_100ns'.

11 years ago* sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
Paul Eggert [Sat, 23 Jun 2012 16:44:45 +0000 (09:44 -0700)]
* sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.

Privately reported by Herbert J. Skuhra.
(make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
All uses changed.
(system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
not make_lisp_timeval, when the argument is of type EMACS_TIME.

11 years agoMiscellaneous minor cleanups and simplifications.
Stefan Monnier [Sat, 23 Jun 2012 15:38:23 +0000 (11:38 -0400)]
Miscellaneous minor cleanups and simplifications.
* lisp/help-fns.el (describe-variable): Don't croak when doc is not found.
* lisp/vc/pcvs.el (cvs-retrieve-revision): Avoid toggle-read-only.
* lisp/menu-bar.el (menu-bar-line-wrapping-menu): Purecopy a tiny bit more.
* lisp/emacs-lisp/syntax.el (syntax-ppss): Simplify with new `if' place.
* lisp/emacs-lisp/smie.el (smie-next-sexp): CSE.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Fix edebug spec and avoid
((lambda ..) ..).
* lisp/emacs-lisp/eieio.el (eieio-oref, slot-value): Use simpler defsetf.

11 years agoUse @ interactive spec for Info-mouse-follow-link.
Chong Yidong [Sat, 23 Jun 2012 13:32:29 +0000 (21:32 +0800)]
Use @ interactive spec for Info-mouse-follow-link.

Fixes: debbugs:11672

11 years agoFixes for Info link-following mouse commands.
Chong Yidong [Sat, 23 Jun 2012 13:27:40 +0000 (21:27 +0800)]
Fixes for Info link-following mouse commands.

* lisp/info.el (Info-mouse-follow-link): Accept symbol values of the
link-args property.  Select the window.
(Info-fontify-node): Use Info-link-keymap for all navigation
buttons, with link-args property to perform the desired action.
(Info-link-keymap): Doc fix.
(Info-next-link-keymap, Info-prev-link-keymap)
(Info-up-link-keymap): Delete now-unused keymaps.

Fixes: debbugs:11672

11 years agoFix last commit.
Chong Yidong [Sat, 23 Jun 2012 12:54:59 +0000 (20:54 +0800)]
Fix last commit.

11 years ago* mouse.el (mouse-drag-track): Deactivate the mark before popping.
Chong Yidong [Sat, 23 Jun 2012 12:48:24 +0000 (20:48 +0800)]
* mouse.el (mouse-drag-track): Deactivate the mark before popping.

11 years agoFix a bug in w32-get-locale-info.
Eli Zaretskii [Sat, 23 Jun 2012 12:44:42 +0000 (15:44 +0300)]
Fix a bug in w32-get-locale-info.

 src/w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
 last argument of make_unibyte_string.

11 years agoImprove and document the language-change event on MS-Windows.
Eli Zaretskii [Sat, 23 Jun 2012 12:39:23 +0000 (15:39 +0300)]
Improve and document the language-change event on MS-Windows.

 src/keyboard.c (kbd_buffer_get_event): Include the codepage and the
 language ID in the event parameters.
 src/w32term.c (w32_read_socket): Put the new keyboard codepage into
 event.code, not the obscure "character set ID".
 doc/lispref/commands.texi (Misc Events): Document the language-change event.

11 years ago* xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
Chong Yidong [Sat, 23 Jun 2012 10:47:00 +0000 (18:47 +0800)]
* xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.

11 years agoFix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
Eli Zaretskii [Sat, 23 Jun 2012 10:22:59 +0000 (13:22 +0300)]
Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.

 nt/inc/sys/time.h (struct timespec): Define.
 lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/dtotimespec.$(O),
 $(BLD)/gettime.$(O), $(BLD)/timespec-add.$(O), and
 $(BLD)/timespec-sub.$(O).
 ($(BLD)/dtotimespec.$(O)):
 ($(BLD)/gettime.$(O)):
 ($(BLD)/timespec-add.$(O)):
 ($(BLD)/timespec-sub.$(O)): New dependencies.
 lib/stat-time.h:
 lib/timespec.h:
 lib/utimens.h: Include sys/time.h
 src/w32.c (fdutimens): New function.
 src/w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
 src/s/ms-w32.h (pselect): Redirect to sys_select.
 src/sysselect.h [WINDOWSNT]: Don't include sys/select.h.

Fixes: debbugs:9000

11 years agoAuto-commit of generated files.
Glenn Morris [Sat, 23 Jun 2012 10:17:30 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years ago* configure.in: Don't use AC_CHECK_FUNCS_ONCE, which doesn't use
Andreas Schwab [Sat, 23 Jun 2012 09:55:13 +0000 (11:55 +0200)]
* configure.in: Don't use AC_CHECK_FUNCS_ONCE, which doesn't use
the correct CFLAGS and LIBS.

11 years agoReally fix bug #11519, by fixing the last change in ralloc.c.
Eli Zaretskii [Sat, 23 Jun 2012 09:46:33 +0000 (12:46 +0300)]
Really fix bug #11519, by fixing the last change in ralloc.c.

 src/ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
 in the logic of incrementing and decrementing the value of
 use_relocatable_buffers.

11 years agoMark python-mode abbrevs as system abbrevs.
Chong Yidong [Sat, 23 Jun 2012 09:28:10 +0000 (17:28 +0800)]
Mark python-mode abbrevs as system abbrevs.

* progmodes/python.el (python-skeleton-define): Mark abbrevs as
system abbrevs.

* ansi-color.el (ansi-color-apply-on-region): Doc fix.

11 years ago* sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
Paul Eggert [Sat, 23 Jun 2012 08:21:48 +0000 (01:21 -0700)]
* sysdep.c [__FreeBSD__]: Fix recently-introduced typos.

Privately reported by Herbert J. Skuhra.
[__FreeBSD__]: Remove "*/" typo after "#include".
(timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
(TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
(TIMEVAL, system_process_attributes) [__FreeBSD__]:
Don't assume EMACS_TIME and struct timeval are the same type.

11 years ago* lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Handle improper lists.
Stefan Monnier [Sat, 23 Jun 2012 04:24:06 +0000 (00:24 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Handle improper lists.

Fixes: debbugs:11719

11 years ago* lisp/minibuffer.el (completion--twq-try): Try to fail more gracefully when
Stefan Monnier [Sat, 23 Jun 2012 03:48:18 +0000 (23:48 -0400)]
* lisp/minibuffer.el (completion--twq-try): Try to fail more gracefully when
the requote function doesn't work properly.

Fixes: debbugs:11714

11 years ago* lisp/pcmpl-rpm.el (pcmpl-rpm-packages): Give status messages.
Glenn Morris [Sat, 23 Jun 2012 01:02:17 +0000 (21:02 -0400)]
* lisp/pcmpl-rpm.el (pcmpl-rpm-packages): Give status messages.

11 years agoAdd gnulib files to support higher-resolution time stamps.
Paul Eggert [Fri, 22 Jun 2012 21:26:37 +0000 (14:26 -0700)]
Add gnulib files to support higher-resolution time stamps.

Fixes: debbugs:9000

11 years agoFurther GV/CL cleanups.
Stefan Monnier [Fri, 22 Jun 2012 21:24:54 +0000 (17:24 -0400)]
Further GV/CL cleanups.
* lisp/emacs-lisp/gv.el (gv-get): Autoload functions to find their
gv-expander.
(gv--defun-declaration): New function.
(defun-declarations-alist): Use it.
(gv-define-modify-macro, gv-pushnew!, gv-inc!, gv-dec!): Remove.
(gv-place): Autoload.
* lisp/emacs-lisp/cl.el (cl--dotimes, cl--dolist): Remember subr.el's
original definition of dotimes and dolist.
* lisp/emacs-lisp/cl-macs.el (cl-expr-access-order): Remove unused.
(cl-dolist, cl-dotimes): Use `dolist' and `dotimes'.
* lisp/emacs-lisp/cl-lib.el: Move gv handlers from cl-macs to here.
(cl-fifth, cl-sixth, cl-seventh, cl-eighth)
(cl-ninth, cl-tenth): Move gv handler to the function's definition.
* lisp/emacs-lisp/cl-extra.el (cl-subseq, cl-get, cl-getf): Move gv handler
to the function's definition.
* lisp/Makefile.in (COMPILE_FIRST): Re-order to speed it up by about 50%.
* lisp/window.el:
* lisp/files.el:
* lisp/faces.el:
* lisp/env.el: Don't use CL.

11 years agoSupport higher-resolution time stamps.
Paul Eggert [Fri, 22 Jun 2012 21:17:42 +0000 (14:17 -0700)]
Support higher-resolution time stamps.

Fixes: debbugs:9000

11 years ago* lisp/icomplete.el (icomplete-minibuffer-setup, icomplete-completions):
Stefan Monnier [Fri, 22 Jun 2012 17:37:28 +0000 (13:37 -0400)]
* lisp/icomplete.el (icomplete-minibuffer-setup, icomplete-completions):
Move the non-essential binding to the post/pre-command-hook where it is
more obviously correct.

11 years ago* lisp/subr.el (read-passwd): Don't use a history at all.
Stefan Monnier [Fri, 22 Jun 2012 17:30:25 +0000 (13:30 -0400)]
* lisp/subr.el (read-passwd): Don't use a history at all.
* lisp/savehist.el (savehist-save): Remove password saved accidentally
because of the above bug.

11 years agoMerge from gnulib.
Paul Eggert [Fri, 22 Jun 2012 17:20:00 +0000 (10:20 -0700)]
Merge from gnulib.

* lib/filemode.h, lib/signal.in.h, lib/stat.c, lib/stdint.in.h:
* lib/stdlib.in.h, lib/unistd.in.h, m4/extensions.m4, m4/getloadavg.m4:
* m4/getopt.m4, m4/gnulib-common.m4, m4/largefile.m4, m4/mktime.m4:
* m4/multiarch.m4, m4/nocrash.m4, m4/stdio_h.m4, m4/time_r.m4:
Copy new versions from gnulib, incorporating the following changes:
2012-06-22 time_r: fix typo that always overrode localtime_r decl
2012-06-22 Write "Mac OS X" instead of "MacOS X".
2012-06-21 mktime: fix integer overflow in 'configure'-time test
2012-06-21 nonblocking: Avoid compilation error on mingw64.
2012-06-19 stat, fstat: Avoid warnings on mingw64.
2012-06-19 getopt-gnu: Fix exit code overflow in autoconf test.

11 years agoImprove pcmpl-rpm-query-options custom type
Glenn Morris [Fri, 22 Jun 2012 16:00:34 +0000 (09:00 -0700)]
Improve pcmpl-rpm-query-options custom type

11 years agoFix bug #11726 -- send a message after `toggle-read-only'.
Bastien Guerry [Fri, 22 Jun 2012 14:12:42 +0000 (16:12 +0200)]
Fix bug #11726 -- send a message after `toggle-read-only'.

Thanks to Drew Adam for reporting this.

11 years agoProvide generalized variables in core Elisp.
Stefan Monnier [Fri, 22 Jun 2012 13:42:38 +0000 (09:42 -0400)]
Provide generalized variables in core Elisp.
* lisp/emacs-lisp/gv.el: New file.
* lisp/subr.el (push, pop): Extend to generalized variables.
* lisp/loadup.el (macroexp): Unload if preloaded and uncompiled.
* lisp/emacs-lisp/cl-lib.el (cl-pop, cl-push, cl--set-nthcdr): Remove.
* lisp/emacs-lisp/cl-macs.el: Require gv.  Use gv-define-setter,
gv-define-simple-setter, and gv-define-expander.
Remove setf-methods defined in gv.  Rename cl-setf -> setf.
(cl-setf, cl-do-pop, cl-get-setf-method): Remove.
(cl-letf, cl-letf*, cl-define-modify-macro, cl-defsetf)
(cl-define-setf-expander, cl-struct-setf-expander): Move to cl.el.
(cl-remf, cl-shiftf, cl-rotatef, cl-callf, cl-callf2): Rewrite with
gv-letplace.
(cl-defstruct): Don't define setf-method any more.
* lisp/emacs-lisp/cl.el (flet): Don't autoload.
(cl--letf, letf, cl--letf*, letf*, cl--gv-adapt)
(define-setf-expander, defsetf, define-modify-macro)
(cl-struct-setf-expander): Move from cl-lib.el.
* lisp/emacs-lisp/syntax.el:
* lisp/emacs-lisp/ewoc.el:
* lisp/emacs-lisp/smie.el:
* lisp/emacs-lisp/cconv.el:
* lisp/emacs-lisp/timer.el: Rename cl-setf -> setf, cl-push -> push.
(timer--time): Use gv-define-simple-setter.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Rename from macroexp-let²
to avoid coding-system problems in subr.el.  Adjust all users.
(macroexp--maxsize, macroexp-small-p): New functions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't use cl-letf.
* lisp/scroll-bar.el (scroll-bar-mode):
* lisp/simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode)
(normal-erase-is-backspace-mode): Don't use the `eq' place.
* lisp/winner.el (winner-configuration, winner-make-point-alist)
(winner-set-conf, winner-get-point, winner-set): Don't abuse letf.
* lisp/files.el (locate-file-completion-table): Avoid list*.

Fixes: debbugs:11657

11 years agoFurther speed up rpm completion, by caching the installed packages
Glenn Morris [Fri, 22 Jun 2012 07:38:26 +0000 (00:38 -0700)]
Further speed up rpm completion, by caching the installed packages

* lisp/pcmpl-rpm.el (pcmpl-rpm-cache): New option.
(pcmpl-rpm-cache-stamp-file): New constant.
(pcmpl-rpm-cache-time, pcmpl-rpm-packages): New variables.
(pcmpl-rpm-packages): Optionally cache list of packages.

11 years agoMisc doc fixes for Dired.
Chong Yidong [Fri, 22 Jun 2012 07:30:33 +0000 (15:30 +0800)]
Misc doc fixes for Dired.

* dired-aux.el (dired-do-create-files): Doc fix (Bug#11327).
(dired-create-files): Doc fix (Bug#11329).
(dired-do-copy): Doc fix (Bug#11334).
(dired-mark-read-string): Doc fix (Bug#11553).

* dired.el (dired-recursive-copies, dired-recursive-deletes): Doc
fix (Bug#11326).
(dired-make-relative): Doc fix (Bug#11332).  Remove unused arg.
(dired-dwim-target): Doc fix.

* wdired.el (wdired-mode): Doc fix.

11 years ago* xdisp.c (x_consider_frame_title): Revert last change.
Chong Yidong [Fri, 22 Jun 2012 07:28:28 +0000 (15:28 +0800)]
* xdisp.c (x_consider_frame_title): Revert last change.

11 years agoTry to speed up pcomplete's calling of rpm -qa
Glenn Morris [Fri, 22 Jun 2012 07:01:32 +0000 (00:01 -0700)]
Try to speed up pcomplete's calling of rpm -qa
Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-04/msg00174.html

* lisp/pcmpl-rpm.el (pcmpl-rpm): New group.
(pcmpl-rpm-query-options): New option.
(pcmpl-rpm-packages): No need to inline it.  Use pcmpl-rpm-query-options.

11 years agoEnlarge NSTATICS to 0x650.
Eli Zaretskii [Fri, 22 Jun 2012 06:51:06 +0000 (09:51 +0300)]
Enlarge NSTATICS to 0x650.

 src/alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
 aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
 staticidx goes up to 1597 out of 1600 = 0x640.)

11 years ago* calendar.el (calendar-in-read-only-buffer): Avoid some needless mode changes.
Glenn Morris [Fri, 22 Jun 2012 01:50:35 +0000 (21:50 -0400)]
* calendar.el (calendar-in-read-only-buffer): Avoid some needless mode changes.

11 years ago* url.el (url-retrieve-internal): Fix last change.
Chong Yidong [Thu, 21 Jun 2012 09:21:28 +0000 (17:21 +0800)]
* url.el (url-retrieve-internal): Fix last change.

Fixes: debbugs:11627

11 years agoMerge from emacs-24; up to 2012-04-26T03:04:36Z!cyd@gnu.org
Glenn Morris [Thu, 21 Jun 2012 07:34:27 +0000 (00:34 -0700)]
Merge from emacs-24; up to 2012-04-26T03:04:36Z!cyd@gnu.org

11 years ago* desktop.el (desktop-read): Use user-emacs-directory if desktop-path is nil.
Chong Yidong [Thu, 21 Jun 2012 07:25:56 +0000 (15:25 +0800)]
* desktop.el (desktop-read): Use user-emacs-directory if desktop-path is nil.

11 years agoFixes to desktop reading logic.
Chong Yidong [Thu, 21 Jun 2012 07:15:42 +0000 (15:15 +0800)]
Fixes to desktop reading logic.

* desktop.el (desktop-read): Don't prompt if daemon.
(desktop-path): Remove . from the default value.

11 years ago* fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
Paul Eggert [Wed, 20 Jun 2012 21:20:06 +0000 (14:20 -0700)]
* fileio.c (Fdefault_file_modes): Block input while fiddling with umask.

Otherwise, the umask might be mistakenly 0 while handling input signals.

11 years agoterm.el (term-send-raw-meta): Make C-M-<char> keys work (Bug#8172).
Chong Yidong [Wed, 20 Jun 2012 16:21:57 +0000 (12:21 -0400)]
term.el (term-send-raw-meta): Make C-M-<char> keys work (Bug#8172).
-------------- This lime and the following will be ignored --------------

modified:
  lisp/ChangeLog
  lisp/term.el

11 years ago* lisp/ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j.
David Röthlisberger [Wed, 20 Jun 2012 15:51:34 +0000 (11:51 -0400)]
* lisp/ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j.

Fixes: debbugs:11201

11 years agoChange term.el to use font-lock.
Chong Yidong [Wed, 20 Jun 2012 09:21:06 +0000 (17:21 +0800)]
Change term.el to use font-lock.

* term.el (term-mode): Set font-lock-defaults.
(term-move-columns, term-insert-char, term-emulate-terminal)
(term-erase-in-line, term-insert-spaces): Use font-lock-face.

Fixes: debbugs:7692

11 years agoFixes to window size calculations in term.el.
Chong Yidong [Wed, 20 Jun 2012 08:34:21 +0000 (16:34 +0800)]
Fixes to window size calculations in term.el.

* term.el (term-window-width): Handle the case of a missing right
fringe.
(term-check-size): Use window-text-height.
(term-mode): Use define-derived-mode.  Minor cleanups.

Fixes: debbugs:8837

11 years ago* net/ange-ftp.el (ange-ftp-get-passwd): Bind
Michael Albinus [Wed, 20 Jun 2012 06:51:53 +0000 (08:51 +0200)]
* net/ange-ftp.el (ange-ftp-get-passwd): Bind
`enable-recursive-minibuffers'.
(ange-ftp-get-process): Throw if `non-essential' is non-nil.

11 years agoFix misspelling of Dmitry's last name in ChangeLog.
Paul Eggert [Tue, 19 Jun 2012 18:57:39 +0000 (11:57 -0700)]
Fix misspelling of Dmitry's last name in ChangeLog.

11 years ago* lisp/ido.el (ido-find-file): Mention C-d binding in docstring.
David Röthlisberger [Tue, 19 Jun 2012 18:17:14 +0000 (14:17 -0400)]
* lisp/ido.el (ido-find-file): Mention C-d binding in docstring.

Fixes: debbugs:11244

11 years ago* src/minibuf.c (Fread_string): Bind minibuffer-completion-table.
Stefan Monnier [Tue, 19 Jun 2012 17:05:41 +0000 (13:05 -0400)]
* src/minibuf.c (Fread_string): Bind minibuffer-completion-table.

11 years ago* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
Dmitry Antipov [Tue, 19 Jun 2012 16:56:28 +0000 (20:56 +0400)]
* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
* print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.

11 years ago* lisp/progmodes/python.el (python-mode): Derive from prog-mode.
Glenn Morris [Tue, 19 Jun 2012 16:04:47 +0000 (09:04 -0700)]
* lisp/progmodes/python.el (python-mode): Derive from prog-mode.

11 years agoIn EDT emulator, allow updating of menu-bar Buffers menu.
Kevin Gallagher [Tue, 19 Jun 2012 07:05:44 +0000 (15:05 +0800)]
In EDT emulator, allow updating of menu-bar Buffers menu.

* lisp/emulation/edt.el (edt-default-menu-bar-update-buffers)
(edt-user-menu-bar-update-buffers): New functions.
(edt-default-emulation-setup, edt-user-emulation-setup): Use them.

11 years agoPreserve tty top-frames under various window-changing operations.
Chong Yidong [Tue, 19 Jun 2012 06:49:50 +0000 (14:49 +0800)]
Preserve tty top-frames under various window-changing operations.

* subr.el (with-selected-window): Preserve the selected window's
terminal's top-frame.

* window.el (save-selected-window): Likewise.

* frame.c (delete_frame): When selecting a frame on a different
text terminal, do not alter the terminal's top-frame.

* term.c (Ftty_top_frame): New function.

* xdisp.c (format_mode_line_unwind_data): Record the target
frame's selected window and its terminal's top-frame.
(unwind_format_mode_line): Restore them.
(x_consider_frame_title, display_mode_line, Fformat_mode_line):
Callers changed.
(x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
since tty frames can be explicitly named.
(prepare_menu_bars): Likewise.

Fixes: debbugs:4702

11 years agoRename infodir to buildinfodir in doc/*/Makefile.in (bug#11737)
Glenn Morris [Tue, 19 Jun 2012 01:59:38 +0000 (21:59 -0400)]
Rename infodir to buildinfodir in doc/*/Makefile.in (bug#11737)

This also makes it clearer that it has no relation to the "infodir"
used by install.

11 years agognus-win.el (gnus-configure-frame): Pass an arg to window-dedicated-p
Nelson Ferreira [Mon, 18 Jun 2012 23:12:10 +0000 (23:12 +0000)]
gnus-win.el (gnus-configure-frame): Pass an arg to window-dedicated-p

11 years agoPort byte-code-meter to modern targets.
Paul Eggert [Mon, 18 Jun 2012 22:53:53 +0000 (15:53 -0700)]
Port byte-code-meter to modern targets.

* bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
!CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
CHECK_LISP_OBJECT_TYPE reported by Dmitry Andropov in
<http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
(METER_1, METER_2): Simplify.

11 years ago* lisp/progmodes/python.el (python-rx-constituents): Move backquote.
Stefan Monnier [Mon, 18 Jun 2012 20:41:23 +0000 (16:41 -0400)]
* lisp/progmodes/python.el (python-rx-constituents): Move backquote.
(python-skeleton-define, python-define-auxiliary-skeleton): Use `declare'.

11 years ago* minibuffer.el (read-file-name-default): Revert the patch from 2012-06-17.
Michael Albinus [Mon, 18 Jun 2012 20:39:52 +0000 (22:39 +0200)]
* minibuffer.el (read-file-name-default): Revert the patch from 2012-06-17.

11 years ago* lisp/emacs-lisp/pcase.el (pcase--expand): Warn for unused pattern.
Stefan Monnier [Mon, 18 Jun 2012 19:23:35 +0000 (15:23 -0400)]
* lisp/emacs-lisp/pcase.el (pcase--expand): Warn for unused pattern.
(pcase--u1, pcase--q1): Don't use apply-partially.

11 years agoFix python.el obsolescence versions
Glenn Morris [Mon, 18 Jun 2012 18:23:59 +0000 (14:23 -0400)]
Fix python.el obsolescence versions

* lisp/progmodes/python.el (python-proc, python-buffer)
(python-send-receive, python-send-string): Fix obsolete versions.

11 years agoAdd coding cookie
Glenn Morris [Mon, 18 Jun 2012 18:04:21 +0000 (14:04 -0400)]
Add coding cookie

11 years agoFix return value of `defun' and un-define it.
Stefan Monnier [Mon, 18 Jun 2012 15:57:41 +0000 (11:57 -0400)]
Fix return value of `defun' and un-define it.
* src/data.c (Fdefalias): Return `symbol'.
* doc/lispref/functions.texi (Defining Functions):
* doc/lispref/macros.texi (Defining Macros): Un-define the return value of
`defun', `defmacro' and `defalias'.

Fixes: debbugs:11686

11 years agoHandle cases where buffer gets killed while running Fkill_buffer (Bug#11665).
Martin Rudalics [Mon, 18 Jun 2012 07:20:19 +0000 (09:20 +0200)]
Handle cases where buffer gets killed while running Fkill_buffer (Bug#11665).

* buffer.c (Fkill_buffer): Don't throw an error when the buffer
gets killed during executing of this function (Bug#11665).  Try
to always return Qt when the buffer has been actually killed.
(Vkill_buffer_query_functions): In doc-string say that functions
run by this hook should not change the current buffer.

11 years agoFix recently-introduced process.c problems found by static checking.
Paul Eggert [Mon, 18 Jun 2012 06:58:00 +0000 (23:58 -0700)]
Fix recently-introduced process.c problems found by static checking.

* process.c (write_queue_push, write_queue_pop, send_process):
Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
(write_queue_pop): Fix pointer signedness problem.
(send_process): Remove unused local.

11 years agoCompletely remove stringp check in special-display-p.
Martin Rudalics [Mon, 18 Jun 2012 06:22:22 +0000 (08:22 +0200)]
Completely remove stringp check in special-display-p.

* window.el (special-display-p): Completely remove stringp
check.  Suggested by Andreas Schwab <schwab@linux-m68k.org>.

11 years ago* minibuffer.el (read-file-name-default): Bind `non-essential' to `t'.
Michael Albinus [Sun, 17 Jun 2012 18:54:39 +0000 (20:54 +0200)]
* minibuffer.el (read-file-name-default): Bind `non-essential' to `t'.

* net/tramp.el (tramp-file-name-handler): Catch 'non-essential.

* net/ange-ftp.el (ange-ftp-gwp-start, ange-ftp-start-process):
* net/tramp-sh.el (tramp-maybe-open-connection):
Throw if `non-essential' is non-nil.

11 years agoChangeLog date fixes
Glenn Morris [Sun, 17 Jun 2012 18:52:31 +0000 (11:52 -0700)]
ChangeLog date fixes

11 years agoIn special-display-p signal an error if BUFFER-NAME is not a string (Bug#11713).
Martin Rudalics [Sun, 17 Jun 2012 10:43:50 +0000 (12:43 +0200)]
In special-display-p signal an error if BUFFER-NAME is not a string (Bug#11713).

* window.el (special-display-p): Signal an error if BUFFER-NAME
is not a string (Bug#11713).