Now on revision 108780. ------------------------------------------------------------ revno: 108780 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-06-27 23:58:39 -0700 message: * emacs.py, emacs2.py, emacs3.py: Remove files. AFAICS, the new python.el does not use these files. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-06-24 17:07:26 +0000 +++ etc/ChangeLog 2012-06-28 06:58:39 +0000 @@ -1,3 +1,7 @@ +2012-06-28 Glenn Morris + + * emacs.py, emacs2.py, emacs3.py: Remove files, no longer used. + 2012-06-24 Lawrence Mitchell * NEWS: Move and improve the defun/defalias changes (bug#11686). === removed file 'etc/emacs.py' --- etc/emacs.py 2011-01-15 23:16:57 +0000 +++ etc/emacs.py 1970-01-01 00:00:00 +0000 @@ -1,10 +0,0 @@ -"""Wrapper for version-specific implementations of python.el helper -functions """ - -import sys - -if sys.version_info[0] == 3: - from emacs3 import * -else: - from emacs2 import * - === removed file 'etc/emacs2.py' --- etc/emacs2.py 2012-01-19 07:21:25 +0000 +++ etc/emacs2.py 1970-01-01 00:00:00 +0000 @@ -1,236 +0,0 @@ -"""Definitions used by commands sent to inferior Python in python.el.""" - -# Copyright (C) 2004-2012 Free Software Foundation, Inc. -# Author: Dave Love - -# This file is part of GNU Emacs. - -# GNU Emacs is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs. If not, see . - -import os, sys, traceback, inspect, __main__ - -try: - set -except: - from sets import Set as set - -__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] - -def format_exception (filename, should_remove_self): - type, value, tb = sys.exc_info () - sys.last_type = type - sys.last_value = value - sys.last_traceback = tb - if type is SyntaxError: - try: # parse the error message - msg, (dummy_filename, lineno, offset, line) = value - except: - pass # Not the format we expect; leave it alone - else: - # Stuff in the right filename - value = SyntaxError(msg, (filename, lineno, offset, line)) - sys.last_value = value - res = traceback.format_exception_only (type, value) - # There are some compilation errors which do not provide traceback so we - # should not massage it. - if should_remove_self: - tblist = traceback.extract_tb (tb) - del tblist[:1] - res = traceback.format_list (tblist) - if res: - res.insert(0, "Traceback (most recent call last):\n") - res[len(res):] = traceback.format_exception_only (type, value) - # traceback.print_exception(type, value, tb) - for line in res: print line, - -def eexecfile (file): - """Execute FILE and then remove it. - Execute the file within the __main__ namespace. - If we get an exception, print a traceback with the top frame - (ourselves) excluded.""" - # We cannot use real execfile since it has a bug where the file stays - # locked forever (under w32) if SyntaxError occurs. - # --- code based on code.py and PyShell.py. - try: - try: - source = open (file, "r").read() - code = compile (source, file, "exec") - # Other exceptions (shouldn't be any...) will (correctly) fall - # through to "final". - except (OverflowError, SyntaxError, ValueError): - # FIXME: When can compile() raise anything else than - # SyntaxError ???? - format_exception (file, False) - return - try: - exec code in __main__.__dict__ - except: - format_exception (file, True) - finally: - os.remove (file) - -def eargs (name, imports): - "Get arglist of NAME for Eldoc &c." - try: - if imports: exec imports - parts = name.split ('.') - if len (parts) > 1: - exec 'import ' + parts[0] # might fail - func = eval (name) - if inspect.isbuiltin (func) or type(func) is type: - doc = func.__doc__ - if doc.find (' ->') != -1: - print '_emacs_out', doc.split (' ->')[0] - else: - print '_emacs_out', doc.split ('\n')[0] - return - if inspect.ismethod (func): - func = func.im_func - if not inspect.isfunction (func): - print '_emacs_out ' - return - (args, varargs, varkw, defaults) = inspect.getargspec (func) - # No space between name and arglist for consistency with builtins. - print '_emacs_out', \ - func.__name__ + inspect.formatargspec (args, varargs, varkw, - defaults) - except: - print "_emacs_out " - -def all_names (object): - """Return (an approximation to) a list of all possible attribute - names reachable via the attributes of OBJECT, i.e. roughly the - leaves of the dictionary tree under it.""" - - def do_object (object, names): - if inspect.ismodule (object): - do_module (object, names) - elif inspect.isclass (object): - do_class (object, names) - # Might have an object without its class in scope. - elif hasattr (object, '__class__'): - names.add ('__class__') - do_class (object.__class__, names) - # Probably not a good idea to try to enumerate arbitrary - # dictionaries... - return names - - def do_module (module, names): - if hasattr (module, '__all__'): # limited export list - names.update(module.__all__) - for i in module.__all__: - do_object (getattr (module, i), names) - else: # use all names - names.update(dir (module)) - for i in dir (module): - do_object (getattr (module, i), names) - return names - - def do_class (object, names): - ns = dir (object) - names.update(ns) - if hasattr (object, '__bases__'): # superclasses - for i in object.__bases__: do_object (i, names) - return names - - return do_object (object, set([])) - -def complete (name, imports): - """Complete TEXT in NAMESPACE and print a Lisp list of completions. - Exec IMPORTS first.""" - import __main__, keyword - - def class_members(object): - names = dir (object) - if hasattr (object, '__bases__'): - for super in object.__bases__: - names = class_members (super) - return names - - names = set([]) - base = None - try: - dict = __main__.__dict__.copy() - if imports: exec imports in dict - l = len (name) - if not "." in name: - for src in [dir (__builtins__), keyword.kwlist, dict.keys()]: - for elt in src: - if elt[:l] == name: names.add(elt) - else: - base = name[:name.rfind ('.')] - name = name[name.rfind('.')+1:] - try: - object = eval (base, dict) - names = set(dir (object)) - if hasattr (object, '__class__'): - names.add('__class__') - names.update(class_members (object)) - except: names = all_names (dict) - except: - print sys.exc_info() - names = [] - - l = len(name) - print '_emacs_out (', - for n in names: - if name == n[:l]: - if base: print '"%s.%s"' % (base, n), - else: print '"%s"' % n, - print ')' - -def ehelp (name, imports): - """Get help on string NAME. - First try to eval name for, e.g. user definitions where we need - the object. Otherwise try the string form.""" - locls = {} - if imports: - try: exec imports in locls - except: pass - try: help (eval (name, globals(), locls)) - except: help (name) - -def eimport (mod, dir): - """Import module MOD with directory DIR at the head of the search path. - NB doesn't load from DIR if MOD shadows a system module.""" - from __main__ import __dict__ - - path0 = sys.path[0] - sys.path[0] = dir - try: - try: - if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): - reload (__dict__[mod]) - else: - __dict__[mod] = __import__ (mod) - except: - (type, value, tb) = sys.exc_info () - print "Traceback (most recent call last):" - traceback.print_exception (type, value, tb.tb_next) - finally: - sys.path[0] = path0 - -def modpath (module): - """Return the source file for the given MODULE (or None). -Assumes that MODULE.py and MODULE.pyc are in the same directory.""" - try: - path = __import__ (module).__file__ - if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): - path = path[:-1] - print "_emacs_out", path - except: - print "_emacs_out ()" - -# print '_emacs_ok' # ready for input and can call continuation - === removed file 'etc/emacs3.py' --- etc/emacs3.py 2012-01-19 07:21:25 +0000 +++ etc/emacs3.py 1970-01-01 00:00:00 +0000 @@ -1,234 +0,0 @@ -# Copyright (C) 2004-2012 Free Software Foundation, Inc. -# Author: Dave Love - -# This file is part of GNU Emacs. - -# GNU Emacs is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs. If not, see . - -import os, sys, traceback, inspect, imp, __main__ - -try: - set -except: - from sets import Set as set - -__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] - -def format_exception (filename, should_remove_self): - type, value, tb = sys.exc_info () - sys.last_type = type - sys.last_value = value - sys.last_traceback = tb - if type is SyntaxError: - try: # parse the error message - msg, (dummy_filename, lineno, offset, line) = value - except: - pass # Not the format we expect; leave it alone - else: - # Stuff in the right filename - value = SyntaxError(msg, (filename, lineno, offset, line)) - sys.last_value = value - res = traceback.format_exception_only (type, value) - # There are some compilation errors which do not provide traceback so we - # should not massage it. - if should_remove_self: - tblist = traceback.extract_tb (tb) - del tblist[:1] - res = traceback.format_list (tblist) - if res: - res.insert(0, "Traceback (most recent call last):\n") - res[len(res):] = traceback.format_exception_only (type, value) - # traceback.print_exception(type, value, tb) - for line in res: print(line, end=' ') - -def eexecfile (file): - """Execute FILE and then remove it. - Execute the file within the __main__ namespace. - If we get an exception, print a traceback with the top frame - (ourselves) excluded.""" - # We cannot use real execfile since it has a bug where the file stays - # locked forever (under w32) if SyntaxError occurs. - # --- code based on code.py and PyShell.py. - try: - try: - source = open (file, "r").read() - code = compile (source, file, "exec") - # Other exceptions (shouldn't be any...) will (correctly) fall - # through to "final". - except (OverflowError, SyntaxError, ValueError): - # FIXME: When can compile() raise anything else than - # SyntaxError ???? - format_exception (file, False) - return - try: - exec(code, __main__.__dict__) - except: - format_exception (file, True) - finally: - os.remove (file) - -def eargs (name, imports): - "Get arglist of NAME for Eldoc &c." - try: - if imports: exec(imports) - parts = name.split ('.') - if len (parts) > 1: - exec('import ' + parts[0]) # might fail - func = eval (name) - if inspect.isbuiltin (func) or type(func) is type: - doc = func.__doc__ - if doc.find (' ->') != -1: - print('_emacs_out', doc.split (' ->')[0]) - else: - print('_emacs_out', doc.split ('\n')[0]) - return - if inspect.ismethod (func): - func = func.im_func - if not inspect.isfunction (func): - print('_emacs_out ') - return - (args, varargs, varkw, defaults) = inspect.getargspec (func) - # No space between name and arglist for consistency with builtins. - print('_emacs_out', \ - func.__name__ + inspect.formatargspec (args, varargs, varkw, - defaults)) - except: - print("_emacs_out ") - -def all_names (object): - """Return (an approximation to) a list of all possible attribute - names reachable via the attributes of OBJECT, i.e. roughly the - leaves of the dictionary tree under it.""" - - def do_object (object, names): - if inspect.ismodule (object): - do_module (object, names) - elif inspect.isclass (object): - do_class (object, names) - # Might have an object without its class in scope. - elif hasattr (object, '__class__'): - names.add ('__class__') - do_class (object.__class__, names) - # Probably not a good idea to try to enumerate arbitrary - # dictionaries... - return names - - def do_module (module, names): - if hasattr (module, '__all__'): # limited export list - names.update(module.__all__) - for i in module.__all__: - do_object (getattr (module, i), names) - else: # use all names - names.update(dir (module)) - for i in dir (module): - do_object (getattr (module, i), names) - return names - - def do_class (object, names): - ns = dir (object) - names.update(ns) - if hasattr (object, '__bases__'): # superclasses - for i in object.__bases__: do_object (i, names) - return names - - return do_object (object, set([])) - -def complete (name, imports): - """Complete TEXT in NAMESPACE and print a Lisp list of completions. - Exec IMPORTS first.""" - import __main__, keyword - - def class_members(object): - names = dir (object) - if hasattr (object, '__bases__'): - for super in object.__bases__: - names = class_members (super) - return names - - names = set([]) - base = None - try: - dict = __main__.__dict__.copy() - if imports: exec(imports, dict) - l = len (name) - if not "." in name: - for src in [dir (__builtins__), keyword.kwlist, list(dict.keys())]: - for elt in src: - if elt[:l] == name: names.add(elt) - else: - base = name[:name.rfind ('.')] - name = name[name.rfind('.')+1:] - try: - object = eval (base, dict) - names = set(dir (object)) - if hasattr (object, '__class__'): - names.add('__class__') - names.update(class_members (object)) - except: names = all_names (dict) - except: - print(sys.exc_info()) - names = [] - - l = len(name) - print('_emacs_out (', end=' ') - for n in names: - if name == n[:l]: - if base: print('"%s.%s"' % (base, n), end=' ') - else: print('"%s"' % n, end=' ') - print(')') - -def ehelp (name, imports): - """Get help on string NAME. - First try to eval name for, e.g. user definitions where we need - the object. Otherwise try the string form.""" - locls = {} - if imports: - try: exec(imports, locls) - except: pass - try: help (eval (name, globals(), locls)) - except: help (name) - -def eimport (mod, dir): - """Import module MOD with directory DIR at the head of the search path. - NB doesn't load from DIR if MOD shadows a system module.""" - from __main__ import __dict__ - - path0 = sys.path[0] - sys.path[0] = dir - try: - try: - if mod in __dict__ and inspect.ismodule (__dict__[mod]): - imp.reload (__dict__[mod]) - else: - __dict__[mod] = __import__ (mod) - except: - (type, value, tb) = sys.exc_info () - print("Traceback (most recent call last):") - traceback.print_exception (type, value, tb.tb_next) - finally: - sys.path[0] = path0 - -def modpath (module): - """Return the source file for the given MODULE (or None). -Assumes that MODULE.py and MODULE.pyc are in the same directory.""" - try: - path = __import__ (module).__file__ - if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): - path = path[:-1] - print("_emacs_out", path) - except: - print("_emacs_out ()") - -# print '_emacs_ok' # ready for input and can call continuation - ------------------------------------------------------------ revno: 108779 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-06-27 22:29:58 -0700 message: * configure.in: Don't check for sys/select.h, sys/time.h, utime.h. Emacs proper no longer uses these headers, and can rely on Gnulib for these checks. diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-28 00:07:33 +0000 +++ ChangeLog 2012-06-28 05:29:58 +0000 @@ -1,5 +1,9 @@ 2012-06-28 Paul Eggert + * configure.in: Don't check for sys/select.h, sys/time.h, utime.h. + Emacs proper no longer uses these headers, and can rely on Gnulib + for these checks. + Merge from gnulib. * m4/getopt.m4: Copy new version from gnulib, incorporating: getopt-posix: No longer guarantee that option processing is resettable. === modified file 'configure.in' --- configure.in 2012-06-27 23:57:56 +0000 +++ configure.in 2012-06-28 05:29:58 +0000 @@ -1188,7 +1188,6 @@ dnl checks for header files AC_CHECK_HEADERS_ONCE( - sys/select.h sys/time.h utime.h linux/version.h sys/systeminfo.h stdio_ext.h fcntl.h coff.h pty.h sys/vlimit.h sys/resource.h ------------------------------------------------------------ revno: 108778 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11799 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 23:31:27 -0400 message: Make inlining of other-mode interpreted functions work. * lisp/emacs-lisp/bytecomp.el (byte-compile--refiy-function): New fun. (byte-compile): Use it to fix compilation of lexical-binding closures. * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Compile the function, if needed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 21:16:32 +0000 +++ lisp/ChangeLog 2012-06-28 03:31:27 +0000 @@ -1,3 +1,11 @@ +2012-06-28 Stefan Monnier + + Make inlining of other-mode interpreted functions work (bug#11799). + * emacs-lisp/bytecomp.el (byte-compile--refiy-function): New fun. + (byte-compile): Use it to fix compilation of lexical-binding closures. + * emacs-lisp/byte-opt.el (byte-compile-inline-expand): Compile the + function, if needed. + 2012-06-27 Stefan Monnier * help-mode.el (help-make-xrefs): Don't just withstand === modified file 'lisp/emacs-lisp/byte-opt.el' --- lisp/emacs-lisp/byte-opt.el 2012-06-13 13:16:34 +0000 +++ lisp/emacs-lisp/byte-opt.el 2012-06-28 03:31:27 +0000 @@ -266,42 +266,30 @@ ;; (message "Inlining byte-code for %S!" name) ;; The byte-code will be really inlined in byte-compile-unfold-bcf. `(,fn ,@(cdr form))) - ((or (and `(lambda ,args . ,body) (let env nil)) - `(closure ,env ,args . ,body)) + ((or `(lambda . ,_) `(closure . ,_)) (if (not (or (eq fn localfn) ;From the same file => same mode. - (eq (not lexical-binding) (not env)))) ;Same mode. + (eq (car fn) ;Same mode. + (if lexical-binding 'closure 'lambda)))) ;; While byte-compile-unfold-bcf can inline dynbind byte-code into ;; letbind byte-code (or any other combination for that matter), we ;; can only inline dynbind source into dynbind source or letbind ;; source into letbind source. - ;; FIXME: we could of course byte-compile the inlined function - ;; first, and then inline its byte-code. - form - (let ((renv ())) - ;; Turn the function's closed vars (if any) into local let bindings. - (dolist (binding env) - (cond - ((consp binding) - ;; We check shadowing by the args, so that the `let' can be - ;; moved within the lambda, which can then be unfolded. - ;; FIXME: Some of those bindings might be unused in `body'. - (unless (memq (car binding) args) ;Shadowed. - (push `(,(car binding) ',(cdr binding)) renv))) - ((eq binding t)) - (t (push `(defvar ,binding) body)))) - (let ((newfn (if (eq fn localfn) - ;; If `fn' is from the same file, it has already - ;; been preprocessed! - `(function ,fn) - (byte-compile-preprocess - (if (null renv) - `(lambda ,args ,@body) - `(lambda ,args (let ,(nreverse renv) ,@body))))))) - (if (eq (car-safe newfn) 'function) - (byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form))) - (byte-compile-log-warning - (format "Inlining closure %S failed" name)) - form))))) + (progn + ;; We can of course byte-compile the inlined function + ;; first, and then inline its byte-code. + (byte-compile name) + `(,(symbol-function name) ,@(cdr form))) + (let ((newfn (if (eq fn localfn) + ;; If `fn' is from the same file, it has already + ;; been preprocessed! + `(function ,fn) + (byte-compile-preprocess + (byte-compile--refiy-function fn))))) + (if (eq (car-safe newfn) 'function) + (byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form))) + (byte-compile-log-warning + (format "Inlining closure %S failed" name)) + form)))) (t ;; Give up on inlining. form)))) === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-06-22 13:42:38 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-06-28 03:31:27 +0000 @@ -2451,7 +2451,26 @@ (- (position-bytes (point)) (point-min) -1) (goto-char (point-max)))))) - +(defun byte-compile--refiy-function (fun) + "Return an expression which will evaluate to a function value FUN. +FUN should be either a `lambda' value or a `closure' value." + (pcase-let* (((or (and `(lambda ,args . ,body) (let env nil)) + `(closure ,env ,args . ,body)) fun) + (renv ())) + ;; Turn the function's closed vars (if any) into local let bindings. + (dolist (binding env) + (cond + ((consp binding) + ;; We check shadowing by the args, so that the `let' can be moved + ;; within the lambda, which can then be unfolded. FIXME: Some of those + ;; bindings might be unused in `body'. + (unless (memq (car binding) args) ;Shadowed. + (push `(,(car binding) ',(cdr binding)) renv))) + ((eq binding t)) + (t (push `(defvar ,binding) body)))) + (if (null renv) + `(lambda ,args ,@body) + `(lambda ,args (let ,(nreverse renv) ,@body))))) ;;;###autoload (defun byte-compile (form) @@ -2459,23 +2478,29 @@ If FORM is a lambda or a macro, byte-compile it as a function." (displaying-byte-compile-warnings (byte-compile-close-variables - (let* ((fun (if (symbolp form) + (let* ((lexical-binding lexical-binding) + (fun (if (symbolp form) (and (fboundp form) (symbol-function form)) form)) (macro (eq (car-safe fun) 'macro))) (if macro (setq fun (cdr fun))) - (cond ((eq (car-safe fun) 'lambda) + (when (symbolp form) + (unless (memq (car-safe fun) '(closure lambda)) + (error "Don't know how to compile %S" fun)) + (setq fun (byte-compile--refiy-function fun)) + (setq lexical-binding (eq (car fun) 'closure))) + (unless (eq (car-safe fun) 'lambda) + (error "Don't know how to compile %S" fun)) ;; Expand macros. (setq fun (byte-compile-preprocess fun)) ;; Get rid of the `function' quote added by the `lambda' macro. (if (eq (car-safe fun) 'function) (setq fun (cadr fun))) - (setq fun (if macro - (cons 'macro (byte-compile-lambda fun)) - (byte-compile-lambda fun))) + (setq fun (byte-compile-lambda fun)) + (if macro (push 'macro fun)) (if (symbolp form) - (defalias form fun) - fun))))))) + (fset form fun) + fun))))) (defun byte-compile-sexp (sexp) "Compile and return SEXP." ------------------------------------------------------------ revno: 108777 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-06-27 17:07:33 -0700 message: Merge from gnulib. * m4/getopt.m4: Copy new version from gnulib, incorporating: getopt-posix: No longer guarantee that option processing is resettable. diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-27 23:57:56 +0000 +++ ChangeLog 2012-06-28 00:07:33 +0000 @@ -1,3 +1,9 @@ +2012-06-28 Paul Eggert + + Merge from gnulib. + * m4/getopt.m4: Copy new version from gnulib, incorporating: + getopt-posix: No longer guarantee that option processing is resettable. + 2012-06-27 Glenn Morris * configure.in: Only check for paxctl on gnu-linux. (Bug#11398#26) === modified file 'm4/getopt.m4' --- m4/getopt.m4 2012-06-23 17:25:56 +0000 +++ m4/getopt.m4 2012-06-28 00:07:33 +0000 @@ -1,4 +1,4 @@ -# getopt.m4 serial 42 +# getopt.m4 serial 43 dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -74,11 +74,6 @@ AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) fi - dnl mingw's getopt (in libmingwex.a) does weird things when the options - dnl strings starts with '+' and it's not the first call. Some internal state - dnl is left over from earlier calls, and neither setting optind = 0 nor - dnl setting optreset = 1 get rid of this internal state. - dnl POSIX is silent on optind vs. optreset, so we allow either behavior. dnl POSIX 2008 does not specify leading '+' behavior, but see dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on dnl the next version of POSIX. For now, we only guarantee leading '+' @@ -87,120 +82,124 @@ AC_CACHE_CHECK([whether getopt is POSIX compatible], [gl_cv_func_getopt_posix], [ - dnl BSD getopt_long uses an incompatible method to reset option - dnl processing. Existence of the optreset variable, in and of - dnl itself, is not a reason to replace getopt, but knowledge - dnl of the variable is needed to determine how to reset and - dnl whether a reset reparses the environment. Solaris - dnl supports neither optreset nor optind=0, but keeps no state - dnl that needs a reset beyond setting optind=1; detect Solaris - dnl by getopt_clip. - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[int *p = &optreset; return optreset;]])], - [gl_optind_min=1], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[return !getopt_clip;]])], - [gl_optind_min=1], - [gl_optind_min=0])]) - - dnl This test fails on mingw and succeeds on many other platforms. - gl_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include - -int -main () -{ - { - static char program[] = "program"; - static char a[] = "-a"; - static char foo[] = "foo"; - static char bar[] = "bar"; - char *argv[] = { program, a, foo, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (4, argv, "ab"); - if (!(c == 'a')) - return 1; - c = getopt (4, argv, "ab"); - if (!(c == -1)) - return 2; - if (!(optind == 2)) - return 3; - } - /* Some internal state exists at this point. */ - { - static char program[] = "program"; - static char donald[] = "donald"; - static char p[] = "-p"; - static char billy[] = "billy"; - static char duck[] = "duck"; - static char a[] = "-a"; - static char bar[] = "bar"; - char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (7, argv, "+abp:q:"); - if (!(c == -1)) - return 4; - if (!(strcmp (argv[0], "program") == 0)) - return 5; - if (!(strcmp (argv[1], "donald") == 0)) - return 6; - if (!(strcmp (argv[2], "-p") == 0)) - return 7; - if (!(strcmp (argv[3], "billy") == 0)) - return 8; - if (!(strcmp (argv[4], "duck") == 0)) - return 9; - if (!(strcmp (argv[5], "-a") == 0)) - return 10; - if (!(strcmp (argv[6], "bar") == 0)) - return 11; - if (!(optind == 1)) - return 12; - } - /* Detect Mac OS X 10.5, AIX 7.1 bug. */ - { - static char program[] = "program"; - static char ab[] = "-ab"; - char *argv[3] = { program, ab, NULL }; - optind = OPTIND_MIN; - opterr = 0; - if (getopt (2, argv, "ab:") != 'a') - return 13; - if (getopt (2, argv, "ab:") != '?') - return 14; - if (optopt != 'b') - return 15; - if (optind != 2) - return 16; - } - - return 0; -} -]])], - [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no], - [case "$host_os" in - mingw*) gl_cv_func_getopt_posix="guessing no";; - darwin* | aix*) gl_cv_func_getopt_posix="guessing no";; - *) gl_cv_func_getopt_posix="guessing yes";; - esac - ]) - CPPFLAGS=$gl_save_CPPFLAGS + dnl Merging these three different test programs into a single one + dnl would require a reset mechanism. On BSD systems, it can be done + dnl through 'optreset'; on some others (glibc), it can be done by + dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1, + dnl Solaris 9, musl libc), there is no such mechanism. + if test $cross_compiling = no; then + dnl Sanity check. Succeeds everywhere (except on MSVC, + dnl which lacks and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + if test $gl_cv_func_getopt_posix = maybe; then + dnl Sanity check with '+'. Succeeds everywhere (except on MSVC, + dnl which lacks and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + fi + if test $gl_cv_func_getopt_posix = maybe; then + dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug. + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} +]])], + [gl_cv_func_getopt_posix=yes], + [gl_cv_func_getopt_posix=no]) + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi ]) case "$gl_cv_func_getopt_posix" in *no) gl_replace_getopt=yes ;; @@ -304,12 +303,8 @@ ]])], [gl_cv_func_getopt_gnu=yes], [gl_cv_func_getopt_gnu=no], - [dnl Cross compiling. Guess based on host and declarations. - case $host_os:$ac_cv_have_decl_optreset in - *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;; - *:yes) gl_cv_func_getopt_gnu=no;; - *) gl_cv_func_getopt_gnu=yes;; - esac + [dnl Cross compiling. Assume the worst, even on glibc platforms. + gl_cv_func_getopt_gnu="guessing no" ]) case $gl_had_POSIXLY_CORRECT in exported) ;; @@ -317,7 +312,7 @@ *) AS_UNSET([POSIXLY_CORRECT]) ;; esac ]) - if test "$gl_cv_func_getopt_gnu" = "no"; then + if test "$gl_cv_func_getopt_gnu" != yes; then gl_replace_getopt=yes else AC_CACHE_CHECK([for working GNU getopt_long function], ------------------------------------------------------------ revno: 108776 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-06-27 19:57:56 -0400 message: * configure.in: Only check for paxctl on gnu-linux. http://debbugs.gnu.org/11398#26 NetBSD has a "paxctl" that does not support the same options as the GNU/Linux version... diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-27 07:47:56 +0000 +++ ChangeLog 2012-06-27 23:57:56 +0000 @@ -1,5 +1,7 @@ 2012-06-27 Glenn Morris + * configure.in: Only check for paxctl on gnu-linux. (Bug#11398#26) + * INSTALL: Remove references to paths.el. 2012-06-26 Eli Zaretskii === modified file 'configure.in' --- configure.in 2012-06-25 14:07:04 +0000 +++ configure.in 2012-06-27 23:57:56 +0000 @@ -699,9 +699,11 @@ $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) dnl Don't use GZIP, which is used by gzip for additional parameters. AC_PATH_PROG(GZIP_PROG, gzip) -AC_PATH_PROG(PAXCTL, paxctl,, - [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) +if test $opsys = gnu-linux; then + AC_PATH_PROG(PAXCTL, paxctl,, + [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) +fi ## Need makeinfo >= 4.7 (?) to build the manuals. AC_PATH_PROG(MAKEINFO, makeinfo, no) ------------------------------------------------------------ revno: 108775 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 17:16:32 -0400 message: * lisp/help-mode.el (help-make-xrefs): Don't just withstand cyclic-variable-indirection but any error in documentation-property. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 21:15:13 +0000 +++ lisp/ChangeLog 2012-06-27 21:16:32 +0000 @@ -1,5 +1,8 @@ 2012-06-27 Stefan Monnier + * help-mode.el (help-make-xrefs): Don't just withstand + cyclic-variable-indirection but any error in documentation-property. + * loadup.el (purify-flag): Pre-grow the hash-table to reduce the memory use. * bindings.el (bindings--define-key): New function. === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2012-06-27 15:11:28 +0000 +++ lisp/emacs-lisp/cl.el 2012-06-27 21:16:32 +0000 @@ -519,7 +519,7 @@ ;; Generalized variables are provided by gv.el, but some details are ;; not 100% compatible: not worth the trouble to add them to cl-lib.el, but we -;; still to support old users of cl.el. +;; still need to support old users of cl.el. ;; FIXME: `letf' is unsatisfactory because it does not really "restore" the ;; previous state. If the getter/setter loses information, that info is === modified file 'lisp/help-mode.el' --- lisp/help-mode.el 2012-06-13 12:36:29 +0000 +++ lisp/help-mode.el 2012-06-27 21:16:32 +0000 @@ -500,14 +500,14 @@ ((and (or (boundp sym) (get sym 'variable-documentation)) - (or - (documentation-property - sym 'variable-documentation) - (condition-case nil + (condition-case err + (or + (documentation-property + sym 'variable-documentation) (documentation-property (indirect-variable sym) - 'variable-documentation) - (cyclic-variable-indirection nil)))) + 'variable-documentation)) + (error (message "No doc found: %S" err) nil))) (help-xref-button 8 'help-variable sym)) ((fboundp sym) (help-xref-button 8 'help-function sym))))))) ------------------------------------------------------------ revno: 108774 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 17:15:13 -0400 message: Get rid of all the manual purecopy calls in menu-bar definitions. * lisp/loadup.el (purify-flag): Pre-grow the hash-table to reduce the memory use. * lisp/bindings.el (bindings--define-key): New function. * lisp/vc/vc-hooks.el, lisp/replace.el, lisp/menu-bar.el: * lisp/international/mule-cmds.el, lisp/emacs-lisp/lisp-mode.el: * lisp/buff-menu.el, lisp/bookmark.el: * bindings.el: Use it to purecopy define-key bindings. * src/fns.c (maybe_resize_hash_table): Output message when growing the purify-hashtable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 18:36:25 +0000 +++ lisp/ChangeLog 2012-06-27 21:15:13 +0000 @@ -1,5 +1,12 @@ 2012-06-27 Stefan Monnier + * loadup.el (purify-flag): Pre-grow the hash-table to reduce the + memory use. + * bindings.el (bindings--define-key): New function. + * vc/vc-hooks.el, replace.el, menu-bar.el, international/mule-cmds.el: + * emacs-lisp/lisp-mode.el, buff-menu.el, bookmark.el: + * bindings.el: Use it to purecopy define-key bindings. + * textmodes/rst.el (rst-adornment-faces-alist): Avoid copy-list. * emacs-lisp/cl.el (flet): Mark obsolete. === modified file 'lisp/bindings.el' --- lisp/bindings.el 2012-06-08 04:23:26 +0000 +++ lisp/bindings.el 2012-06-27 21:15:13 +0000 @@ -273,14 +273,34 @@ (put 'mode-line-process 'risky-local-variable t) (make-variable-buffer-local 'mode-line-process) +(defun bindings--define-key (map key item) + "Make as much as possible of the menus pure." + (declare (indent 2)) + (define-key map key + (cond + ((not (consp item)) item) ;Not sure that could be other than a symbol. + ;; Keymaps can't be made pure otherwise users can't remove/add elements + ;; from/to them any more. + ((keymapp item) item) + ((stringp (car item)) + (if (keymapp (cdr item)) + (cons (purecopy (car item)) (cdr item)) + (purecopy item))) + ((eq 'menu-item (car item)) + (if (keymapp (nth 2 item)) + `(menu-item ,(purecopy (nth 1 item)) ,(nth 2 item) + ,@(purecopy (nthcdr 3 item))) + (purecopy item))) + (t (message "non-menu-item: %S" item) item)))) + (defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\ Menu of mode operations in the mode line.") (defvar mode-line-major-mode-keymap (let ((map (make-sparse-keymap))) - (define-key map [mode-line down-mouse-1] - `(menu-item ,(purecopy "Menu Bar") ignore - :filter (lambda (_) (mouse-menu-major-mode-map)))) + (bindings--define-key map [mode-line down-mouse-1] + `(menu-item "Menu Bar" ignore + :filter ,(lambda (_) (mouse-menu-major-mode-map)))) (define-key map [mode-line mouse-2] 'describe-mode) (define-key map [mode-line down-mouse-3] mode-line-mode-menu) map) "\ @@ -327,13 +347,13 @@ (defvar mode-line-column-line-number-mode-map (let ((map (make-sparse-keymap)) (menu-map (make-sparse-keymap "Toggle Line and Column Number Display"))) - (define-key menu-map [line-number-mode] - `(menu-item ,(purecopy "Display Line Numbers") line-number-mode - :help ,(purecopy "Toggle displaying line numbers in the mode-line") + (bindings--define-key menu-map [line-number-mode] + '(menu-item "Display Line Numbers" line-number-mode + :help "Toggle displaying line numbers in the mode-line" :button (:toggle . line-number-mode))) - (define-key menu-map [column-number-mode] - `(menu-item ,(purecopy "Display Column Numbers") column-number-mode - :help ,(purecopy "Toggle displaying column numbers in the mode-line") + (bindings--define-key menu-map [column-number-mode] + '(menu-item "Display Column Numbers" column-number-mode + :help "Toggle displaying column numbers in the mode-line" :button (:toggle . column-number-mode))) (define-key map [mode-line down-mouse-1] menu-map) map) "\ @@ -491,51 +511,51 @@ ;; Use mode-line-mode-menu for local minor-modes only. ;; Global ones can go on the menubar (Options --> Show/Hide). -(define-key mode-line-mode-menu [overwrite-mode] - `(menu-item ,(purecopy "Overwrite (Ovwrt)") overwrite-mode - :help ,(purecopy "Overwrite mode: typed characters replace existing text") +(bindings--define-key mode-line-mode-menu [overwrite-mode] + '(menu-item "Overwrite (Ovwrt)" overwrite-mode + :help "Overwrite mode: typed characters replace existing text" :button (:toggle . overwrite-mode))) -(define-key mode-line-mode-menu [outline-minor-mode] - `(menu-item ,(purecopy "Outline (Outl)") outline-minor-mode +(bindings--define-key mode-line-mode-menu [outline-minor-mode] + '(menu-item "Outline (Outl)" outline-minor-mode ;; XXX: This needs a good, brief description. - :help ,(purecopy "") + :help "" :button (:toggle . (bound-and-true-p outline-minor-mode)))) -(define-key mode-line-mode-menu [highlight-changes-mode] - `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode - :help ,(purecopy "Show changes in the buffer in a distinctive color") +(bindings--define-key mode-line-mode-menu [highlight-changes-mode] + '(menu-item "Highlight changes (Chg)" highlight-changes-mode + :help "Show changes in the buffer in a distinctive color" :button (:toggle . (bound-and-true-p highlight-changes-mode)))) -(define-key mode-line-mode-menu [hide-ifdef-mode] - `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode - :help ,(purecopy "Show/Hide code within #ifdef constructs") +(bindings--define-key mode-line-mode-menu [hide-ifdef-mode] + '(menu-item "Hide ifdef (Ifdef)" hide-ifdef-mode + :help "Show/Hide code within #ifdef constructs" :button (:toggle . (bound-and-true-p hide-ifdef-mode)))) -(define-key mode-line-mode-menu [glasses-mode] - `(menu-item ,(purecopy "Glasses (o^o)") glasses-mode - :help ,(purecopy "Insert virtual separators to make long identifiers easy to read") +(bindings--define-key mode-line-mode-menu [glasses-mode] + '(menu-item "Glasses (o^o)" glasses-mode + :help "Insert virtual separators to make long identifiers easy to read" :button (:toggle . (bound-and-true-p glasses-mode)))) -(define-key mode-line-mode-menu [font-lock-mode] - `(menu-item ,(purecopy "Font Lock") font-lock-mode - :help ,(purecopy "Syntax coloring") +(bindings--define-key mode-line-mode-menu [font-lock-mode] + '(menu-item "Font Lock" font-lock-mode + :help "Syntax coloring" :button (:toggle . font-lock-mode))) -(define-key mode-line-mode-menu [flyspell-mode] - `(menu-item ,(purecopy "Flyspell (Fly)") flyspell-mode - :help ,(purecopy "Spell checking on the fly") +(bindings--define-key mode-line-mode-menu [flyspell-mode] + '(menu-item "Flyspell (Fly)" flyspell-mode + :help "Spell checking on the fly" :button (:toggle . (bound-and-true-p flyspell-mode)))) -(define-key mode-line-mode-menu [auto-revert-tail-mode] - `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode - :help ,(purecopy "Revert the tail of the buffer when buffer grows") +(bindings--define-key mode-line-mode-menu [auto-revert-tail-mode] + '(menu-item "Auto revert tail (Tail)" auto-revert-tail-mode + :help "Revert the tail of the buffer when buffer grows" :enable (buffer-file-name) :button (:toggle . (bound-and-true-p auto-revert-tail-mode)))) -(define-key mode-line-mode-menu [auto-revert-mode] - `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode - :help ,(purecopy "Revert the buffer when the file on disk changes") +(bindings--define-key mode-line-mode-menu [auto-revert-mode] + '(menu-item "Auto revert (ARev)" auto-revert-mode + :help "Revert the buffer when the file on disk changes" :button (:toggle . (bound-and-true-p auto-revert-mode)))) -(define-key mode-line-mode-menu [auto-fill-mode] - `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode - :help ,(purecopy "Automatically insert new lines") +(bindings--define-key mode-line-mode-menu [auto-fill-mode] + '(menu-item "Auto fill (Fill)" auto-fill-mode + :help "Automatically insert new lines" :button (:toggle . auto-fill-function))) -(define-key mode-line-mode-menu [abbrev-mode] - `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode - :help ,(purecopy "Automatically expand abbreviations") +(bindings--define-key mode-line-mode-menu [abbrev-mode] + '(menu-item "Abbrev (Abbrev)" abbrev-mode + :help "Automatically expand abbreviations" :button (:toggle . abbrev-mode))) (defun mode-line-minor-mode-help (event) === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-05-13 03:05:06 +0000 +++ lisp/bookmark.el 2012-06-27 21:15:13 +0000 @@ -2115,36 +2115,36 @@ ;;;###autoload (defvar menu-bar-bookmark-map (let ((map (make-sparse-keymap "Bookmark functions"))) - (define-key map [load] - `(menu-item ,(purecopy "Load a Bookmark File...") bookmark-load - :help ,(purecopy "Load bookmarks from a bookmark file)"))) - (define-key map [write] - `(menu-item ,(purecopy "Save Bookmarks As...") bookmark-write - :help ,(purecopy "Write bookmarks to a file (reading the file name with the minibuffer)"))) - (define-key map [save] - `(menu-item ,(purecopy "Save Bookmarks") bookmark-save - :help ,(purecopy "Save currently defined bookmarks"))) - (define-key map [edit] - `(menu-item ,(purecopy "Edit Bookmark List") bookmark-bmenu-list - :help ,(purecopy "Display a list of existing bookmarks"))) - (define-key map [delete] - `(menu-item ,(purecopy "Delete Bookmark...") bookmark-delete - :help ,(purecopy "Delete a bookmark from the bookmark list"))) - (define-key map [rename] - `(menu-item ,(purecopy "Rename Bookmark...") bookmark-rename - :help ,(purecopy "Change the name of a bookmark"))) - (define-key map [locate] - `(menu-item ,(purecopy "Insert Location...") bookmark-locate - :help ,(purecopy "Insert the name of the file associated with a bookmark"))) - (define-key map [insert] - `(menu-item ,(purecopy "Insert Contents...") bookmark-insert - :help ,(purecopy "Insert the text of the file pointed to by a bookmark"))) - (define-key map [set] - `(menu-item ,(purecopy "Set Bookmark...") bookmark-set - :help ,(purecopy "Set a bookmark named inside a file."))) - (define-key map [jump] - `(menu-item ,(purecopy "Jump to Bookmark...") bookmark-jump - :help ,(purecopy "Jump to a bookmark (a point in some file)"))) + (bindings--define-key map [load] + '(menu-item "Load a Bookmark File..." bookmark-load + :help "Load bookmarks from a bookmark file)")) + (bindings--define-key map [write] + '(menu-item "Save Bookmarks As..." bookmark-write + :help "Write bookmarks to a file (reading the file name with the minibuffer)")) + (bindings--define-key map [save] + '(menu-item "Save Bookmarks" bookmark-save + :help "Save currently defined bookmarks")) + (bindings--define-key map [edit] + '(menu-item "Edit Bookmark List" bookmark-bmenu-list + :help "Display a list of existing bookmarks")) + (bindings--define-key map [delete] + '(menu-item "Delete Bookmark..." bookmark-delete + :help "Delete a bookmark from the bookmark list")) + (bindings--define-key map [rename] + '(menu-item "Rename Bookmark..." bookmark-rename + :help "Change the name of a bookmark")) + (bindings--define-key map [locate] + '(menu-item "Insert Location..." bookmark-locate + :help "Insert the name of the file associated with a bookmark")) + (bindings--define-key map [insert] + '(menu-item "Insert Contents..." bookmark-insert + :help "Insert the text of the file pointed to by a bookmark")) + (bindings--define-key map [set] + '(menu-item "Set Bookmark..." bookmark-set + :help "Set a bookmark named inside a file.")) + (bindings--define-key map [jump] + '(menu-item "Jump to Bookmark..." bookmark-jump + :help "Jump to a bookmark (a point in some file)")) map)) ;;;###autoload === modified file 'lisp/buff-menu.el' --- lisp/buff-menu.el 2012-05-13 03:05:06 +0000 +++ lisp/buff-menu.el 2012-06-27 21:15:13 +0000 @@ -134,68 +134,68 @@ (define-key map [follow-link] 'mouse-face) (define-key map [menu-bar Buffer-menu-mode] (cons (purecopy "Buffer-Menu") menu-map)) - (define-key menu-map [quit] - `(menu-item ,(purecopy "Quit") quit-window - :help ,(purecopy "Remove the buffer menu from the display"))) - (define-key menu-map [rev] - `(menu-item ,(purecopy "Refresh") revert-buffer - :help ,(purecopy "Refresh the *Buffer List* buffer contents"))) - (define-key menu-map [s0] menu-bar-separator) - (define-key menu-map [tf] - `(menu-item ,(purecopy "Show Only File Buffers") Buffer-menu-toggle-files-only + (bindings--define-key menu-map [quit] + '(menu-item "Quit" quit-window + :help "Remove the buffer menu from the display")) + (bindings--define-key menu-map [rev] + '(menu-item "Refresh" revert-buffer + :help "Refresh the *Buffer List* buffer contents")) + (bindings--define-key menu-map [s0] menu-bar-separator) + (bindings--define-key menu-map [tf] + '(menu-item "Show Only File Buffers" Buffer-menu-toggle-files-only :button (:toggle . Buffer-menu-files-only) - :help ,(purecopy "Toggle whether the current buffer-menu displays only file buffers"))) - (define-key menu-map [s1] menu-bar-separator) + :help "Toggle whether the current buffer-menu displays only file buffers")) + (bindings--define-key menu-map [s1] menu-bar-separator) ;; FIXME: The "Select" entries could use better names... - (define-key menu-map [sel] - `(menu-item ,(purecopy "Select Marked") Buffer-menu-select - :help ,(purecopy "Select this line's buffer; also display buffers marked with `>'"))) - (define-key menu-map [bm2] - `(menu-item ,(purecopy "Select Two") Buffer-menu-2-window - :help ,(purecopy "Select this line's buffer, with previous buffer in second window"))) - (define-key menu-map [bm1] - `(menu-item ,(purecopy "Select Current") Buffer-menu-1-window - :help ,(purecopy "Select this line's buffer, alone, in full frame"))) - (define-key menu-map [ow] - `(menu-item ,(purecopy "Select in Other Window") Buffer-menu-other-window - :help ,(purecopy "Select this line's buffer in other window, leaving buffer menu visible"))) - (define-key menu-map [tw] - `(menu-item ,(purecopy "Select in Current Window") Buffer-menu-this-window - :help ,(purecopy "Select this line's buffer in this window"))) - (define-key menu-map [s2] menu-bar-separator) - (define-key menu-map [is] - `(menu-item ,(purecopy "Regexp Isearch Marked Buffers...") Buffer-menu-isearch-buffers-regexp - :help ,(purecopy "Search for a regexp through all marked buffers using Isearch"))) - (define-key menu-map [ir] - `(menu-item ,(purecopy "Isearch Marked Buffers...") Buffer-menu-isearch-buffers - :help ,(purecopy "Search for a string through all marked buffers using Isearch"))) - (define-key menu-map [s3] menu-bar-separator) - (define-key menu-map [by] - `(menu-item ,(purecopy "Bury") Buffer-menu-bury - :help ,(purecopy "Bury the buffer listed on this line"))) - (define-key menu-map [vt] - `(menu-item ,(purecopy "Set Unmodified") Buffer-menu-not-modified - :help ,(purecopy "Mark buffer on this line as unmodified (no changes to save)"))) - (define-key menu-map [ex] - `(menu-item ,(purecopy "Execute") Buffer-menu-execute - :help ,(purecopy "Save and/or delete buffers marked with s or k commands"))) - (define-key menu-map [s4] menu-bar-separator) - (define-key menu-map [delb] - `(menu-item ,(purecopy "Mark for Delete and Move Backwards") Buffer-menu-delete-backwards - :help ,(purecopy "Mark buffer on this line to be deleted by x command and move up one line"))) - (define-key menu-map [del] - `(menu-item ,(purecopy "Mark for Delete") Buffer-menu-delete - :help ,(purecopy "Mark buffer on this line to be deleted by x command"))) + (bindings--define-key menu-map [sel] + '(menu-item "Select Marked" Buffer-menu-select + :help "Select this line's buffer; also display buffers marked with `>'")) + (bindings--define-key menu-map [bm2] + '(menu-item "Select Two" Buffer-menu-2-window + :help "Select this line's buffer, with previous buffer in second window")) + (bindings--define-key menu-map [bm1] + '(menu-item "Select Current" Buffer-menu-1-window + :help "Select this line's buffer, alone, in full frame")) + (bindings--define-key menu-map [ow] + '(menu-item "Select in Other Window" Buffer-menu-other-window + :help "Select this line's buffer in other window, leaving buffer menu visible")) + (bindings--define-key menu-map [tw] + '(menu-item "Select in Current Window" Buffer-menu-this-window + :help "Select this line's buffer in this window")) + (bindings--define-key menu-map [s2] menu-bar-separator) + (bindings--define-key menu-map [is] + '(menu-item "Regexp Isearch Marked Buffers..." Buffer-menu-isearch-buffers-regexp + :help "Search for a regexp through all marked buffers using Isearch")) + (bindings--define-key menu-map [ir] + '(menu-item "Isearch Marked Buffers..." Buffer-menu-isearch-buffers + :help "Search for a string through all marked buffers using Isearch")) + (bindings--define-key menu-map [s3] menu-bar-separator) + (bindings--define-key menu-map [by] + '(menu-item "Bury" Buffer-menu-bury + :help "Bury the buffer listed on this line")) + (bindings--define-key menu-map [vt] + '(menu-item "Set Unmodified" Buffer-menu-not-modified + :help "Mark buffer on this line as unmodified (no changes to save)")) + (bindings--define-key menu-map [ex] + '(menu-item "Execute" Buffer-menu-execute + :help "Save and/or delete buffers marked with s or k commands")) + (bindings--define-key menu-map [s4] menu-bar-separator) + (bindings--define-key menu-map [delb] + '(menu-item "Mark for Delete and Move Backwards" Buffer-menu-delete-backwards + :help "Mark buffer on this line to be deleted by x command and move up one line")) + (bindings--define-key menu-map [del] + '(menu-item "Mark for Delete" Buffer-menu-delete + :help "Mark buffer on this line to be deleted by x command")) - (define-key menu-map [sv] - `(menu-item ,(purecopy "Mark for Save") Buffer-menu-save - :help ,(purecopy "Mark buffer on this line to be saved by x command"))) - (define-key menu-map [umk] - `(menu-item ,(purecopy "Unmark") Buffer-menu-unmark - :help ,(purecopy "Cancel all requested operations on buffer on this line and move down"))) - (define-key menu-map [mk] - `(menu-item ,(purecopy "Mark") Buffer-menu-mark - :help ,(purecopy "Mark buffer on this line for being displayed by v command"))) + (bindings--define-key menu-map [sv] + '(menu-item "Mark for Save" Buffer-menu-save + :help "Mark buffer on this line to be saved by x command")) + (bindings--define-key menu-map [umk] + '(menu-item "Unmark" Buffer-menu-unmark + :help "Cancel all requested operations on buffer on this line and move down")) + (bindings--define-key menu-map [mk] + '(menu-item "Mark" Buffer-menu-mark + :help "Mark buffer on this line for being displayed by v command")) map) "Local keymap for `Buffer-menu-mode' buffers.") === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2012-05-30 03:59:42 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2012-06-27 21:15:13 +0000 @@ -264,110 +264,111 @@ (define-key map "\e\t" 'completion-at-point) (define-key map "\e\C-x" 'eval-defun) (define-key map "\e\C-q" 'indent-pp-sexp) - (define-key map [menu-bar emacs-lisp] (cons (purecopy "Emacs-Lisp") menu-map)) - (define-key menu-map [eldoc] - `(menu-item ,(purecopy "Auto-Display Documentation Strings") eldoc-mode + (bindings--define-key map [menu-bar emacs-lisp] + (cons "Emacs-Lisp" menu-map)) + (bindings--define-key menu-map [eldoc] + '(menu-item "Auto-Display Documentation Strings" eldoc-mode :button (:toggle . (bound-and-true-p eldoc-mode)) - :help ,(purecopy "Display the documentation string for the item under cursor"))) - (define-key menu-map [checkdoc] - `(menu-item ,(purecopy "Check Documentation Strings") checkdoc - :help ,(purecopy "Check documentation strings for style requirements"))) - (define-key menu-map [re-builder] - `(menu-item ,(purecopy "Construct Regexp") re-builder - :help ,(purecopy "Construct a regexp interactively"))) - (define-key menu-map [tracing] (cons (purecopy "Tracing") tracing-map)) - (define-key tracing-map [tr-a] - `(menu-item ,(purecopy "Untrace All") untrace-all - :help ,(purecopy "Untrace all currently traced functions"))) - (define-key tracing-map [tr-uf] - `(menu-item ,(purecopy "Untrace Function...") untrace-function - :help ,(purecopy "Untrace function, and possibly activate all remaining advice"))) - (define-key tracing-map [tr-sep] menu-bar-separator) - (define-key tracing-map [tr-q] - `(menu-item ,(purecopy "Trace Function Quietly...") trace-function-background - :help ,(purecopy "Trace the function with trace output going quietly to a buffer"))) - (define-key tracing-map [tr-f] - `(menu-item ,(purecopy "Trace Function...") trace-function - :help ,(purecopy "Trace the function given as an argument"))) - (define-key menu-map [profiling] (cons (purecopy "Profiling") prof-map)) - (define-key prof-map [prof-restall] - `(menu-item ,(purecopy "Remove Instrumentation for All Functions") elp-restore-all - :help ,(purecopy "Restore the original definitions of all functions being profiled"))) - (define-key prof-map [prof-restfunc] - `(menu-item ,(purecopy "Remove Instrumentation for Function...") elp-restore-function - :help ,(purecopy "Restore an instrumented function to its original definition"))) + :help "Display the documentation string for the item under cursor")) + (bindings--define-key menu-map [checkdoc] + '(menu-item "Check Documentation Strings" checkdoc + :help "Check documentation strings for style requirements")) + (bindings--define-key menu-map [re-builder] + '(menu-item "Construct Regexp" re-builder + :help "Construct a regexp interactively")) + (bindings--define-key menu-map [tracing] (cons "Tracing" tracing-map)) + (bindings--define-key tracing-map [tr-a] + '(menu-item "Untrace All" untrace-all + :help "Untrace all currently traced functions")) + (bindings--define-key tracing-map [tr-uf] + '(menu-item "Untrace Function..." untrace-function + :help "Untrace function, and possibly activate all remaining advice")) + (bindings--define-key tracing-map [tr-sep] menu-bar-separator) + (bindings--define-key tracing-map [tr-q] + '(menu-item "Trace Function Quietly..." trace-function-background + :help "Trace the function with trace output going quietly to a buffer")) + (bindings--define-key tracing-map [tr-f] + '(menu-item "Trace Function..." trace-function + :help "Trace the function given as an argument")) + (bindings--define-key menu-map [profiling] (cons "Profiling" prof-map)) + (bindings--define-key prof-map [prof-restall] + '(menu-item "Remove Instrumentation for All Functions" elp-restore-all + :help "Restore the original definitions of all functions being profiled")) + (bindings--define-key prof-map [prof-restfunc] + '(menu-item "Remove Instrumentation for Function..." elp-restore-function + :help "Restore an instrumented function to its original definition")) - (define-key prof-map [sep-rem] menu-bar-separator) - (define-key prof-map [prof-resall] - `(menu-item ,(purecopy "Reset Counters for All Functions") elp-reset-all - :help ,(purecopy "Reset the profiling information for all functions being profiled"))) - (define-key prof-map [prof-resfunc] - `(menu-item ,(purecopy "Reset Counters for Function...") elp-reset-function - :help ,(purecopy "Reset the profiling information for a function"))) - (define-key prof-map [prof-res] - `(menu-item ,(purecopy "Show Profiling Results") elp-results - :help ,(purecopy "Display current profiling results"))) - (define-key prof-map [prof-pack] - `(menu-item ,(purecopy "Instrument Package...") elp-instrument-package - :help ,(purecopy "Instrument for profiling all function that start with a prefix"))) - (define-key prof-map [prof-func] - `(menu-item ,(purecopy "Instrument Function...") elp-instrument-function - :help ,(purecopy "Instrument a function for profiling"))) - (define-key menu-map [lint] (cons (purecopy "Linting") lint-map)) - (define-key lint-map [lint-di] - `(menu-item ,(purecopy "Lint Directory...") elint-directory - :help ,(purecopy "Lint a directory"))) - (define-key lint-map [lint-f] - `(menu-item ,(purecopy "Lint File...") elint-file - :help ,(purecopy "Lint a file"))) - (define-key lint-map [lint-b] - `(menu-item ,(purecopy "Lint Buffer") elint-current-buffer - :help ,(purecopy "Lint the current buffer"))) - (define-key lint-map [lint-d] - `(menu-item ,(purecopy "Lint Defun") elint-defun - :help ,(purecopy "Lint the function at point"))) - (define-key menu-map [edebug-defun] - `(menu-item ,(purecopy "Instrument Function for Debugging") edebug-defun - :help ,(purecopy "Evaluate the top level form point is in, stepping through with Edebug") - :keys ,(purecopy "C-u C-M-x"))) - (define-key menu-map [separator-byte] menu-bar-separator) - (define-key menu-map [disas] - `(menu-item ,(purecopy "Disassemble Byte Compiled Object...") disassemble - :help ,(purecopy "Print disassembled code for OBJECT in a buffer"))) - (define-key menu-map [byte-recompile] - `(menu-item ,(purecopy "Byte-recompile Directory...") byte-recompile-directory - :help ,(purecopy "Recompile every `.el' file in DIRECTORY that needs recompilation"))) - (define-key menu-map [emacs-byte-compile-and-load] - `(menu-item ,(purecopy "Byte-compile and Load") emacs-lisp-byte-compile-and-load - :help ,(purecopy "Byte-compile the current file (if it has changed), then load compiled code"))) - (define-key menu-map [byte-compile] - `(menu-item ,(purecopy "Byte-compile This File") emacs-lisp-byte-compile - :help ,(purecopy "Byte compile the file containing the current buffer"))) - (define-key menu-map [separator-eval] menu-bar-separator) - (define-key menu-map [ielm] - `(menu-item ,(purecopy "Interactive Expression Evaluation") ielm - :help ,(purecopy "Interactively evaluate Emacs Lisp expressions"))) - (define-key menu-map [eval-buffer] - `(menu-item ,(purecopy "Evaluate Buffer") eval-buffer - :help ,(purecopy "Execute the current buffer as Lisp code"))) - (define-key menu-map [eval-region] - `(menu-item ,(purecopy "Evaluate Region") eval-region - :help ,(purecopy "Execute the region as Lisp code") - :enable mark-active)) - (define-key menu-map [eval-sexp] - `(menu-item ,(purecopy "Evaluate Last S-expression") eval-last-sexp - :help ,(purecopy "Evaluate sexp before point; print value in minibuffer"))) - (define-key menu-map [separator-format] menu-bar-separator) - (define-key menu-map [comment-region] - `(menu-item ,(purecopy "Comment Out Region") comment-region - :help ,(purecopy "Comment or uncomment each line in the region") - :enable mark-active)) - (define-key menu-map [indent-region] - `(menu-item ,(purecopy "Indent Region") indent-region - :help ,(purecopy "Indent each nonblank line in the region") - :enable mark-active)) - (define-key menu-map [indent-line] - `(menu-item ,(purecopy "Indent Line") lisp-indent-line)) + (bindings--define-key prof-map [sep-rem] menu-bar-separator) + (bindings--define-key prof-map [prof-resall] + '(menu-item "Reset Counters for All Functions" elp-reset-all + :help "Reset the profiling information for all functions being profiled")) + (bindings--define-key prof-map [prof-resfunc] + '(menu-item "Reset Counters for Function..." elp-reset-function + :help "Reset the profiling information for a function")) + (bindings--define-key prof-map [prof-res] + '(menu-item "Show Profiling Results" elp-results + :help "Display current profiling results")) + (bindings--define-key prof-map [prof-pack] + '(menu-item "Instrument Package..." elp-instrument-package + :help "Instrument for profiling all function that start with a prefix")) + (bindings--define-key prof-map [prof-func] + '(menu-item "Instrument Function..." elp-instrument-function + :help "Instrument a function for profiling")) + (bindings--define-key menu-map [lint] (cons "Linting" lint-map)) + (bindings--define-key lint-map [lint-di] + '(menu-item "Lint Directory..." elint-directory + :help "Lint a directory")) + (bindings--define-key lint-map [lint-f] + '(menu-item "Lint File..." elint-file + :help "Lint a file")) + (bindings--define-key lint-map [lint-b] + '(menu-item "Lint Buffer" elint-current-buffer + :help "Lint the current buffer")) + (bindings--define-key lint-map [lint-d] + '(menu-item "Lint Defun" elint-defun + :help "Lint the function at point")) + (bindings--define-key menu-map [edebug-defun] + '(menu-item "Instrument Function for Debugging" edebug-defun + :help "Evaluate the top level form point is in, stepping through with Edebug" + :keys "C-u C-M-x")) + (bindings--define-key menu-map [separator-byte] menu-bar-separator) + (bindings--define-key menu-map [disas] + '(menu-item "Disassemble Byte Compiled Object..." disassemble + :help "Print disassembled code for OBJECT in a buffer")) + (bindings--define-key menu-map [byte-recompile] + '(menu-item "Byte-recompile Directory..." byte-recompile-directory + :help "Recompile every `.el' file in DIRECTORY that needs recompilation")) + (bindings--define-key menu-map [emacs-byte-compile-and-load] + '(menu-item "Byte-compile and Load" emacs-lisp-byte-compile-and-load + :help "Byte-compile the current file (if it has changed), then load compiled code")) + (bindings--define-key menu-map [byte-compile] + '(menu-item "Byte-compile This File" emacs-lisp-byte-compile + :help "Byte compile the file containing the current buffer")) + (bindings--define-key menu-map [separator-eval] menu-bar-separator) + (bindings--define-key menu-map [ielm] + '(menu-item "Interactive Expression Evaluation" ielm + :help "Interactively evaluate Emacs Lisp expressions")) + (bindings--define-key menu-map [eval-buffer] + '(menu-item "Evaluate Buffer" eval-buffer + :help "Execute the current buffer as Lisp code")) + (bindings--define-key menu-map [eval-region] + '(menu-item "Evaluate Region" eval-region + :help "Execute the region as Lisp code" + :enable mark-active)) + (bindings--define-key menu-map [eval-sexp] + '(menu-item "Evaluate Last S-expression" eval-last-sexp + :help "Evaluate sexp before point; print value in minibuffer")) + (bindings--define-key menu-map [separator-format] menu-bar-separator) + (bindings--define-key menu-map [comment-region] + '(menu-item "Comment Out Region" comment-region + :help "Comment or uncomment each line in the region" + :enable mark-active)) + (bindings--define-key menu-map [indent-region] + '(menu-item "Indent Region" indent-region + :help "Indent each nonblank line in the region" + :enable mark-active)) + (bindings--define-key menu-map [indent-line] + '(menu-item "Indent Line" lisp-indent-line)) map) "Keymap for Emacs Lisp mode. All commands in `lisp-mode-shared-map' are inherited by this map.") @@ -430,16 +431,16 @@ (set-keymap-parent map lisp-mode-shared-map) (define-key map "\e\C-x" 'lisp-eval-defun) (define-key map "\C-c\C-z" 'run-lisp) - (define-key map [menu-bar lisp] (cons (purecopy "Lisp") menu-map)) - (define-key menu-map [run-lisp] - `(menu-item ,(purecopy "Run inferior Lisp") run-lisp - :help ,(purecopy "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'"))) - (define-key menu-map [ev-def] - `(menu-item ,(purecopy "Eval defun") lisp-eval-defun - :help ,(purecopy "Send the current defun to the Lisp process made by M-x run-lisp"))) - (define-key menu-map [ind-sexp] - `(menu-item ,(purecopy "Indent sexp") indent-sexp - :help ,(purecopy "Indent each line of the list starting just after point"))) + (bindings--define-key map [menu-bar lisp] (cons "Lisp" menu-map)) + (bindings--define-key menu-map [run-lisp] + '(menu-item "Run inferior Lisp" run-lisp + :help "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'")) + (bindings--define-key menu-map [ev-def] + '(menu-item "Eval defun" lisp-eval-defun + :help "Send the current defun to the Lisp process made by M-x run-lisp")) + (bindings--define-key menu-map [ind-sexp] + '(menu-item "Indent sexp" indent-sexp + :help "Indent each line of the list starting just after point")) map) "Keymap for ordinary Lisp mode. All commands in `lisp-mode-shared-map' are inherited by this map.") @@ -487,23 +488,24 @@ (define-key map "\e\C-q" 'indent-pp-sexp) (define-key map "\e\t" 'completion-at-point) (define-key map "\n" 'eval-print-last-sexp) - (define-key map [menu-bar lisp-interaction] (cons (purecopy "Lisp-Interaction") menu-map)) - (define-key menu-map [eval-defun] - `(menu-item ,(purecopy "Evaluate Defun") eval-defun - :help ,(purecopy "Evaluate the top-level form containing point, or after point"))) - (define-key menu-map [eval-print-last-sexp] - `(menu-item ,(purecopy "Evaluate and Print") eval-print-last-sexp - :help ,(purecopy "Evaluate sexp before point; print value into current buffer"))) - (define-key menu-map [edebug-defun-lisp-interaction] - `(menu-item ,(purecopy "Instrument Function for Debugging") edebug-defun - :help ,(purecopy "Evaluate the top level form point is in, stepping through with Edebug") - :keys ,(purecopy "C-u C-M-x"))) - (define-key menu-map [indent-pp-sexp] - `(menu-item ,(purecopy "Indent or Pretty-Print") indent-pp-sexp - :help ,(purecopy "Indent each line of the list starting just after point, or prettyprint it"))) - (define-key menu-map [complete-symbol] - `(menu-item ,(purecopy "Complete Lisp Symbol") completion-at-point - :help ,(purecopy "Perform completion on Lisp symbol preceding point"))) + (bindings--define-key map [menu-bar lisp-interaction] + (cons "Lisp-Interaction" menu-map)) + (bindings--define-key menu-map [eval-defun] + '(menu-item "Evaluate Defun" eval-defun + :help "Evaluate the top-level form containing point, or after point")) + (bindings--define-key menu-map [eval-print-last-sexp] + '(menu-item "Evaluate and Print" eval-print-last-sexp + :help "Evaluate sexp before point; print value into current buffer")) + (bindings--define-key menu-map [edebug-defun-lisp-interaction] + '(menu-item "Instrument Function for Debugging" edebug-defun + :help "Evaluate the top level form point is in, stepping through with Edebug" + :keys "C-u C-M-x")) + (bindings--define-key menu-map [indent-pp-sexp] + '(menu-item "Indent or Pretty-Print" indent-pp-sexp + :help "Indent each line of the list starting just after point, or prettyprint it")) + (bindings--define-key menu-map [complete-symbol] + '(menu-item "Complete Lisp Symbol" completion-at-point + :help "Perform completion on Lisp symbol preceding point")) map) "Keymap for Lisp Interaction mode. All commands in `lisp-mode-shared-map' are inherited by this map.") === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-06-17 05:13:40 +0000 +++ lisp/international/mule-cmds.el 2012-06-27 21:15:13 +0000 @@ -58,98 +58,98 @@ (defvar describe-language-environment-map (let ((map (make-sparse-keymap "Describe Language Environment"))) - (define-key map - [Default] `(menu-item ,(purecopy "Default") describe-specified-language-support)) + (bindings--define-key map + [Default] '(menu-item "Default" describe-specified-language-support)) map)) (defvar setup-language-environment-map (let ((map (make-sparse-keymap "Set Language Environment"))) - (define-key map - [Default] `(menu-item ,(purecopy "Default") setup-specified-language-environment)) + (bindings--define-key map + [Default] '(menu-item "Default" setup-specified-language-environment)) map)) (defvar set-coding-system-map (let ((map (make-sparse-keymap "Set Coding System"))) - (define-key-after map [universal-coding-system-argument] - `(menu-item ,(purecopy "For Next Command") universal-coding-system-argument - :help ,(purecopy "Coding system to be used by next command"))) - (define-key-after map [separator-1] menu-bar-separator) - (define-key-after map [set-buffer-file-coding-system] - `(menu-item ,(purecopy "For Saving This Buffer") set-buffer-file-coding-system - :help ,(purecopy "How to encode this buffer when saved"))) - (define-key-after map [revert-buffer-with-coding-system] - `(menu-item ,(purecopy "For Reverting This File Now") + (bindings--define-key map [set-buffer-process-coding-system] + '(menu-item "For I/O with Subprocess" set-buffer-process-coding-system + :visible (fboundp 'start-process) + :enable (get-buffer-process (current-buffer)) + :help "How to en/decode I/O from/to subprocess connected to this buffer")) + (bindings--define-key map [set-next-selection-coding-system] + '(menu-item "For Next X Selection" set-next-selection-coding-system + :visible (display-selections-p) + :help "How to en/decode next selection/clipboard operation")) + (bindings--define-key map [set-selection-coding-system] + '(menu-item "For X Selections/Clipboard" set-selection-coding-system + :visible (display-selections-p) + :help "How to en/decode data to/from selection/clipboard")) + + (bindings--define-key map [separator-3] menu-bar-separator) + (bindings--define-key map [set-terminal-coding-system] + '(menu-item "For Terminal" set-terminal-coding-system + :enable (null (memq initial-window-system '(x w32 ns))) + :help "How to encode terminal output")) + (bindings--define-key map [set-keyboard-coding-system] + '(menu-item "For Keyboard" set-keyboard-coding-system + :help "How to decode keyboard input")) + + (bindings--define-key map [separator-2] menu-bar-separator) + (bindings--define-key map [set-file-name-coding-system] + '(menu-item "For File Name" set-file-name-coding-system + :help "How to decode/encode file names")) + (bindings--define-key map [revert-buffer-with-coding-system] + '(menu-item "For Reverting This File Now" revert-buffer-with-coding-system :enable buffer-file-name - :help ,(purecopy "Revisit this file immediately using specified coding system"))) - (define-key-after map [set-file-name-coding-system] - `(menu-item ,(purecopy "For File Name") set-file-name-coding-system - :help ,(purecopy "How to decode/encode file names"))) - (define-key-after map [separator-2] menu-bar-separator) - - (define-key-after map [set-keyboard-coding-system] - `(menu-item ,(purecopy "For Keyboard") set-keyboard-coding-system - :help ,(purecopy "How to decode keyboard input"))) - (define-key-after map [set-terminal-coding-system] - `(menu-item ,(purecopy "For Terminal") set-terminal-coding-system - :enable (null (memq initial-window-system '(x w32 ns))) - :help ,(purecopy "How to encode terminal output"))) - (define-key-after map [separator-3] menu-bar-separator) - - (define-key-after map [set-selection-coding-system] - `(menu-item ,(purecopy "For X Selections/Clipboard") set-selection-coding-system - :visible (display-selections-p) - :help ,(purecopy "How to en/decode data to/from selection/clipboard"))) - (define-key-after map [set-next-selection-coding-system] - `(menu-item ,(purecopy "For Next X Selection") set-next-selection-coding-system - :visible (display-selections-p) - :help ,(purecopy "How to en/decode next selection/clipboard operation"))) - (define-key-after map [set-buffer-process-coding-system] - `(menu-item ,(purecopy "For I/O with Subprocess") set-buffer-process-coding-system - :visible (fboundp 'start-process) - :enable (get-buffer-process (current-buffer)) - :help ,(purecopy "How to en/decode I/O from/to subprocess connected to this buffer"))) + :help "Revisit this file immediately using specified coding system")) + (bindings--define-key map [set-buffer-file-coding-system] + '(menu-item "For Saving This Buffer" set-buffer-file-coding-system + :help "How to encode this buffer when saved")) + (bindings--define-key map [separator-1] menu-bar-separator) + (bindings--define-key map [universal-coding-system-argument] + '(menu-item "For Next Command" universal-coding-system-argument + :help "Coding system to be used by next command")) map)) (defvar mule-menu-keymap (let ((map (make-sparse-keymap "Mule (Multilingual Environment)"))) - (define-key-after map [set-language-environment] - `(menu-item ,(purecopy "Set Language Environment") ,setup-language-environment-map)) - (define-key-after map [separator-mule] menu-bar-separator) - - (define-key-after map [toggle-input-method] - `(menu-item ,(purecopy "Toggle Input Method") toggle-input-method)) - (define-key-after map [set-input-method] - `(menu-item ,(purecopy "Select Input Method...") set-input-method)) - (define-key-after map [describe-input-method] - `(menu-item ,(purecopy "Describe Input Method") describe-input-method)) - (define-key-after map [separator-input-method] menu-bar-separator) - - (define-key-after map [set-various-coding-system] - `(menu-item ,(purecopy "Set Coding Systems") ,set-coding-system-map - :enable (default-value 'enable-multibyte-characters))) - (define-key-after map [view-hello-file] - `(menu-item ,(purecopy "Show Multilingual Sample Text") view-hello-file + (bindings--define-key map [mule-diag] + '(menu-item "Show All Multilingual Settings" mule-diag + :help "Display multilingual environment settings")) + (bindings--define-key map [list-character-sets] + '(menu-item "List Character Sets" list-character-sets + :help "Show table of available character sets")) + (bindings--define-key map [describe-coding-system] + '(menu-item "Describe Coding System..." describe-coding-system)) + (bindings--define-key map [describe-input-method] + '(menu-item "Describe Input Method..." describe-input-method + :help "Keyboard layout for a specific input method")) + (bindings--define-key map [describe-language-environment] + `(menu-item "Describe Language Environment" + ,describe-language-environment-map + :help "Show multilingual settings for a specific language")) + + (bindings--define-key map [separator-coding-system] menu-bar-separator) + (bindings--define-key map [view-hello-file] + '(menu-item "Show Multilingual Sample Text" view-hello-file :enable (file-readable-p (expand-file-name "HELLO" data-directory)) - :help ,(purecopy "Demonstrate various character sets"))) - (define-key-after map [separator-coding-system] menu-bar-separator) - - (define-key-after map [describe-language-environment] - `(menu-item ,(purecopy "Describe Language Environment") - ,describe-language-environment-map - :help ,(purecopy "Show multilingual settings for a specific language"))) - (define-key-after map [describe-input-method] - `(menu-item ,(purecopy "Describe Input Method...") describe-input-method - :help ,(purecopy "Keyboard layout for a specific input method"))) - (define-key-after map [describe-coding-system] - `(menu-item ,(purecopy "Describe Coding System...") describe-coding-system)) - (define-key-after map [list-character-sets] - `(menu-item ,(purecopy "List Character Sets") list-character-sets - :help ,(purecopy "Show table of available character sets"))) - (define-key-after map [mule-diag] - `(menu-item ,(purecopy "Show All Multilingual Settings") mule-diag - :help ,(purecopy "Display multilingual environment settings"))) + :help "Demonstrate various character sets")) + (bindings--define-key map [set-various-coding-system] + `(menu-item "Set Coding Systems" ,set-coding-system-map + :enable (default-value 'enable-multibyte-characters))) + + (bindings--define-key map [separator-input-method] menu-bar-separator) + (bindings--define-key map [describe-input-method] + '(menu-item "Describe Input Method" describe-input-method)) + (bindings--define-key map [set-input-method] + '(menu-item "Select Input Method..." set-input-method)) + (bindings--define-key map [toggle-input-method] + '(menu-item "Toggle Input Method" toggle-input-method)) + + (bindings--define-key map [separator-mule] menu-bar-separator) + (bindings--define-key map [set-language-environment] + `(menu-item "Set Language Environment" ,setup-language-environment-map)) map) "Keymap for Mule (Multilingual environment) menu specific commands.") === modified file 'lisp/loadup.el' --- lisp/loadup.el 2012-06-27 07:47:56 +0000 +++ lisp/loadup.el 2012-06-27 21:15:13 +0000 @@ -61,7 +61,7 @@ (if (eq t purify-flag) ;; Hash consing saved around 11% of pure space in my tests. - (setq purify-flag (make-hash-table :test 'equal))) + (setq purify-flag (make-hash-table :test 'equal :size 70000))) (message "Using load-path %s" load-path) === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2012-06-23 15:38:23 +0000 +++ lisp/menu-bar.el 2012-06-27 21:15:13 +0000 @@ -49,14 +49,14 @@ (setq menu-bar-final-items '(buffer services help-menu)) (setq menu-bar-final-items '(buffer services hide-app quit)) ;; Add standard top-level items to GNUstep menu. - (define-key global-map [menu-bar quit] - `(menu-item ,(purecopy "Quit") save-buffers-kill-emacs - :help ,(purecopy "Save unsaved buffers, then exit"))) - (define-key global-map [menu-bar hide-app] - `(menu-item ,(purecopy "Hide") ns-do-hide-emacs - :help ,(purecopy "Hide Emacs")))) - (define-key global-map [menu-bar services] ; set-up in ns-win - (cons (purecopy "Services") (make-sparse-keymap "Services")))) + (bindings--define-key global-map [menu-bar quit] + '(menu-item "Quit" save-buffers-kill-emacs + :help "Save unsaved buffers, then exit")) + (bindings--define-key global-map [menu-bar hide-app] + '(menu-item "Hide" ns-do-hide-emacs + :help "Hide Emacs"))) + (bindings--define-key global-map [menu-bar services] ; Set-up in ns-win. + (cons "Services" (make-sparse-keymap "Services")))) ;; This definition is just to show what this looks like. ;; It gets modified in place when menu-bar-update-buffers is called. @@ -69,85 +69,84 @@ (let ((menu (make-sparse-keymap "File"))) ;; The "File" menu items - (define-key menu [exit-emacs] - `(menu-item ,(purecopy "Quit") save-buffers-kill-terminal - :help ,(purecopy "Save unsaved buffers, then exit"))) + (bindings--define-key menu [exit-emacs] + '(menu-item "Quit" save-buffers-kill-terminal + :help "Save unsaved buffers, then exit")) - (define-key menu [separator-exit] + (bindings--define-key menu [separator-exit] menu-bar-separator) ;; Don't use delete-frame as event name because that is a special ;; event. - (define-key menu [delete-this-frame] - `(menu-item ,(purecopy "Delete Frame") delete-frame + (bindings--define-key menu [delete-this-frame] + '(menu-item "Delete Frame" delete-frame :visible (fboundp 'delete-frame) :enable (delete-frame-enabled-p) - :help ,(purecopy "Delete currently selected frame"))) - (define-key menu [make-frame-on-display] - `(menu-item ,(purecopy "New Frame on Display...") make-frame-on-display + :help "Delete currently selected frame")) + (bindings--define-key menu [make-frame-on-display] + '(menu-item "New Frame on Display..." make-frame-on-display :visible (fboundp 'make-frame-on-display) - :help ,(purecopy "Open a new frame on another display"))) - (define-key menu [make-frame] - `(menu-item ,(purecopy "New Frame") make-frame-command + :help "Open a new frame on another display")) + (bindings--define-key menu [make-frame] + '(menu-item "New Frame" make-frame-command :visible (fboundp 'make-frame-command) - :help ,(purecopy "Open a new frame"))) + :help "Open a new frame")) - (define-key menu [separator-frame] + (bindings--define-key menu [separator-frame] menu-bar-separator) - (define-key menu [one-window] - `(menu-item ,(purecopy "Remove Other Windows") delete-other-windows + (bindings--define-key menu [one-window] + '(menu-item "Remove Other Windows" delete-other-windows :enable (not (one-window-p t nil)) - :help ,(purecopy "Make selected window fill whole frame"))) - - (define-key menu [new-window-on-right] - `(menu-item ,(purecopy "New Window on Right") split-window-right - :enable (and (menu-bar-menu-frame-live-and-visible-p) - (menu-bar-non-minibuffer-window-p)) - :help ,(purecopy "Make new window on right of selected one"))) - - (define-key menu [new-window-below] - `(menu-item ,(purecopy "New Window Below") split-window-below - :enable (and (menu-bar-menu-frame-live-and-visible-p) - (menu-bar-non-minibuffer-window-p)) - :help ,(purecopy "Make new window below selected one"))) - - (define-key menu [separator-window] + :help "Make selected window fill whole frame")) + + (bindings--define-key menu [new-window-on-right] + '(menu-item "New Window on Right" split-window-right + :enable (and (menu-bar-menu-frame-live-and-visible-p) + (menu-bar-non-minibuffer-window-p)) + :help "Make new window on right of selected one")) + + (bindings--define-key menu [new-window-below] + '(menu-item "New Window Below" split-window-below + :enable (and (menu-bar-menu-frame-live-and-visible-p) + (menu-bar-non-minibuffer-window-p)) + :help "Make new window below selected one")) + + (bindings--define-key menu [separator-window] menu-bar-separator) - (define-key menu [ps-print-region] - `(menu-item ,(purecopy "PostScript Print Region (B+W)") ps-print-region + (bindings--define-key menu [ps-print-region] + '(menu-item "PostScript Print Region (B+W)" ps-print-region :enable mark-active - :help ,(purecopy "Pretty-print marked region in black and white to PostScript printer"))) - (define-key menu [ps-print-buffer] - `(menu-item ,(purecopy "PostScript Print Buffer (B+W)") ps-print-buffer + :help "Pretty-print marked region in black and white to PostScript printer")) + (bindings--define-key menu [ps-print-buffer] + '(menu-item "PostScript Print Buffer (B+W)" ps-print-buffer :enable (menu-bar-menu-frame-live-and-visible-p) - :help ,(purecopy "Pretty-print current buffer in black and white to PostScript printer"))) - (define-key menu [ps-print-region-faces] - `(menu-item ,(purecopy "PostScript Print Region") + :help "Pretty-print current buffer in black and white to PostScript printer")) + (bindings--define-key menu [ps-print-region-faces] + '(menu-item "PostScript Print Region" ps-print-region-with-faces :enable mark-active - :help ,(purecopy - "Pretty-print marked region to PostScript printer"))) - (define-key menu [ps-print-buffer-faces] - `(menu-item ,(purecopy "PostScript Print Buffer") + :help "Pretty-print marked region to PostScript printer")) + (bindings--define-key menu [ps-print-buffer-faces] + '(menu-item "PostScript Print Buffer" ps-print-buffer-with-faces :enable (menu-bar-menu-frame-live-and-visible-p) - :help ,(purecopy "Pretty-print current buffer to PostScript printer"))) - (define-key menu [print-region] - `(menu-item ,(purecopy "Print Region") print-region + :help "Pretty-print current buffer to PostScript printer")) + (bindings--define-key menu [print-region] + '(menu-item "Print Region" print-region :enable mark-active - :help ,(purecopy "Print region between mark and current position"))) - (define-key menu [print-buffer] - `(menu-item ,(purecopy "Print Buffer") print-buffer + :help "Print region between mark and current position")) + (bindings--define-key menu [print-buffer] + '(menu-item "Print Buffer" print-buffer :enable (menu-bar-menu-frame-live-and-visible-p) - :help ,(purecopy "Print current buffer with page headings"))) + :help "Print current buffer with page headings")) - (define-key menu [separator-print] + (bindings--define-key menu [separator-print] menu-bar-separator) - (define-key menu [recover-session] - `(menu-item ,(purecopy "Recover Crashed Session") recover-session + (bindings--define-key menu [recover-session] + '(menu-item "Recover Crashed Session" recover-session :enable (and auto-save-list-file-prefix (file-directory-p @@ -160,55 +159,52 @@ (file-name-nondirectory auto-save-list-file-prefix))) t)) - :help ,(purecopy "Recover edits from a crashed session"))) - (define-key menu [revert-buffer] - `(menu-item ,(purecopy "Revert Buffer") revert-buffer + :help "Recover edits from a crashed session")) + (bindings--define-key menu [revert-buffer] + '(menu-item "Revert Buffer" revert-buffer :enable (or revert-buffer-function revert-buffer-insert-file-contents-function (and buffer-file-number (or (buffer-modified-p) (not (verify-visited-file-modtime (current-buffer)))))) - :help ,(purecopy "Re-read current buffer from its file"))) - (define-key menu [write-file] - `(menu-item ,(purecopy "Save As...") write-file + :help "Re-read current buffer from its file")) + (bindings--define-key menu [write-file] + '(menu-item "Save As..." write-file :enable (and (menu-bar-menu-frame-live-and-visible-p) (menu-bar-non-minibuffer-window-p)) - :help ,(purecopy "Write current buffer to another file"))) - (define-key menu [save-buffer] - `(menu-item ,(purecopy "Save") save-buffer + :help "Write current buffer to another file")) + (bindings--define-key menu [save-buffer] + '(menu-item "Save" save-buffer :enable (and (buffer-modified-p) (buffer-file-name) (menu-bar-non-minibuffer-window-p)) - :help ,(purecopy "Save current buffer to its file"))) + :help "Save current buffer to its file")) - (define-key menu [separator-save] + (bindings--define-key menu [separator-save] menu-bar-separator) - (define-key menu [kill-buffer] - `(menu-item ,(purecopy "Close") kill-this-buffer + (bindings--define-key menu [kill-buffer] + '(menu-item "Close" kill-this-buffer :enable (kill-this-buffer-enabled-p) - :help ,(purecopy "Discard (kill) current buffer"))) - (define-key menu [insert-file] - `(menu-item ,(purecopy "Insert File...") insert-file - :enable (menu-bar-non-minibuffer-window-p) - :help ,(purecopy "Insert another file into current buffer"))) - (define-key menu [dired] - `(menu-item ,(purecopy "Open Directory...") dired - :enable (menu-bar-non-minibuffer-window-p) - :help ,(purecopy - "Read a directory, to operate on its files"))) - (define-key menu [open-file] - `(menu-item ,(purecopy "Open File...") menu-find-file-existing - :enable (menu-bar-non-minibuffer-window-p) - :help ,(purecopy - "Read an existing file into an Emacs buffer"))) - (define-key menu [new-file] - `(menu-item ,(purecopy "Visit New File...") find-file - :enable (menu-bar-non-minibuffer-window-p) - :help ,(purecopy - "Specify a new file's name, to edit the file"))) + :help "Discard (kill) current buffer")) + (bindings--define-key menu [insert-file] + '(menu-item "Insert File..." insert-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Insert another file into current buffer")) + (bindings--define-key menu [dired] + '(menu-item "Open Directory..." dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read a directory, to operate on its files")) + (bindings--define-key menu [open-file] + '(menu-item "Open File..." menu-find-file-existing + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file into an Emacs buffer")) + (bindings--define-key menu [new-file] + '(menu-item "Visit New File..." find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Specify a new file's name, to edit the file")) menu)) @@ -291,148 +287,143 @@ ;; The Edit->Search->Incremental Search menu (defvar menu-bar-i-search-menu (let ((menu (make-sparse-keymap "Incremental Search"))) - (define-key menu [isearch-backward-regexp] - `(menu-item ,(purecopy "Backward Regexp...") isearch-backward-regexp - :help ,(purecopy - "Search backwards for a regular expression as you type it"))) - (define-key menu [isearch-forward-regexp] - `(menu-item ,(purecopy "Forward Regexp...") isearch-forward-regexp - :help ,(purecopy - "Search forward for a regular expression as you type it"))) - (define-key menu [isearch-backward] - `(menu-item ,(purecopy "Backward String...") isearch-backward - :help ,(purecopy "Search backwards for a string as you type it"))) - (define-key menu [isearch-forward] - `(menu-item ,(purecopy "Forward String...") isearch-forward - :help ,(purecopy "Search forward for a string as you type it"))) + (bindings--define-key menu [isearch-backward-regexp] + '(menu-item "Backward Regexp..." isearch-backward-regexp + :help "Search backwards for a regular expression as you type it")) + (bindings--define-key menu [isearch-forward-regexp] + '(menu-item "Forward Regexp..." isearch-forward-regexp + :help "Search forward for a regular expression as you type it")) + (bindings--define-key menu [isearch-backward] + '(menu-item "Backward String..." isearch-backward + :help "Search backwards for a string as you type it")) + (bindings--define-key menu [isearch-forward] + '(menu-item "Forward String..." isearch-forward + :help "Search forward for a string as you type it")) menu)) (defvar menu-bar-search-menu (let ((menu (make-sparse-keymap "Search"))) - (define-key menu [i-search] - `(menu-item ,(purecopy "Incremental Search") ,menu-bar-i-search-menu)) - (define-key menu [separator-tag-isearch] + (bindings--define-key menu [i-search] + `(menu-item "Incremental Search" ,menu-bar-i-search-menu)) + (bindings--define-key menu [separator-tag-isearch] menu-bar-separator) - (define-key menu [tags-continue] - `(menu-item ,(purecopy "Continue Tags Search") tags-loop-continue - :help ,(purecopy "Continue last tags search operation"))) - (define-key menu [tags-srch] - `(menu-item ,(purecopy "Search Tagged Files...") tags-search - :help ,(purecopy "Search for a regexp in all tagged files"))) - (define-key menu [separator-tag-search] menu-bar-separator) + (bindings--define-key menu [tags-continue] + '(menu-item "Continue Tags Search" tags-loop-continue + :help "Continue last tags search operation")) + (bindings--define-key menu [tags-srch] + '(menu-item "Search Tagged Files..." tags-search + :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [separator-tag-search] menu-bar-separator) - (define-key menu [repeat-search-back] - `(menu-item ,(purecopy "Repeat Backwards") + (bindings--define-key menu [repeat-search-back] + '(menu-item "Repeat Backwards" nonincremental-repeat-search-backward :enable (or (and (eq menu-bar-last-search-type 'string) search-ring) (and (eq menu-bar-last-search-type 'regexp) regexp-search-ring)) - :help ,(purecopy "Repeat last search backwards"))) - (define-key menu [repeat-search-fwd] - `(menu-item ,(purecopy "Repeat Forward") + :help "Repeat last search backwards")) + (bindings--define-key menu [repeat-search-fwd] + '(menu-item "Repeat Forward" nonincremental-repeat-search-forward :enable (or (and (eq menu-bar-last-search-type 'string) search-ring) (and (eq menu-bar-last-search-type 'regexp) regexp-search-ring)) - :help ,(purecopy "Repeat last search forward"))) - (define-key menu [separator-repeat-search] + :help "Repeat last search forward")) + (bindings--define-key menu [separator-repeat-search] menu-bar-separator) - (define-key menu [re-search-backward] - `(menu-item ,(purecopy "Regexp Backwards...") + (bindings--define-key menu [re-search-backward] + '(menu-item "Regexp Backwards..." nonincremental-re-search-backward - :help ,(purecopy - "Search backwards for a regular expression"))) - (define-key menu [re-search-forward] - `(menu-item ,(purecopy "Regexp Forward...") + :help "Search backwards for a regular expression")) + (bindings--define-key menu [re-search-forward] + '(menu-item "Regexp Forward..." nonincremental-re-search-forward - :help ,(purecopy "Search forward for a regular expression"))) + :help "Search forward for a regular expression")) - (define-key menu [search-backward] - `(menu-item ,(purecopy "String Backwards...") + (bindings--define-key menu [search-backward] + '(menu-item "String Backwards..." nonincremental-search-backward - :help ,(purecopy "Search backwards for a string"))) - (define-key menu [search-forward] - `(menu-item ,(purecopy "String Forward...") nonincremental-search-forward - :help ,(purecopy "Search forward for a string"))) + :help "Search backwards for a string")) + (bindings--define-key menu [search-forward] + '(menu-item "String Forward..." nonincremental-search-forward + :help "Search forward for a string")) menu)) ;; The Edit->Replace submenu (defvar menu-bar-replace-menu (let ((menu (make-sparse-keymap "Replace"))) - (define-key menu [tags-repl-continue] - `(menu-item ,(purecopy "Continue Replace") tags-loop-continue - :help ,(purecopy "Continue last tags replace operation"))) - (define-key menu [tags-repl] - `(menu-item ,(purecopy "Replace in Tagged Files...") tags-query-replace - :help ,(purecopy - "Interactively replace a regexp in all tagged files"))) - (define-key menu [separator-replace-tags] + (bindings--define-key menu [tags-repl-continue] + '(menu-item "Continue Replace" tags-loop-continue + :help "Continue last tags replace operation")) + (bindings--define-key menu [tags-repl] + '(menu-item "Replace in Tagged Files..." tags-query-replace + :help "Interactively replace a regexp in all tagged files")) + (bindings--define-key menu [separator-replace-tags] menu-bar-separator) - (define-key menu [query-replace-regexp] - `(menu-item ,(purecopy "Replace Regexp...") query-replace-regexp + (bindings--define-key menu [query-replace-regexp] + '(menu-item "Replace Regexp..." query-replace-regexp :enable (not buffer-read-only) - :help ,(purecopy "Replace regular expression interactively, ask about each occurrence"))) - (define-key menu [query-replace] - `(menu-item ,(purecopy "Replace String...") query-replace + :help "Replace regular expression interactively, ask about each occurrence")) + (bindings--define-key menu [query-replace] + '(menu-item "Replace String..." query-replace :enable (not buffer-read-only) - :help ,(purecopy - "Replace string interactively, ask about each occurrence"))) + :help "Replace string interactively, ask about each occurrence")) menu)) ;;; Assemble the top-level Edit menu items. (defvar menu-bar-goto-menu (let ((menu (make-sparse-keymap "Go To"))) - (define-key menu [set-tags-name] - `(menu-item ,(purecopy "Set Tags File Name...") visit-tags-table - :help ,(purecopy "Tell Tags commands which tag table file to use"))) + (bindings--define-key menu [set-tags-name] + '(menu-item "Set Tags File Name..." visit-tags-table + :help "Tell Tags commands which tag table file to use")) - (define-key menu [separator-tag-file] + (bindings--define-key menu [separator-tag-file] menu-bar-separator) - (define-key menu [apropos-tags] - `(menu-item ,(purecopy "Tags Apropos...") tags-apropos - :help ,(purecopy "Find function/variables whose names match regexp"))) - (define-key menu [next-tag-otherw] - `(menu-item ,(purecopy "Next Tag in Other Window") + (bindings--define-key menu [apropos-tags] + '(menu-item "Tags Apropos..." tags-apropos + :help "Find function/variables whose names match regexp")) + (bindings--define-key menu [next-tag-otherw] + '(menu-item "Next Tag in Other Window" menu-bar-next-tag-other-window :enable (and (boundp 'tags-location-ring) (not (ring-empty-p tags-location-ring))) - :help ,(purecopy "Find next function/variable matching last tag name in another window"))) + :help "Find next function/variable matching last tag name in another window")) - (define-key menu [next-tag] - `(menu-item ,(purecopy "Find Next Tag") + (bindings--define-key menu [next-tag] + '(menu-item "Find Next Tag" menu-bar-next-tag :enable (and (boundp 'tags-location-ring) (not (ring-empty-p tags-location-ring))) - :help ,(purecopy "Find next function/variable matching last tag name"))) - (define-key menu [find-tag-otherw] - `(menu-item ,(purecopy "Find Tag in Other Window...") find-tag-other-window - :help ,(purecopy "Find function/variable definition in another window"))) - (define-key menu [find-tag] - `(menu-item ,(purecopy "Find Tag...") find-tag - :help ,(purecopy "Find definition of function or variable"))) + :help "Find next function/variable matching last tag name")) + (bindings--define-key menu [find-tag-otherw] + '(menu-item "Find Tag in Other Window..." find-tag-other-window + :help "Find function/variable definition in another window")) + (bindings--define-key menu [find-tag] + '(menu-item "Find Tag..." find-tag + :help "Find definition of function or variable")) - (define-key menu [separator-tags] + (bindings--define-key menu [separator-tags] menu-bar-separator) - (define-key menu [end-of-buf] - `(menu-item ,(purecopy "Goto End of Buffer") end-of-buffer)) - (define-key menu [beg-of-buf] - `(menu-item ,(purecopy "Goto Beginning of Buffer") beginning-of-buffer)) - (define-key menu [go-to-pos] - `(menu-item ,(purecopy "Goto Buffer Position...") goto-char - :help ,(purecopy "Read a number N and go to buffer position N"))) - (define-key menu [go-to-line] - `(menu-item ,(purecopy "Goto Line...") goto-line - :help ,(purecopy "Read a line number and go to that line"))) + (bindings--define-key menu [end-of-buf] + '(menu-item "Goto End of Buffer" end-of-buffer)) + (bindings--define-key menu [beg-of-buf] + '(menu-item "Goto Beginning of Buffer" beginning-of-buffer)) + (bindings--define-key menu [go-to-pos] + '(menu-item "Goto Buffer Position..." goto-char + :help "Read a number N and go to buffer position N")) + (bindings--define-key menu [go-to-line] + '(menu-item "Goto Line..." goto-line + :help "Read a line number and go to that line")) menu)) @@ -442,59 +433,59 @@ (defvar menu-bar-edit-menu (let ((menu (make-sparse-keymap "Edit"))) - (define-key menu [props] - `(menu-item ,(purecopy "Text Properties") facemenu-menu)) + (bindings--define-key menu [props] + `(menu-item "Text Properties" facemenu-menu)) ;; ns-win.el said: Add spell for platform consistency. (if (featurep 'ns) - (define-key menu [spell] - `(menu-item ,(purecopy "Spell") ispell-menu-map))) + (bindings--define-key menu [spell] + `(menu-item "Spell" ispell-menu-map))) - (define-key menu [fill] - `(menu-item ,(purecopy "Fill") fill-region + (bindings--define-key menu [fill] + `(menu-item "Fill" fill-region :enable (and mark-active (not buffer-read-only)) :help - ,(purecopy "Fill text in region to fit between left and right margin"))) - - (define-key menu [separator-bookmark] - menu-bar-separator) - - (define-key menu [bookmark] - `(menu-item ,(purecopy "Bookmarks") menu-bar-bookmark-map)) - - (define-key menu [goto] - `(menu-item ,(purecopy "Go To") ,menu-bar-goto-menu)) - - (define-key menu [replace] - `(menu-item ,(purecopy "Replace") ,menu-bar-replace-menu)) - - (define-key menu [search] - `(menu-item ,(purecopy "Search") ,menu-bar-search-menu)) - - (define-key menu [separator-search] - menu-bar-separator) - - (define-key menu [mark-whole-buffer] - `(menu-item ,(purecopy "Select All") mark-whole-buffer - :help ,(purecopy "Mark the whole buffer for a subsequent cut/copy"))) - (define-key menu [clear] - `(menu-item ,(purecopy "Clear") delete-region + "Fill text in region to fit between left and right margin")) + + (bindings--define-key menu [separator-bookmark] + menu-bar-separator) + + (bindings--define-key menu [bookmark] + `(menu-item "Bookmarks" menu-bar-bookmark-map)) + + (bindings--define-key menu [goto] + `(menu-item "Go To" ,menu-bar-goto-menu)) + + (bindings--define-key menu [replace] + `(menu-item "Replace" ,menu-bar-replace-menu)) + + (bindings--define-key menu [search] + `(menu-item "Search" ,menu-bar-search-menu)) + + (bindings--define-key menu [separator-search] + menu-bar-separator) + + (bindings--define-key menu [mark-whole-buffer] + '(menu-item "Select All" mark-whole-buffer + :help "Mark the whole buffer for a subsequent cut/copy")) + (bindings--define-key menu [clear] + '(menu-item "Clear" delete-region :enable (and mark-active (not buffer-read-only)) :help - ,(purecopy "Delete the text in region between mark and current position"))) - - - (define-key menu (if (featurep 'ns) [select-paste] + "Delete the text in region between mark and current position")) + + + (bindings--define-key menu (if (featurep 'ns) [select-paste] [paste-from-menu]) ;; ns-win.el said: Change text to be more consistent with ;; surrounding menu items `paste', etc." - `(menu-item ,(purecopy (if (featurep 'ns) "Select and Paste" - "Paste from Kill Menu")) yank-menu - :enable (and (cdr yank-menu) (not buffer-read-only)) - :help ,(purecopy "Choose a string from the kill ring and paste it"))) - (define-key menu [paste] - `(menu-item ,(purecopy "Paste") yank + `(menu-item ,(if (featurep 'ns) "Select and Paste" + "Paste from Kill Menu") yank-menu + :enable (and (cdr yank-menu) (not buffer-read-only)) + :help "Choose a string from the kill ring and paste it")) + (bindings--define-key menu [paste] + '(menu-item "Paste" yank :enable (and (or ;; Emacs compiled --without-x (or --with-ns) ;; doesn't have x-selection-exists-p. @@ -504,35 +495,35 @@ (cdr yank-menu) kill-ring)) (not buffer-read-only)) - :help ,(purecopy "Paste (yank) text most recently cut/copied"))) - (define-key menu [copy] + :help "Paste (yank) text most recently cut/copied")) + (bindings--define-key menu [copy] ;; ns-win.el said: Substitute a Copy function that works better ;; under X (for GNUstep). - `(menu-item ,(purecopy "Copy") ,(if (featurep 'ns) - 'ns-copy-including-secondary - 'kill-ring-save) + `(menu-item "Copy" ,(if (featurep 'ns) + 'ns-copy-including-secondary + 'kill-ring-save) :enable mark-active - :help ,(purecopy "Copy text in region between mark and current position") - :keys ,(purecopy (if (featurep 'ns) - "\\[ns-copy-including-secondary]" - "\\[kill-ring-save]")))) - (define-key menu [cut] - `(menu-item ,(purecopy "Cut") kill-region + :help "Copy text in region between mark and current position" + :keys ,(if (featurep 'ns) + "\\[ns-copy-including-secondary]" + "\\[kill-ring-save]"))) + (bindings--define-key menu [cut] + '(menu-item "Cut" kill-region :enable (and mark-active (not buffer-read-only)) :help - ,(purecopy "Cut (kill) text in region between mark and current position"))) + "Cut (kill) text in region between mark and current position")) ;; ns-win.el said: Separate undo from cut/paste section. (if (featurep 'ns) - (define-key menu [separator-undo] menu-bar-separator)) + (bindings--define-key menu [separator-undo] menu-bar-separator)) - (define-key menu [undo] - `(menu-item ,(purecopy "Undo") undo + (bindings--define-key menu [undo] + '(menu-item "Undo" undo :enable (and (not buffer-read-only) (not (eq t buffer-undo-list)) (if (eq last-command 'undo) (listp pending-undo-list) (consp buffer-undo-list))) - :help ,(purecopy "Undo last operation"))) + :help "Undo last operation")) menu)) @@ -598,45 +589,45 @@ (defvar menu-bar-custom-menu (let ((menu (make-sparse-keymap "Customize"))) - (define-key menu [customize-apropos-faces] - `(menu-item ,(purecopy "Faces Matching...") customize-apropos-faces - :help ,(purecopy "Browse faces matching a regexp or word list"))) - (define-key menu [customize-apropos-options] - `(menu-item ,(purecopy "Options Matching...") customize-apropos-options - :help ,(purecopy "Browse options matching a regexp or word list"))) - (define-key menu [customize-apropos] - `(menu-item ,(purecopy "All Settings Matching...") customize-apropos - :help ,(purecopy "Browse customizable settings matching a regexp or word list"))) - (define-key menu [separator-1] - menu-bar-separator) - (define-key menu [customize-group] - `(menu-item ,(purecopy "Specific Group...") customize-group - :help ,(purecopy "Customize settings of specific group"))) - (define-key menu [customize-face] - `(menu-item ,(purecopy "Specific Face...") customize-face - :help ,(purecopy "Customize attributes of specific face"))) - (define-key menu [customize-option] - `(menu-item ,(purecopy "Specific Option...") customize-option - :help ,(purecopy "Customize value of specific option"))) - (define-key menu [separator-2] - menu-bar-separator) - (define-key menu [customize-changed-options] - `(menu-item ,(purecopy "New Options...") customize-changed-options - :help ,(purecopy "Options added or changed in recent Emacs versions"))) - (define-key menu [customize-saved] - `(menu-item ,(purecopy "Saved Options") customize-saved - :help ,(purecopy "Customize previously saved options"))) - (define-key menu [separator-3] - menu-bar-separator) - (define-key menu [customize-browse] - `(menu-item ,(purecopy "Browse Customization Groups") customize-browse - :help ,(purecopy "Browse all customization groups"))) - (define-key menu [customize] - `(menu-item ,(purecopy "Top-level Customization Group") customize - :help ,(purecopy "The master group called `Emacs'"))) - (define-key menu [customize-themes] - `(menu-item ,(purecopy "Custom Themes") customize-themes - :help ,(purecopy "Choose a pre-defined customization theme"))) + (bindings--define-key menu [customize-apropos-faces] + '(menu-item "Faces Matching..." customize-apropos-faces + :help "Browse faces matching a regexp or word list")) + (bindings--define-key menu [customize-apropos-options] + '(menu-item "Options Matching..." customize-apropos-options + :help "Browse options matching a regexp or word list")) + (bindings--define-key menu [customize-apropos] + '(menu-item "All Settings Matching..." customize-apropos + :help "Browse customizable settings matching a regexp or word list")) + (bindings--define-key menu [separator-1] + menu-bar-separator) + (bindings--define-key menu [customize-group] + '(menu-item "Specific Group..." customize-group + :help "Customize settings of specific group")) + (bindings--define-key menu [customize-face] + '(menu-item "Specific Face..." customize-face + :help "Customize attributes of specific face")) + (bindings--define-key menu [customize-option] + '(menu-item "Specific Option..." customize-option + :help "Customize value of specific option")) + (bindings--define-key menu [separator-2] + menu-bar-separator) + (bindings--define-key menu [customize-changed-options] + '(menu-item "New Options..." customize-changed-options + :help "Options added or changed in recent Emacs versions")) + (bindings--define-key menu [customize-saved] + '(menu-item "Saved Options" customize-saved + :help "Customize previously saved options")) + (bindings--define-key menu [separator-3] + menu-bar-separator) + (bindings--define-key menu [customize-browse] + '(menu-item "Browse Customization Groups" customize-browse + :help "Browse all customization groups")) + (bindings--define-key menu [customize] + '(menu-item "Top-level Customization Group" customize + :help "The master group called `Emacs'")) + (bindings--define-key menu [customize-themes] + '(menu-item "Custom Themes" customize-themes + :help "Choose a pre-defined customization theme")) menu)) ;(defvar menu-bar-preferences-menu (make-sparse-keymap "Preferences")) @@ -646,9 +637,9 @@ DOC is the text to use for the menu entry. HELP is the text to use for the tooltip. PROPS are additional properties." - `(list 'menu-item (purecopy ,doc) ',fname + `(list 'menu-item ,doc ',fname ,@(mapcar (lambda (p) (list 'quote p)) props) - :help (purecopy ,help) + :help ,help :button '(:toggle . (and (default-boundp ',fname) (default-value ',fname))))) @@ -673,8 +664,8 @@ ;; a candidate for "Save Options", and we do not want to save options ;; the user have already set explicitly in his init file. (if interactively (customize-mark-as-set ',variable))) - (list 'menu-item (purecopy ,doc) ',name - :help (purecopy ,help) + (list 'menu-item ,doc ',name + :help ,help :button '(:toggle . (and (default-boundp ',variable) (default-value ',variable)))))) @@ -775,46 +766,46 @@ (defvar menu-bar-showhide-fringe-ind-menu (let ((menu (make-sparse-keymap "Buffer boundaries"))) - (define-key menu [customize] - `(menu-item ,(purecopy "Other (Customize)") + (bindings--define-key menu [customize] + '(menu-item "Other (Customize)" menu-bar-showhide-fringe-ind-customize - :help ,(purecopy "Additional choices available through Custom buffer") + :help "Additional choices available through Custom buffer" :visible (display-graphic-p) :button (:radio . (not (member indicate-buffer-boundaries '(nil left right ((top . left) (bottom . right)) ((t . right) (top . left)))))))) - (define-key menu [mixed] - `(menu-item ,(purecopy "Opposite, Arrows Right") menu-bar-showhide-fringe-ind-mixed + (bindings--define-key menu [mixed] + '(menu-item "Opposite, Arrows Right" menu-bar-showhide-fringe-ind-mixed :help - ,(purecopy "Show top/bottom indicators in opposite fringes, arrows in right") + "Show top/bottom indicators in opposite fringes, arrows in right" :visible (display-graphic-p) :button (:radio . (equal indicate-buffer-boundaries '((t . right) (top . left)))))) - (define-key menu [box] - `(menu-item ,(purecopy "Opposite, No Arrows") menu-bar-showhide-fringe-ind-box - :help ,(purecopy "Show top/bottom indicators in opposite fringes, no arrows") + (bindings--define-key menu [box] + '(menu-item "Opposite, No Arrows" menu-bar-showhide-fringe-ind-box + :help "Show top/bottom indicators in opposite fringes, no arrows" :visible (display-graphic-p) :button (:radio . (equal indicate-buffer-boundaries '((top . left) (bottom . right)))))) - (define-key menu [right] - `(menu-item ,(purecopy "In Right Fringe") menu-bar-showhide-fringe-ind-right - :help ,(purecopy "Show buffer boundaries and arrows in right fringe") + (bindings--define-key menu [right] + '(menu-item "In Right Fringe" menu-bar-showhide-fringe-ind-right + :help "Show buffer boundaries and arrows in right fringe" :visible (display-graphic-p) :button (:radio . (eq indicate-buffer-boundaries 'right)))) - (define-key menu [left] - `(menu-item ,(purecopy "In Left Fringe") menu-bar-showhide-fringe-ind-left - :help ,(purecopy "Show buffer boundaries and arrows in left fringe") + (bindings--define-key menu [left] + '(menu-item "In Left Fringe" menu-bar-showhide-fringe-ind-left + :help "Show buffer boundaries and arrows in left fringe" :visible (display-graphic-p) :button (:radio . (eq indicate-buffer-boundaries 'left)))) - (define-key menu [none] - `(menu-item ,(purecopy "No Indicators") menu-bar-showhide-fringe-ind-none - :help ,(purecopy "Hide all buffer boundary indicators and arrows") + (bindings--define-key menu [none] + '(menu-item "No Indicators" menu-bar-showhide-fringe-ind-none + :help "Hide all buffer boundary indicators and arrows" :visible (display-graphic-p) :button (:radio . (eq indicate-buffer-boundaries nil)))) menu)) @@ -850,43 +841,43 @@ (defvar menu-bar-showhide-fringe-menu (let ((menu (make-sparse-keymap "Fringe"))) - (define-key menu [showhide-fringe-ind] - `(menu-item ,(purecopy "Buffer Boundaries") ,menu-bar-showhide-fringe-ind-menu + (bindings--define-key menu [showhide-fringe-ind] + `(menu-item "Buffer Boundaries" ,menu-bar-showhide-fringe-ind-menu :visible (display-graphic-p) - :help ,(purecopy "Indicate buffer boundaries in fringe"))) + :help "Indicate buffer boundaries in fringe")) - (define-key menu [indicate-empty-lines] + (bindings--define-key menu [indicate-empty-lines] (menu-bar-make-toggle toggle-indicate-empty-lines indicate-empty-lines "Empty Line Indicators" "Indicating of empty lines %s" "Indicate trailing empty lines in fringe, globally")) - (define-key menu [customize] - `(menu-item ,(purecopy "Customize Fringe") menu-bar-showhide-fringe-menu-customize - :help ,(purecopy "Detailed customization of fringe") + (bindings--define-key menu [customize] + '(menu-item "Customize Fringe" menu-bar-showhide-fringe-menu-customize + :help "Detailed customization of fringe" :visible (display-graphic-p))) - (define-key menu [default] - `(menu-item ,(purecopy "Default") menu-bar-showhide-fringe-menu-customize-reset - :help ,(purecopy "Default width fringe on both left and right side") + (bindings--define-key menu [default] + '(menu-item "Default" menu-bar-showhide-fringe-menu-customize-reset + :help "Default width fringe on both left and right side" :visible (display-graphic-p) :button (:radio . (eq fringe-mode nil)))) - (define-key menu [right] - `(menu-item ,(purecopy "On the Right") menu-bar-showhide-fringe-menu-customize-right - :help ,(purecopy "Fringe only on the right side") + (bindings--define-key menu [right] + '(menu-item "On the Right" menu-bar-showhide-fringe-menu-customize-right + :help "Fringe only on the right side" :visible (display-graphic-p) :button (:radio . (equal fringe-mode '(0 . nil))))) - (define-key menu [left] - `(menu-item ,(purecopy "On the Left") menu-bar-showhide-fringe-menu-customize-left - :help ,(purecopy "Fringe only on the left side") + (bindings--define-key menu [left] + '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left + :help "Fringe only on the left side" :visible (display-graphic-p) :button (:radio . (equal fringe-mode '(nil . 0))))) - (define-key menu [none] - `(menu-item ,(purecopy "None") menu-bar-showhide-fringe-menu-customize-disable - :help ,(purecopy "Turn off fringe") + (bindings--define-key menu [none] + '(menu-item "None" menu-bar-showhide-fringe-menu-customize-disable + :help "Turn off fringe" :visible (display-graphic-p) :button (:radio . (eq fringe-mode 0)))) menu)) @@ -909,26 +900,26 @@ (defvar menu-bar-showhide-scroll-bar-menu (let ((menu (make-sparse-keymap "Scroll-bar"))) - (define-key menu [right] - `(menu-item ,(purecopy "On the Right") + (bindings--define-key menu [right] + '(menu-item "On the Right" menu-bar-right-scroll-bar - :help ,(purecopy "Scroll-bar on the right side") + :help "Scroll-bar on the right side" :visible (display-graphic-p) :button (:radio . (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) 'right)))) - (define-key menu [left] - `(menu-item ,(purecopy "On the Left") + (bindings--define-key menu [left] + '(menu-item "On the Left" menu-bar-left-scroll-bar - :help ,(purecopy "Scroll-bar on the left side") + :help "Scroll-bar on the left side" :visible (display-graphic-p) :button (:radio . (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) 'left)))) - (define-key menu [none] - `(menu-item ,(purecopy "None") + (bindings--define-key menu [none] + '(menu-item "None" menu-bar-no-scroll-bar - :help ,(purecopy "Turn off scroll-bar") + :help "Turn off scroll-bar" :visible (display-graphic-p) :button (:radio . (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) nil)))) @@ -973,10 +964,10 @@ (defvar menu-bar-showhide-tool-bar-menu (let ((menu (make-sparse-keymap "Tool-bar"))) - (define-key menu [showhide-tool-bar-left] - `(menu-item ,(purecopy "On the Left") + (bindings--define-key menu [showhide-tool-bar-left] + '(menu-item "On the Left" menu-bar-showhide-tool-bar-menu-customize-enable-left - :help ,(purecopy "Tool-bar at the left side") + :help "Tool-bar at the left side" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -985,10 +976,10 @@ 'tool-bar-position) 'left))))) - (define-key menu [showhide-tool-bar-right] - `(menu-item ,(purecopy "On the Right") + (bindings--define-key menu [showhide-tool-bar-right] + '(menu-item "On the Right" menu-bar-showhide-tool-bar-menu-customize-enable-right - :help ,(purecopy "Tool-bar at the right side") + :help "Tool-bar at the right side" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -997,10 +988,10 @@ 'tool-bar-position) 'right))))) - (define-key menu [showhide-tool-bar-bottom] - `(menu-item ,(purecopy "On the Bottom") + (bindings--define-key menu [showhide-tool-bar-bottom] + '(menu-item "On the Bottom" menu-bar-showhide-tool-bar-menu-customize-enable-bottom - :help ,(purecopy "Tool-bar at the bottom") + :help "Tool-bar at the bottom" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -1009,10 +1000,10 @@ 'tool-bar-position) 'bottom))))) - (define-key menu [showhide-tool-bar-top] - `(menu-item ,(purecopy "On the Top") + (bindings--define-key menu [showhide-tool-bar-top] + '(menu-item "On the Top" menu-bar-showhide-tool-bar-menu-customize-enable-top - :help ,(purecopy "Tool-bar at the top") + :help "Tool-bar at the top" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -1021,10 +1012,10 @@ 'tool-bar-position) 'top))))) - (define-key menu [showhide-tool-bar-none] - `(menu-item ,(purecopy "None") + (bindings--define-key menu [showhide-tool-bar-none] + '(menu-item "None" menu-bar-showhide-tool-bar-menu-customize-disable - :help ,(purecopy "Turn tool-bar off") + :help "Turn tool-bar off" :visible (display-graphic-p) :button (:radio . (eq tool-bar-mode nil)))) menu))) @@ -1032,64 +1023,64 @@ (defvar menu-bar-showhide-menu (let ((menu (make-sparse-keymap "Show/Hide"))) - (define-key menu [column-number-mode] + (bindings--define-key menu [column-number-mode] (menu-bar-make-mm-toggle column-number-mode "Column Numbers" "Show the current column number in the mode line")) - (define-key menu [line-number-mode] + (bindings--define-key menu [line-number-mode] (menu-bar-make-mm-toggle line-number-mode "Line Numbers" "Show the current line number in the mode line")) - (define-key menu [size-indication-mode] + (bindings--define-key menu [size-indication-mode] (menu-bar-make-mm-toggle size-indication-mode "Size Indication" "Show the size of the buffer in the mode line")) - (define-key menu [linecolumn-separator] + (bindings--define-key menu [linecolumn-separator] menu-bar-separator) - (define-key menu [showhide-battery] + (bindings--define-key menu [showhide-battery] (menu-bar-make-mm-toggle display-battery-mode "Battery Status" "Display battery status information in mode line")) - (define-key menu [showhide-date-time] + (bindings--define-key menu [showhide-date-time] (menu-bar-make-mm-toggle display-time-mode "Time, Load and Mail" "Display time, system load averages and \ mail status in mode line")) - (define-key menu [datetime-separator] + (bindings--define-key menu [datetime-separator] menu-bar-separator) - (define-key menu [showhide-speedbar] - `(menu-item ,(purecopy "Speedbar") speedbar-frame-mode - :help ,(purecopy "Display a Speedbar quick-navigation frame") + (bindings--define-key menu [showhide-speedbar] + '(menu-item "Speedbar" speedbar-frame-mode + :help "Display a Speedbar quick-navigation frame" :button (:toggle . (and (boundp 'speedbar-frame) (frame-live-p (symbol-value 'speedbar-frame)) (frame-visible-p (symbol-value 'speedbar-frame)))))) - (define-key menu [showhide-fringe] - `(menu-item ,(purecopy "Fringe") ,menu-bar-showhide-fringe-menu - :visible (display-graphic-p))) - - (define-key menu [showhide-scroll-bar] - `(menu-item ,(purecopy "Scroll-bar") ,menu-bar-showhide-scroll-bar-menu - :visible (display-graphic-p))) - - (define-key menu [showhide-tooltip-mode] - `(menu-item ,(purecopy "Tooltips") tooltip-mode - :help ,(purecopy "Turn tooltips on/off") + (bindings--define-key menu [showhide-fringe] + `(menu-item "Fringe" ,menu-bar-showhide-fringe-menu + :visible (display-graphic-p))) + + (bindings--define-key menu [showhide-scroll-bar] + `(menu-item "Scroll-bar" ,menu-bar-showhide-scroll-bar-menu + :visible (display-graphic-p))) + + (bindings--define-key menu [showhide-tooltip-mode] + '(menu-item "Tooltips" tooltip-mode + :help "Turn tooltips on/off" :visible (and (display-graphic-p) (fboundp 'x-show-tip)) :button (:toggle . tooltip-mode))) - (define-key menu [menu-bar-mode] - `(menu-item ,(purecopy "Menu-bar") toggle-menu-bar-mode-from-frame - :help ,(purecopy "Turn menu-bar on/off") + (bindings--define-key menu [menu-bar-mode] + '(menu-item "Menu-bar" toggle-menu-bar-mode-from-frame + :help "Turn menu-bar on/off" :button (:toggle . (menu-bar-positive-p (frame-parameter (menu-bar-frame-for-menubar) @@ -1097,13 +1088,13 @@ (if (and (boundp 'menu-bar-showhide-tool-bar-menu) (keymapp menu-bar-showhide-tool-bar-menu)) - (define-key menu [showhide-tool-bar] - `(menu-item ,(purecopy "Tool-bar") ,menu-bar-showhide-tool-bar-menu + (bindings--define-key menu [showhide-tool-bar] + `(menu-item "Tool-bar" ,menu-bar-showhide-tool-bar-menu :visible (display-graphic-p))) ;; else not tool bar that can move. - (define-key menu [showhide-tool-bar] - `(menu-item ,(purecopy "Tool-bar") toggle-tool-bar-mode-from-frame - :help ,(purecopy "Turn tool-bar on/off") + (bindings--define-key menu [showhide-tool-bar] + '(menu-item "Tool-bar" toggle-tool-bar-mode-from-frame + :help "Turn tool-bar on/off" :visible (display-graphic-p) :button (:toggle . (menu-bar-positive-p @@ -1123,120 +1114,120 @@ (defvar menu-bar-line-wrapping-menu (let ((menu (make-sparse-keymap "Line Wrapping"))) - (define-key menu [word-wrap] - `(menu-item - ,(purecopy "Word Wrap (Visual Line mode)") - ,(purecopy - (lambda () - (interactive) - (unless visual-line-mode - (visual-line-mode 1)) - (message "Visual-Line mode enabled"))) - :help ,(purecopy "Wrap long lines at word boundaries") - :button (:radio . (and (null truncate-lines) - (not (truncated-partial-width-window-p)) - word-wrap)) - :visible (menu-bar-menu-frame-live-and-visible-p))) + (bindings--define-key menu [word-wrap] + `(menu-item "Word Wrap (Visual Line mode)" + ,(lambda () + (interactive) + (unless visual-line-mode + (visual-line-mode 1)) + (message "Visual-Line mode enabled")) + :help "Wrap long lines at word boundaries" + :button (:radio + . (and (null truncate-lines) + (not (truncated-partial-width-window-p)) + word-wrap)) + :visible (menu-bar-menu-frame-live-and-visible-p))) - (define-key menu [truncate] - `(menu-item ,(purecopy "Truncate Long Lines") - (lambda () - (interactive) - (if visual-line-mode (visual-line-mode 0)) - (setq word-wrap nil) - (toggle-truncate-lines 1)) - :help ,(purecopy "Truncate long lines at window edge") + (bindings--define-key menu [truncate] + `(menu-item "Truncate Long Lines" + ,(lambda () + (interactive) + (if visual-line-mode (visual-line-mode 0)) + (setq word-wrap nil) + (toggle-truncate-lines 1)) + :help "Truncate long lines at window edge" :button (:radio . (or truncate-lines (truncated-partial-width-window-p))) :visible (menu-bar-menu-frame-live-and-visible-p) :enable (not (truncated-partial-width-window-p)))) - (define-key menu [window-wrap] - `(menu-item ,(purecopy "Wrap at Window Edge") - (lambda () (interactive) - (if visual-line-mode (visual-line-mode 0)) - (setq word-wrap nil) - (if truncate-lines (toggle-truncate-lines -1))) - :help ,(purecopy "Wrap long lines at window edge") - :button (:radio . (and (null truncate-lines) - (not (truncated-partial-width-window-p)) - (not word-wrap))) + (bindings--define-key menu [window-wrap] + `(menu-item "Wrap at Window Edge" + ,(lambda () (interactive) + (if visual-line-mode (visual-line-mode 0)) + (setq word-wrap nil) + (if truncate-lines (toggle-truncate-lines -1))) + :help "Wrap long lines at window edge" + :button (:radio + . (and (null truncate-lines) + (not (truncated-partial-width-window-p)) + (not word-wrap))) :visible (menu-bar-menu-frame-live-and-visible-p) :enable (not (truncated-partial-width-window-p)))) menu)) (defvar menu-bar-options-menu (let ((menu (make-sparse-keymap "Options"))) - (define-key menu [customize] - `(menu-item ,(purecopy "Customize Emacs") ,menu-bar-custom-menu)) + (bindings--define-key menu [customize] + `(menu-item "Customize Emacs" ,menu-bar-custom-menu)) - (define-key menu [package] + (bindings--define-key menu [package] '(menu-item "Manage Emacs Packages" package-list-packages :help "Install or uninstall additional Emacs packages")) - (define-key menu [save] - `(menu-item ,(purecopy "Save Options") menu-bar-options-save - :help ,(purecopy "Save options set from the menu above"))) + (bindings--define-key menu [save] + '(menu-item "Save Options" menu-bar-options-save + :help "Save options set from the menu above")) - (define-key menu [custom-separator] + (bindings--define-key menu [custom-separator] menu-bar-separator) - (define-key menu [menu-set-font] - `(menu-item ,(purecopy "Set Default Font...") menu-set-font + (bindings--define-key menu [menu-set-font] + '(menu-item "Set Default Font..." menu-set-font :visible (display-multi-font-p) - :help ,(purecopy "Select a default font"))) + :help "Select a default font")) (if (featurep 'system-font-setting) - (define-key menu [menu-system-font] + (bindings--define-key menu [menu-system-font] (menu-bar-make-toggle toggle-use-system-font font-use-system-font "Use System Font" "Use system font: %s" "Use the monospaced font defined by the system"))) - (define-key menu [showhide] - `(menu-item ,(purecopy "Show/Hide") ,menu-bar-showhide-menu)) + (bindings--define-key menu [showhide] + `(menu-item "Show/Hide" ,menu-bar-showhide-menu)) - (define-key menu [showhide-separator] + (bindings--define-key menu [showhide-separator] menu-bar-separator) - (define-key menu [mule] + (bindings--define-key menu [mule] ;; It is better not to use backquote here, ;; because that makes a bootstrapping problem ;; if you need to recompile all the Lisp files using interpreted code. - `(menu-item ,(purecopy "Multilingual Environment") ,mule-menu-keymap + `(menu-item "Multilingual Environment" ,mule-menu-keymap ;; Most of the MULE menu actually does make sense in ;; unibyte mode, e.g. language selection. ;; :visible '(default-value 'enable-multibyte-characters) )) ;;(setq menu-bar-final-items (cons 'mule menu-bar-final-items)) - ;;(define-key menu [preferences] - ;; `(menu-item ,(purecopy "Preferences") ,menu-bar-preferences-menu - ;; :help ,(purecopy "Toggle important global options"))) + ;;(bindings--define-key menu [preferences] + ;; `(menu-item "Preferences" ,menu-bar-preferences-menu + ;; :help "Toggle important global options")) - (define-key menu [mule-separator] + (bindings--define-key menu [mule-separator] menu-bar-separator) - (define-key menu [debug-on-quit] + (bindings--define-key menu [debug-on-quit] (menu-bar-make-toggle toggle-debug-on-quit debug-on-quit "Enter Debugger on Quit/C-g" "Debug on Quit %s" "Enter Lisp debugger when C-g is pressed")) - (define-key menu [debug-on-error] + (bindings--define-key menu [debug-on-error] (menu-bar-make-toggle toggle-debug-on-error debug-on-error "Enter Debugger on Error" "Debug on Error %s" "Enter Lisp debugger when an error is signaled")) - (define-key menu [debugger-separator] + (bindings--define-key menu [debugger-separator] menu-bar-separator) - (define-key menu [blink-cursor-mode] + (bindings--define-key menu [blink-cursor-mode] (menu-bar-make-mm-toggle blink-cursor-mode "Blink Cursor" "Whether the cursor blinks (Blink Cursor mode)")) - (define-key menu [cursor-separator] + (bindings--define-key menu [cursor-separator] menu-bar-separator) - (define-key menu [save-place] + (bindings--define-key menu [save-place] (menu-bar-make-toggle toggle-save-place-globally save-place "Save Place in Files between Sessions" @@ -1248,7 +1239,7 @@ (set-default 'save-place (not (symbol-value 'save-place))))) - (define-key menu [uniquify] + (bindings--define-key menu [uniquify] (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style "Use Directory Names in Buffer Names" @@ -1259,9 +1250,9 @@ (if (not uniquify-buffer-name-style) 'forward)))) - (define-key menu [edit-options-separator] + (bindings--define-key menu [edit-options-separator] menu-bar-separator) - (define-key menu [cua-mode] + (bindings--define-key menu [cua-mode] (menu-bar-make-mm-toggle cua-mode "Use CUA Keys (Cut/Paste with C-x/C-c/C-v)" @@ -1269,7 +1260,7 @@ (:visible (or (not (boundp 'cua-enable-cua-keys)) cua-enable-cua-keys)))) - (define-key menu [cua-emulation-mode] + (bindings--define-key menu [cua-emulation-mode] (menu-bar-make-mm-toggle cua-mode "Shift movement mark region (CUA)" @@ -1277,35 +1268,35 @@ (:visible (and (boundp 'cua-enable-cua-keys) (not cua-enable-cua-keys))))) - (define-key menu [case-fold-search] + (bindings--define-key menu [case-fold-search] (menu-bar-make-toggle toggle-case-fold-search case-fold-search "Ignore Case for Search" "Case-Insensitive Search %s" "Ignore letter-case in search commands")) - (define-key menu [auto-fill-mode] - `(menu-item - ,(purecopy "Auto Fill in Text Modes") + (bindings--define-key menu [auto-fill-mode] + '(menu-item + "Auto Fill in Text Modes" menu-bar-text-mode-auto-fill - :help ,(purecopy "Automatically fill text while typing (Auto Fill mode)") + :help "Automatically fill text while typing (Auto Fill mode)" :button (:toggle . (if (listp text-mode-hook) (member 'turn-on-auto-fill text-mode-hook) (eq 'turn-on-auto-fill text-mode-hook))))) - (define-key menu [line-wrapping] - `(menu-item ,(purecopy "Line Wrapping in This Buffer") + (bindings--define-key menu [line-wrapping] + `(menu-item "Line Wrapping in This Buffer" ,menu-bar-line-wrapping-menu)) - (define-key menu [highlight-separator] + (bindings--define-key menu [highlight-separator] menu-bar-separator) - (define-key menu [highlight-paren-mode] + (bindings--define-key menu [highlight-paren-mode] (menu-bar-make-mm-toggle show-paren-mode "Highlight Matching Parentheses" "Highlight matching/mismatched parentheses at cursor (Show Paren mode)")) - (define-key menu [transient-mark-mode] + (bindings--define-key menu [transient-mark-mode] (menu-bar-make-mm-toggle transient-mark-mode "Highlight Active Region" @@ -1339,109 +1330,109 @@ (defvar menu-bar-games-menu (let ((menu (make-sparse-keymap "Games"))) - (define-key menu [zone] - `(menu-item ,(purecopy "Zone Out") zone - :help ,(purecopy "Play tricks with Emacs display when Emacs is idle"))) - (define-key menu [tetris] - `(menu-item ,(purecopy "Tetris") tetris - :help ,(purecopy "Falling blocks game"))) - (define-key menu [solitaire] - `(menu-item ,(purecopy "Solitaire") solitaire - :help ,(purecopy "Get rid of all the stones"))) - (define-key menu [snake] - `(menu-item ,(purecopy "Snake") snake - :help ,(purecopy "Move snake around avoiding collisions"))) - (define-key menu [pong] - `(menu-item ,(purecopy "Pong") pong - :help ,(purecopy "Bounce the ball to your opponent"))) - (define-key menu [mult] - `(menu-item ,(purecopy "Multiplication Puzzle") mpuz - :help ,(purecopy "Exercise brain with multiplication"))) - (define-key menu [life] - `(menu-item ,(purecopy "Life") life - :help ,(purecopy "Watch how John Conway's cellular automaton evolves"))) - (define-key menu [land] - `(menu-item ,(purecopy "Landmark") landmark - :help ,(purecopy "Watch a neural-network robot learn landmarks"))) - (define-key menu [hanoi] - `(menu-item ,(purecopy "Towers of Hanoi") hanoi - :help ,(purecopy "Watch Towers-of-Hanoi puzzle solved by Emacs"))) - (define-key menu [gomoku] - `(menu-item ,(purecopy "Gomoku") gomoku - :help ,(purecopy "Mark 5 contiguous squares (like tic-tac-toe)"))) - (define-key menu [bubbles] - `(menu-item ,(purecopy "Bubbles") bubbles - :help ,(purecopy "Remove all bubbles using the fewest moves"))) - (define-key menu [black-box] - `(menu-item ,(purecopy "Blackbox") blackbox - :help ,(purecopy "Find balls in a black box by shooting rays"))) - (define-key menu [adventure] - `(menu-item ,(purecopy "Adventure") dunnet - :help ,(purecopy "Dunnet, a text Adventure game for Emacs"))) - (define-key menu [5x5] - `(menu-item ,(purecopy "5x5") 5x5 - :help ,(purecopy "Fill in all the squares on a 5x5 board"))) + (bindings--define-key menu [zone] + '(menu-item "Zone Out" zone + :help "Play tricks with Emacs display when Emacs is idle")) + (bindings--define-key menu [tetris] + '(menu-item "Tetris" tetris + :help "Falling blocks game")) + (bindings--define-key menu [solitaire] + '(menu-item "Solitaire" solitaire + :help "Get rid of all the stones")) + (bindings--define-key menu [snake] + '(menu-item "Snake" snake + :help "Move snake around avoiding collisions")) + (bindings--define-key menu [pong] + '(menu-item "Pong" pong + :help "Bounce the ball to your opponent")) + (bindings--define-key menu [mult] + '(menu-item "Multiplication Puzzle" mpuz + :help "Exercise brain with multiplication")) + (bindings--define-key menu [life] + '(menu-item "Life" life + :help "Watch how John Conway's cellular automaton evolves")) + (bindings--define-key menu [land] + '(menu-item "Landmark" landmark + :help "Watch a neural-network robot learn landmarks")) + (bindings--define-key menu [hanoi] + '(menu-item "Towers of Hanoi" hanoi + :help "Watch Towers-of-Hanoi puzzle solved by Emacs")) + (bindings--define-key menu [gomoku] + '(menu-item "Gomoku" gomoku + :help "Mark 5 contiguous squares (like tic-tac-toe)")) + (bindings--define-key menu [bubbles] + '(menu-item "Bubbles" bubbles + :help "Remove all bubbles using the fewest moves")) + (bindings--define-key menu [black-box] + '(menu-item "Blackbox" blackbox + :help "Find balls in a black box by shooting rays")) + (bindings--define-key menu [adventure] + '(menu-item "Adventure" dunnet + :help "Dunnet, a text Adventure game for Emacs")) + (bindings--define-key menu [5x5] + '(menu-item "5x5" 5x5 + :help "Fill in all the squares on a 5x5 board")) menu)) (defvar menu-bar-encryption-decryption-menu (let ((menu (make-sparse-keymap "Encryption/Decryption"))) - (define-key menu [insert-keys] - `(menu-item ,(purecopy "Insert Keys") epa-insert-keys - :help ,(purecopy "Insert public keys after the current point"))) - - (define-key menu [export-keys] - `(menu-item ,(purecopy "Export Keys") epa-export-keys - :help ,(purecopy "Export public keys to a file"))) - - (define-key menu [import-keys-region] - `(menu-item ,(purecopy "Import Keys from Region") epa-import-keys-region - :help ,(purecopy "Import public keys from the current region"))) - - (define-key menu [import-keys] - `(menu-item ,(purecopy "Import Keys from File...") epa-import-keys - :help ,(purecopy "Import public keys from a file"))) - - (define-key menu [list-keys] - `(menu-item ,(purecopy "List Keys") epa-list-keys - :help ,(purecopy "Browse your public keyring"))) - - (define-key menu [separator-keys] - menu-bar-separator) - - (define-key menu [sign-region] - `(menu-item ,(purecopy "Sign Region") epa-sign-region - :help ,(purecopy "Create digital signature of the current region"))) - - (define-key menu [verify-region] - `(menu-item ,(purecopy "Verify Region") epa-verify-region - :help ,(purecopy "Verify digital signature of the current region"))) - - (define-key menu [encrypt-region] - `(menu-item ,(purecopy "Encrypt Region") epa-encrypt-region - :help ,(purecopy "Encrypt the current region"))) - - (define-key menu [decrypt-region] - `(menu-item ,(purecopy "Decrypt Region") epa-decrypt-region - :help ,(purecopy "Decrypt the current region"))) - - (define-key menu [separator-file] - menu-bar-separator) - - (define-key menu [sign-file] - `(menu-item ,(purecopy "Sign File...") epa-sign-file - :help ,(purecopy "Create digital signature of a file"))) - - (define-key menu [verify-file] - `(menu-item ,(purecopy "Verify File...") epa-verify-file - :help ,(purecopy "Verify digital signature of a file"))) - - (define-key menu [encrypt-file] - `(menu-item ,(purecopy "Encrypt File...") epa-encrypt-file - :help ,(purecopy "Encrypt a file"))) - - (define-key menu [decrypt-file] - `(menu-item ,(purecopy "Decrypt File...") epa-decrypt-file - :help ,(purecopy "Decrypt a file"))) + (bindings--define-key menu [insert-keys] + '(menu-item "Insert Keys" epa-insert-keys + :help "Insert public keys after the current point")) + + (bindings--define-key menu [export-keys] + '(menu-item "Export Keys" epa-export-keys + :help "Export public keys to a file")) + + (bindings--define-key menu [import-keys-region] + '(menu-item "Import Keys from Region" epa-import-keys-region + :help "Import public keys from the current region")) + + (bindings--define-key menu [import-keys] + '(menu-item "Import Keys from File..." epa-import-keys + :help "Import public keys from a file")) + + (bindings--define-key menu [list-keys] + '(menu-item "List Keys" epa-list-keys + :help "Browse your public keyring")) + + (bindings--define-key menu [separator-keys] + menu-bar-separator) + + (bindings--define-key menu [sign-region] + '(menu-item "Sign Region" epa-sign-region + :help "Create digital signature of the current region")) + + (bindings--define-key menu [verify-region] + '(menu-item "Verify Region" epa-verify-region + :help "Verify digital signature of the current region")) + + (bindings--define-key menu [encrypt-region] + '(menu-item "Encrypt Region" epa-encrypt-region + :help "Encrypt the current region")) + + (bindings--define-key menu [decrypt-region] + '(menu-item "Decrypt Region" epa-decrypt-region + :help "Decrypt the current region")) + + (bindings--define-key menu [separator-file] + menu-bar-separator) + + (bindings--define-key menu [sign-file] + '(menu-item "Sign File..." epa-sign-file + :help "Create digital signature of a file")) + + (bindings--define-key menu [verify-file] + '(menu-item "Verify File..." epa-verify-file + :help "Verify digital signature of a file")) + + (bindings--define-key menu [encrypt-file] + '(menu-item "Encrypt File..." epa-encrypt-file + :help "Encrypt a file")) + + (bindings--define-key menu [decrypt-file] + '(menu-item "Decrypt File..." epa-decrypt-file + :help "Decrypt a file")) menu)) @@ -1453,102 +1444,103 @@ (defvar menu-bar-tools-menu (let ((menu (make-sparse-keymap "Tools"))) - (define-key menu [games] - `(menu-item ,(purecopy "Games") ,menu-bar-games-menu)) - - (define-key menu [separator-games] - menu-bar-separator) - - (define-key menu [encryption-decryption] - `(menu-item ,(purecopy "Encryption/Decryption") ,menu-bar-encryption-decryption-menu)) - - (define-key menu [separator-encryption-decryption] - menu-bar-separator) - - (define-key menu [simple-calculator] - `(menu-item ,(purecopy "Simple Calculator") calculator - :help ,(purecopy "Invoke the Emacs built-in quick calculator"))) - (define-key menu [calc] - `(menu-item ,(purecopy "Programmable Calculator") calc - :help ,(purecopy "Invoke the Emacs built-in full scientific calculator"))) - (define-key menu [calendar] - `(menu-item ,(purecopy "Calendar") calendar - :help ,(purecopy "Invoke the Emacs built-in calendar"))) - - (define-key menu [separator-net] - menu-bar-separator) - - (define-key menu [directory-search] - `(menu-item ,(purecopy "Directory Search") eudc-tools-menu)) - (define-key menu [compose-mail] - `(menu-item (format "Send Mail (with %s)" (send-mail-item-name)) compose-mail + (bindings--define-key menu [games] + `(menu-item "Games" ,menu-bar-games-menu)) + + (bindings--define-key menu [separator-games] + menu-bar-separator) + + (bindings--define-key menu [encryption-decryption] + `(menu-item "Encryption/Decryption" + ,menu-bar-encryption-decryption-menu)) + + (bindings--define-key menu [separator-encryption-decryption] + menu-bar-separator) + + (bindings--define-key menu [simple-calculator] + '(menu-item "Simple Calculator" calculator + :help "Invoke the Emacs built-in quick calculator")) + (bindings--define-key menu [calc] + '(menu-item "Programmable Calculator" calc + :help "Invoke the Emacs built-in full scientific calculator")) + (bindings--define-key menu [calendar] + '(menu-item "Calendar" calendar + :help "Invoke the Emacs built-in calendar")) + + (bindings--define-key menu [separator-net] + menu-bar-separator) + + (bindings--define-key menu [directory-search] + '(menu-item "Directory Search" eudc-tools-menu)) + (bindings--define-key menu [compose-mail] + '(menu-item (format "Send Mail (with %s)" (send-mail-item-name)) compose-mail :visible (and mail-user-agent (not (eq mail-user-agent 'ignore))) - :help ,(purecopy "Send a mail message"))) - (define-key menu [rmail] - `(menu-item (format "Read Mail (with %s)" (read-mail-item-name)) + :help "Send a mail message")) + (bindings--define-key menu [rmail] + '(menu-item (format "Read Mail (with %s)" (read-mail-item-name)) menu-bar-read-mail :visible (and read-mail-command (not (eq read-mail-command 'ignore))) - :help ,(purecopy "Read your mail and reply to it"))) - - (define-key menu [gnus] - `(menu-item ,(purecopy "Read Net News (Gnus)") gnus - :help ,(purecopy "Read network news groups"))) - - (define-key menu [separator-vc] - menu-bar-separator) - - (define-key menu [pcl-cvs] - `(menu-item ,(purecopy "PCL-CVS") cvs-global-menu)) - (define-key menu [vc] nil) ;Create the place for the VC menu. - - (define-key menu [separator-compare] - menu-bar-separator) - - (define-key menu [epatch] - `(menu-item ,(purecopy "Apply Patch") menu-bar-epatch-menu)) - (define-key menu [ediff-merge] - `(menu-item ,(purecopy "Merge") menu-bar-ediff-merge-menu)) - (define-key menu [compare] - `(menu-item ,(purecopy "Compare (Ediff)") menu-bar-ediff-menu)) - - (define-key menu [separator-spell] - menu-bar-separator) - - (define-key menu [spell] - `(menu-item ,(purecopy "Spell Checking") ispell-menu-map)) - - (define-key menu [separator-prog] - menu-bar-separator) - - (define-key menu [semantic] - `(menu-item ,(purecopy "Source Code Parsers (Semantic)") + :help "Read your mail and reply to it")) + + (bindings--define-key menu [gnus] + '(menu-item "Read Net News (Gnus)" gnus + :help "Read network news groups")) + + (bindings--define-key menu [separator-vc] + menu-bar-separator) + + (bindings--define-key menu [pcl-cvs] + '(menu-item "PCL-CVS" cvs-global-menu)) + (bindings--define-key menu [vc] nil) ;Create the place for the VC menu. + + (bindings--define-key menu [separator-compare] + menu-bar-separator) + + (bindings--define-key menu [epatch] + '(menu-item "Apply Patch" menu-bar-epatch-menu)) + (bindings--define-key menu [ediff-merge] + '(menu-item "Merge" menu-bar-ediff-merge-menu)) + (bindings--define-key menu [compare] + '(menu-item "Compare (Ediff)" menu-bar-ediff-menu)) + + (bindings--define-key menu [separator-spell] + menu-bar-separator) + + (bindings--define-key menu [spell] + '(menu-item "Spell Checking" ispell-menu-map)) + + (bindings--define-key menu [separator-prog] + menu-bar-separator) + + (bindings--define-key menu [semantic] + '(menu-item "Source Code Parsers (Semantic)" semantic-mode - :help ,(purecopy "Toggle automatic parsing in source code buffers (Semantic mode)") + :help "Toggle automatic parsing in source code buffers (Semantic mode)" :button (:toggle . (bound-and-true-p semantic-mode)))) - (define-key menu [ede] - `(menu-item ,(purecopy "Project support (EDE)") + (bindings--define-key menu [ede] + '(menu-item "Project support (EDE)" global-ede-mode - :help ,(purecopy "Toggle the Emacs Development Environment (Global EDE mode)") + :help "Toggle the Emacs Development Environment (Global EDE mode)" :button (:toggle . (bound-and-true-p global-ede-mode)))) - (define-key menu [gdb] - `(menu-item ,(purecopy "Debugger (GDB)...") gdb - :help ,(purecopy "Debug a program from within Emacs with GDB"))) - (define-key menu [shell-on-region] - `(menu-item ,(purecopy "Shell Command on Region...") shell-command-on-region + (bindings--define-key menu [gdb] + '(menu-item "Debugger (GDB)..." gdb + :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [shell-on-region] + '(menu-item "Shell Command on Region..." shell-command-on-region :enable mark-active - :help ,(purecopy "Pass marked region to a shell command"))) - (define-key menu [shell] - `(menu-item ,(purecopy "Shell Command...") shell-command - :help ,(purecopy "Invoke a shell command and catch its output"))) - (define-key menu [compile] - `(menu-item ,(purecopy "Compile...") compile - :help ,(purecopy "Invoke compiler or Make, view compilation errors"))) - (define-key menu [grep] - `(menu-item ,(purecopy "Search Files (Grep)...") grep - :help ,(purecopy "Search files for strings or regexps (with Grep)"))) + :help "Pass marked region to a shell command")) + (bindings--define-key menu [shell] + '(menu-item "Shell Command..." shell-command + :help "Invoke a shell command and catch its output")) + (bindings--define-key menu [compile] + '(menu-item "Compile..." compile + :help "Invoke compiler or Make, view compilation errors")) + (bindings--define-key menu [grep] + '(menu-item "Search Files (Grep)..." grep + :help "Search files for strings or regexps (with Grep)")) menu)) ;; The "Help" menu items @@ -1556,54 +1548,54 @@ (defvar menu-bar-describe-menu (let ((menu (make-sparse-keymap "Describe"))) - (define-key menu [mule-diag] - `(menu-item ,(purecopy "Show All of Mule Status") mule-diag + (bindings--define-key menu [mule-diag] + '(menu-item "Show All of Mule Status" mule-diag :visible (default-value 'enable-multibyte-characters) - :help ,(purecopy "Display multilingual environment settings"))) - (define-key menu [describe-coding-system-briefly] - `(menu-item ,(purecopy "Describe Coding System (Briefly)") + :help "Display multilingual environment settings")) + (bindings--define-key menu [describe-coding-system-briefly] + '(menu-item "Describe Coding System (Briefly)" describe-current-coding-system-briefly :visible (default-value 'enable-multibyte-characters))) - (define-key menu [describe-coding-system] - `(menu-item ,(purecopy "Describe Coding System...") describe-coding-system + (bindings--define-key menu [describe-coding-system] + '(menu-item "Describe Coding System..." describe-coding-system :visible (default-value 'enable-multibyte-characters))) - (define-key menu [describe-input-method] - `(menu-item ,(purecopy "Describe Input Method...") describe-input-method + (bindings--define-key menu [describe-input-method] + '(menu-item "Describe Input Method..." describe-input-method :visible (default-value 'enable-multibyte-characters) - :help ,(purecopy "Keyboard layout for specific input method"))) - (define-key menu [describe-language-environment] - `(menu-item ,(purecopy "Describe Language Environment") + :help "Keyboard layout for specific input method")) + (bindings--define-key menu [describe-language-environment] + `(menu-item "Describe Language Environment" ,describe-language-environment-map)) - (define-key menu [separator-desc-mule] + (bindings--define-key menu [separator-desc-mule] menu-bar-separator) - (define-key menu [list-keybindings] - `(menu-item ,(purecopy "List Key Bindings") describe-bindings - :help ,(purecopy "Display all current key bindings (keyboard shortcuts)"))) - (define-key menu [describe-current-display-table] - `(menu-item ,(purecopy "Describe Display Table") describe-current-display-table - :help ,(purecopy "Describe the current display table"))) - (define-key menu [describe-package] - `(menu-item ,(purecopy "Describe Package...") describe-package - :help ,(purecopy "Display documentation of a Lisp package"))) - (define-key menu [describe-face] - `(menu-item ,(purecopy "Describe Face...") describe-face - :help ,(purecopy "Display the properties of a face"))) - (define-key menu [describe-variable] - `(menu-item ,(purecopy "Describe Variable...") describe-variable - :help ,(purecopy "Display documentation of variable/option"))) - (define-key menu [describe-function] - `(menu-item ,(purecopy "Describe Function...") describe-function - :help ,(purecopy "Display documentation of function/command"))) - (define-key menu [describe-key-1] - `(menu-item ,(purecopy "Describe Key or Mouse Operation...") describe-key + (bindings--define-key menu [list-keybindings] + '(menu-item "List Key Bindings" describe-bindings + :help "Display all current key bindings (keyboard shortcuts)")) + (bindings--define-key menu [describe-current-display-table] + '(menu-item "Describe Display Table" describe-current-display-table + :help "Describe the current display table")) + (bindings--define-key menu [describe-package] + '(menu-item "Describe Package..." describe-package + :help "Display documentation of a Lisp package")) + (bindings--define-key menu [describe-face] + '(menu-item "Describe Face..." describe-face + :help "Display the properties of a face")) + (bindings--define-key menu [describe-variable] + '(menu-item "Describe Variable..." describe-variable + :help "Display documentation of variable/option")) + (bindings--define-key menu [describe-function] + '(menu-item "Describe Function..." describe-function + :help "Display documentation of function/command")) + (bindings--define-key menu [describe-key-1] + '(menu-item "Describe Key or Mouse Operation..." describe-key ;; Users typically don't identify keys and menu items... - :help ,(purecopy "Display documentation of command bound to a \ -key, a click, or a menu-item"))) - (define-key menu [describe-mode] - `(menu-item ,(purecopy "Describe Buffer Modes") describe-mode - :help ,(purecopy "Describe this buffer's major and minor mode"))) + :help "Display documentation of command bound to a \ +key, a click, or a menu-item")) + (bindings--define-key menu [describe-mode] + '(menu-item "Describe Buffer Modes" describe-mode + :help "Describe this buffer's major and minor mode")) menu)) (defun menu-bar-read-lispref () @@ -1636,64 +1628,64 @@ (defvar menu-bar-search-documentation-menu (let ((menu (make-sparse-keymap "Search Documentation"))) - (define-key menu [search-documentation-strings] - `(menu-item ,(purecopy "Search Documentation Strings...") apropos-documentation + (bindings--define-key menu [search-documentation-strings] + '(menu-item "Search Documentation Strings..." apropos-documentation :help - ,(purecopy "Find functions and variables whose doc strings match a regexp"))) - (define-key menu [find-any-object-by-name] - `(menu-item ,(purecopy "Find Any Object by Name...") apropos - :help ,(purecopy "Find symbols of any kind whose names match a regexp"))) - (define-key menu [find-option-by-value] - `(menu-item ,(purecopy "Find Options by Value...") apropos-value - :help ,(purecopy "Find variables whose values match a regexp"))) - (define-key menu [find-options-by-name] - `(menu-item ,(purecopy "Find Options by Name...") apropos-variable - :help ,(purecopy "Find variables whose names match a regexp"))) - (define-key menu [find-commands-by-name] - `(menu-item ,(purecopy "Find Commands by Name...") apropos-command - :help ,(purecopy "Find commands whose names match a regexp"))) - (define-key menu [sep1] + "Find functions and variables whose doc strings match a regexp")) + (bindings--define-key menu [find-any-object-by-name] + '(menu-item "Find Any Object by Name..." apropos + :help "Find symbols of any kind whose names match a regexp")) + (bindings--define-key menu [find-option-by-value] + '(menu-item "Find Options by Value..." apropos-value + :help "Find variables whose values match a regexp")) + (bindings--define-key menu [find-options-by-name] + '(menu-item "Find Options by Name..." apropos-variable + :help "Find variables whose names match a regexp")) + (bindings--define-key menu [find-commands-by-name] + '(menu-item "Find Commands by Name..." apropos-command + :help "Find commands whose names match a regexp")) + (bindings--define-key menu [sep1] menu-bar-separator) - (define-key menu [lookup-command-in-manual] - `(menu-item ,(purecopy "Look Up Command in User Manual...") Info-goto-emacs-command-node - :help ,(purecopy "Display manual section that describes a command"))) - (define-key menu [lookup-key-in-manual] - `(menu-item ,(purecopy "Look Up Key in User Manual...") Info-goto-emacs-key-command-node - :help ,(purecopy "Display manual section that describes a key"))) - (define-key menu [lookup-subject-in-elisp-manual] - `(menu-item ,(purecopy "Look Up Subject in ELisp Manual...") elisp-index-search - :help ,(purecopy "Find description of a subject in Emacs Lisp manual"))) - (define-key menu [lookup-subject-in-emacs-manual] - `(menu-item ,(purecopy "Look Up Subject in User Manual...") emacs-index-search - :help ,(purecopy "Find description of a subject in Emacs User manual"))) - (define-key menu [emacs-terminology] - `(menu-item ,(purecopy "Emacs Terminology") search-emacs-glossary - :help ,(purecopy "Display the Glossary section of the Emacs manual"))) + (bindings--define-key menu [lookup-command-in-manual] + '(menu-item "Look Up Command in User Manual..." Info-goto-emacs-command-node + :help "Display manual section that describes a command")) + (bindings--define-key menu [lookup-key-in-manual] + '(menu-item "Look Up Key in User Manual..." Info-goto-emacs-key-command-node + :help "Display manual section that describes a key")) + (bindings--define-key menu [lookup-subject-in-elisp-manual] + '(menu-item "Look Up Subject in ELisp Manual..." elisp-index-search + :help "Find description of a subject in Emacs Lisp manual")) + (bindings--define-key menu [lookup-subject-in-emacs-manual] + '(menu-item "Look Up Subject in User Manual..." emacs-index-search + :help "Find description of a subject in Emacs User manual")) + (bindings--define-key menu [emacs-terminology] + '(menu-item "Emacs Terminology" search-emacs-glossary + :help "Display the Glossary section of the Emacs manual")) menu)) (defvar menu-bar-manuals-menu (let ((menu (make-sparse-keymap "More Manuals"))) - (define-key menu [man] - `(menu-item ,(purecopy "Read Man Page...") manual-entry - :help ,(purecopy "Man-page docs for external commands and libraries"))) - (define-key menu [sep2] + (bindings--define-key menu [man] + '(menu-item "Read Man Page..." manual-entry + :help "Man-page docs for external commands and libraries")) + (bindings--define-key menu [sep2] menu-bar-separator) - (define-key menu [order-emacs-manuals] - `(menu-item ,(purecopy "Ordering Manuals") view-order-manuals - :help ,(purecopy "How to order manuals from the Free Software Foundation"))) - (define-key menu [lookup-subject-in-all-manuals] - `(menu-item ,(purecopy "Lookup Subject in all Manuals...") info-apropos - :help ,(purecopy "Find description of a subject in all installed manuals"))) - (define-key menu [other-manuals] - `(menu-item ,(purecopy "All Other Manuals (Info)") Info-directory - :help ,(purecopy "Read any of the installed manuals"))) - (define-key menu [emacs-lisp-reference] - `(menu-item ,(purecopy "Emacs Lisp Reference") menu-bar-read-lispref - :help ,(purecopy "Read the Emacs Lisp Reference manual"))) - (define-key menu [emacs-lisp-intro] - `(menu-item ,(purecopy "Introduction to Emacs Lisp") menu-bar-read-lispintro - :help ,(purecopy "Read the Introduction to Emacs Lisp Programming"))) + (bindings--define-key menu [order-emacs-manuals] + '(menu-item "Ordering Manuals" view-order-manuals + :help "How to order manuals from the Free Software Foundation")) + (bindings--define-key menu [lookup-subject-in-all-manuals] + '(menu-item "Lookup Subject in all Manuals..." info-apropos + :help "Find description of a subject in all installed manuals")) + (bindings--define-key menu [other-manuals] + '(menu-item "All Other Manuals (Info)" Info-directory + :help "Read any of the installed manuals")) + (bindings--define-key menu [emacs-lisp-reference] + '(menu-item "Emacs Lisp Reference" menu-bar-read-lispref + :help "Read the Emacs Lisp Reference manual")) + (bindings--define-key menu [emacs-lisp-intro] + '(menu-item "Introduction to Emacs Lisp" menu-bar-read-lispintro + :help "Read the Introduction to Emacs Lisp Programming")) menu)) (defun menu-bar-help-extra-packages () @@ -1711,94 +1703,94 @@ (defvar menu-bar-help-menu (let ((menu (make-sparse-keymap "Help"))) - (define-key menu [about-gnu-project] - `(menu-item ,(purecopy "About GNU") describe-gnu-project - :help ,(purecopy "About the GNU System, GNU Project, and GNU/Linux"))) - (define-key menu [about-emacs] - `(menu-item ,(purecopy "About Emacs") about-emacs - :help ,(purecopy "Display version number, copyright info, and basic help"))) - (define-key menu [sep4] - menu-bar-separator) - (define-key menu [describe-no-warranty] - `(menu-item ,(purecopy "(Non)Warranty") describe-no-warranty - :help ,(purecopy "Explain that Emacs has NO WARRANTY"))) - (define-key menu [describe-copying] - `(menu-item ,(purecopy "Copying Conditions") describe-copying - :help ,(purecopy "Show the Emacs license (GPL)"))) - (define-key menu [getting-new-versions] - `(menu-item ,(purecopy "Getting New Versions") describe-distribution - :help ,(purecopy "How to get the latest version of Emacs"))) - (define-key menu [sep2] - menu-bar-separator) - (define-key menu [external-packages] - `(menu-item ,(purecopy "Finding Extra Packages") menu-bar-help-extra-packages - :help ,(purecopy "Lisp packages distributed separately for use in Emacs"))) - (define-key menu [find-emacs-packages] - `(menu-item ,(purecopy "Search Built-in Packages") finder-by-keyword - :help ,(purecopy "Find built-in packages and features by keyword"))) - (define-key menu [more-manuals] - `(menu-item ,(purecopy "More Manuals") ,menu-bar-manuals-menu)) - (define-key menu [emacs-manual] - `(menu-item ,(purecopy "Read the Emacs Manual") info-emacs-manual - :help ,(purecopy "Full documentation of Emacs features"))) - (define-key menu [describe] - `(menu-item ,(purecopy "Describe") ,menu-bar-describe-menu)) - (define-key menu [search-documentation] - `(menu-item ,(purecopy "Search Documentation") ,menu-bar-search-documentation-menu)) - (define-key menu [sep1] - menu-bar-separator) - (define-key menu [emacs-psychotherapist] - `(menu-item ,(purecopy "Emacs Psychotherapist") doctor - :help ,(purecopy "Our doctor will help you feel better"))) - (define-key menu [send-emacs-bug-report] - `(menu-item ,(purecopy "Send Bug Report...") report-emacs-bug - :help ,(purecopy "Send e-mail to Emacs maintainers"))) - (define-key menu [emacs-manual-bug] - `(menu-item ,(purecopy "How to Report a Bug") info-emacs-bug - :help ,(purecopy "Read about how to report an Emacs bug"))) - (define-key menu [emacs-known-problems] - `(menu-item ,(purecopy "Emacs Known Problems") view-emacs-problems - :help ,(purecopy "Read about known problems with Emacs"))) - (define-key menu [emacs-news] - `(menu-item ,(purecopy "Emacs News") view-emacs-news - :help ,(purecopy "New features of this version"))) - (define-key menu [emacs-faq] - `(menu-item ,(purecopy "Emacs FAQ") view-emacs-FAQ - :help ,(purecopy "Frequently asked (and answered) questions about Emacs"))) + (bindings--define-key menu [about-gnu-project] + '(menu-item "About GNU" describe-gnu-project + :help "About the GNU System, GNU Project, and GNU/Linux")) + (bindings--define-key menu [about-emacs] + '(menu-item "About Emacs" about-emacs + :help "Display version number, copyright info, and basic help")) + (bindings--define-key menu [sep4] + menu-bar-separator) + (bindings--define-key menu [describe-no-warranty] + '(menu-item "(Non)Warranty" describe-no-warranty + :help "Explain that Emacs has NO WARRANTY")) + (bindings--define-key menu [describe-copying] + '(menu-item "Copying Conditions" describe-copying + :help "Show the Emacs license (GPL)")) + (bindings--define-key menu [getting-new-versions] + '(menu-item "Getting New Versions" describe-distribution + :help "How to get the latest version of Emacs")) + (bindings--define-key menu [sep2] + menu-bar-separator) + (bindings--define-key menu [external-packages] + '(menu-item "Finding Extra Packages" menu-bar-help-extra-packages + :help "Lisp packages distributed separately for use in Emacs")) + (bindings--define-key menu [find-emacs-packages] + '(menu-item "Search Built-in Packages" finder-by-keyword + :help "Find built-in packages and features by keyword")) + (bindings--define-key menu [more-manuals] + `(menu-item "More Manuals" ,menu-bar-manuals-menu)) + (bindings--define-key menu [emacs-manual] + '(menu-item "Read the Emacs Manual" info-emacs-manual + :help "Full documentation of Emacs features")) + (bindings--define-key menu [describe] + `(menu-item "Describe" ,menu-bar-describe-menu)) + (bindings--define-key menu [search-documentation] + `(menu-item "Search Documentation" ,menu-bar-search-documentation-menu)) + (bindings--define-key menu [sep1] + menu-bar-separator) + (bindings--define-key menu [emacs-psychotherapist] + '(menu-item "Emacs Psychotherapist" doctor + :help "Our doctor will help you feel better")) + (bindings--define-key menu [send-emacs-bug-report] + '(menu-item "Send Bug Report..." report-emacs-bug + :help "Send e-mail to Emacs maintainers")) + (bindings--define-key menu [emacs-manual-bug] + '(menu-item "How to Report a Bug" info-emacs-bug + :help "Read about how to report an Emacs bug")) + (bindings--define-key menu [emacs-known-problems] + '(menu-item "Emacs Known Problems" view-emacs-problems + :help "Read about known problems with Emacs")) + (bindings--define-key menu [emacs-news] + '(menu-item "Emacs News" view-emacs-news + :help "New features of this version")) + (bindings--define-key menu [emacs-faq] + '(menu-item "Emacs FAQ" view-emacs-FAQ + :help "Frequently asked (and answered) questions about Emacs")) - (define-key menu [emacs-tutorial-language-specific] - `(menu-item ,(purecopy "Emacs Tutorial (choose language)...") + (bindings--define-key menu [emacs-tutorial-language-specific] + '(menu-item "Emacs Tutorial (choose language)..." help-with-tutorial-spec-language - :help ,(purecopy "Learn how to use Emacs (choose a language)"))) - (define-key menu [emacs-tutorial] - `(menu-item ,(purecopy "Emacs Tutorial") help-with-tutorial - :help ,(purecopy "Learn how to use Emacs"))) + :help "Learn how to use Emacs (choose a language)")) + (bindings--define-key menu [emacs-tutorial] + '(menu-item "Emacs Tutorial" help-with-tutorial + :help "Learn how to use Emacs")) ;; In OS X it's in the app menu already. ;; FIXME? There already is an "About Emacs" (sans ...) entry in the Help menu. (and (featurep 'ns) (not (eq system-type 'darwin)) - (define-key menu [info-panel] - `(menu-item ,(purecopy "About Emacs...") ns-do-emacs-info-panel))) + (bindings--define-key menu [info-panel] + '(menu-item "About Emacs..." ns-do-emacs-info-panel))) menu)) -(define-key global-map [menu-bar tools] - (cons (purecopy "Tools") menu-bar-tools-menu)) -(define-key global-map [menu-bar buffer] - (cons (purecopy "Buffers") global-buffers-menu-map)) -(define-key global-map [menu-bar options] - (cons (purecopy "Options") menu-bar-options-menu)) -(define-key global-map [menu-bar edit] - (cons (purecopy "Edit") menu-bar-edit-menu)) -(define-key global-map [menu-bar file] - (cons (purecopy "File") menu-bar-file-menu)) +(bindings--define-key global-map [menu-bar tools] + (cons "Tools" menu-bar-tools-menu)) +(bindings--define-key global-map [menu-bar buffer] + (cons "Buffers" global-buffers-menu-map)) +(bindings--define-key global-map [menu-bar options] + (cons "Options" menu-bar-options-menu)) +(bindings--define-key global-map [menu-bar edit] + (cons "Edit" menu-bar-edit-menu)) +(bindings--define-key global-map [menu-bar file] + (cons "File" menu-bar-file-menu)) ;; Put "Help" menu at the end, or Info at the front. ;; If running under GNUstep, "Help" is moved and renamed "Info" (see below). (if (and (featurep 'ns) (not (eq system-type 'darwin))) - (define-key global-map [menu-bar help-menu] - (cons (purecopy "Info") menu-bar-help-menu)) + (bindings--define-key global-map [menu-bar help-menu] + (cons "Info" menu-bar-help-menu)) (define-key-after global-map [menu-bar help-menu] (cons (purecopy "Help") menu-bar-help-menu))) @@ -2118,40 +2110,40 @@ ;; This shouldn't be necessary, but there's a funny ;; bug in keymap.c that I don't understand yet. -stef minibuffer-local-completion-map)) - (define-key map [menu-bar minibuf] - (cons (purecopy "Minibuf") (make-sparse-keymap "Minibuf")))) + (bindings--define-key map [menu-bar minibuf] + (cons "Minibuf" (make-sparse-keymap "Minibuf")))) (let ((map minibuffer-local-completion-map)) - (define-key map [menu-bar minibuf ?\?] - `(menu-item ,(purecopy "List Completions") minibuffer-completion-help - :help ,(purecopy "Display all possible completions"))) - (define-key map [menu-bar minibuf space] - `(menu-item ,(purecopy "Complete Word") minibuffer-complete-word - :help ,(purecopy "Complete at most one word"))) - (define-key map [menu-bar minibuf tab] - `(menu-item ,(purecopy "Complete") minibuffer-complete - :help ,(purecopy "Complete as far as possible")))) + (bindings--define-key map [menu-bar minibuf ?\?] + '(menu-item "List Completions" minibuffer-completion-help + :help "Display all possible completions")) + (bindings--define-key map [menu-bar minibuf space] + '(menu-item "Complete Word" minibuffer-complete-word + :help "Complete at most one word")) + (bindings--define-key map [menu-bar minibuf tab] + '(menu-item "Complete" minibuffer-complete + :help "Complete as far as possible"))) (let ((map minibuffer-local-map)) - (define-key map [menu-bar minibuf quit] - `(menu-item ,(purecopy "Quit") abort-recursive-edit - :help ,(purecopy "Abort input and exit minibuffer"))) - (define-key map [menu-bar minibuf return] - `(menu-item ,(purecopy "Enter") exit-minibuffer - :key-sequence ,(purecopy "\r") - :help ,(purecopy "Terminate input and exit minibuffer"))) - (define-key map [menu-bar minibuf isearch-forward] - `(menu-item ,(purecopy "Isearch History Forward") isearch-forward - :help ,(purecopy "Incrementally search minibuffer history forward"))) - (define-key map [menu-bar minibuf isearch-backward] - `(menu-item ,(purecopy "Isearch History Backward") isearch-backward - :help ,(purecopy "Incrementally search minibuffer history backward"))) - (define-key map [menu-bar minibuf next] - `(menu-item ,(purecopy "Next History Item") next-history-element - :help ,(purecopy "Put next minibuffer history element in the minibuffer"))) - (define-key map [menu-bar minibuf previous] - `(menu-item ,(purecopy "Previous History Item") previous-history-element - :help ,(purecopy "Put previous minibuffer history element in the minibuffer")))) + (bindings--define-key map [menu-bar minibuf quit] + '(menu-item "Quit" abort-recursive-edit + :help "Abort input and exit minibuffer")) + (bindings--define-key map [menu-bar minibuf return] + '(menu-item "Enter" exit-minibuffer + :key-sequence "\r" + :help "Terminate input and exit minibuffer")) + (bindings--define-key map [menu-bar minibuf isearch-forward] + '(menu-item "Isearch History Forward" isearch-forward + :help "Incrementally search minibuffer history forward")) + (bindings--define-key map [menu-bar minibuf isearch-backward] + '(menu-item "Isearch History Backward" isearch-backward + :help "Incrementally search minibuffer history backward")) + (bindings--define-key map [menu-bar minibuf next] + '(menu-item "Next History Item" next-history-element + :help "Put next minibuffer history element in the minibuffer")) + (bindings--define-key map [menu-bar minibuf previous] + '(menu-item "Previous History Item" previous-history-element + :help "Put previous minibuffer history element in the minibuffer"))) (define-minor-mode menu-bar-mode "Toggle display of a menu bar on each frame (Menu Bar mode). === modified file 'lisp/replace.el' --- lisp/replace.el 2012-03-28 19:30:12 +0000 +++ lisp/replace.el 2012-06-27 21:15:13 +0000 @@ -763,48 +763,47 @@ (defvar occur-menu-map (let ((map (make-sparse-keymap))) - (define-key map [next-error-follow-minor-mode] - `(menu-item ,(purecopy "Auto Occurrence Display") + (bindings--define-key map [next-error-follow-minor-mode] + '(menu-item "Auto Occurrence Display" next-error-follow-minor-mode - :help ,(purecopy - "Display another occurrence when moving the cursor") + :help "Display another occurrence when moving the cursor" :button (:toggle . (and (boundp 'next-error-follow-minor-mode) next-error-follow-minor-mode)))) - (define-key map [separator-1] menu-bar-separator) - (define-key map [kill-this-buffer] - `(menu-item ,(purecopy "Kill Occur Buffer") kill-this-buffer - :help ,(purecopy "Kill the current *Occur* buffer"))) - (define-key map [quit-window] - `(menu-item ,(purecopy "Quit Occur Window") quit-window - :help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))) - (define-key map [revert-buffer] - `(menu-item ,(purecopy "Revert Occur Buffer") revert-buffer - :help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur"))) - (define-key map [clone-buffer] - `(menu-item ,(purecopy "Clone Occur Buffer") clone-buffer - :help ,(purecopy "Create and return a twin copy of the current *Occur* buffer"))) - (define-key map [occur-rename-buffer] - `(menu-item ,(purecopy "Rename Occur Buffer") occur-rename-buffer - :help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))) - (define-key map [occur-edit-buffer] - `(menu-item ,(purecopy "Edit Occur Buffer") occur-edit-mode - :help ,(purecopy "Edit the *Occur* buffer and apply changes to the original buffers."))) - (define-key map [separator-2] menu-bar-separator) - (define-key map [occur-mode-goto-occurrence-other-window] - `(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window - :help ,(purecopy "Go to the occurrence the current line describes, in another window"))) - (define-key map [occur-mode-goto-occurrence] - `(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence - :help ,(purecopy "Go to the occurrence the current line describes"))) - (define-key map [occur-mode-display-occurrence] - `(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence - :help ,(purecopy "Display in another window the occurrence the current line describes"))) - (define-key map [occur-next] - `(menu-item ,(purecopy "Move to Next Match") occur-next - :help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer"))) - (define-key map [occur-prev] - `(menu-item ,(purecopy "Move to Previous Match") occur-prev - :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer"))) + (bindings--define-key map [separator-1] menu-bar-separator) + (bindings--define-key map [kill-this-buffer] + '(menu-item "Kill Occur Buffer" kill-this-buffer + :help "Kill the current *Occur* buffer")) + (bindings--define-key map [quit-window] + '(menu-item "Quit Occur Window" quit-window + :help "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame")) + (bindings--define-key map [revert-buffer] + '(menu-item "Revert Occur Buffer" revert-buffer + :help "Replace the text in the *Occur* buffer with the results of rerunning occur")) + (bindings--define-key map [clone-buffer] + '(menu-item "Clone Occur Buffer" clone-buffer + :help "Create and return a twin copy of the current *Occur* buffer")) + (bindings--define-key map [occur-rename-buffer] + '(menu-item "Rename Occur Buffer" occur-rename-buffer + :help "Rename the current *Occur* buffer to *Occur: original-buffer-name*.")) + (bindings--define-key map [occur-edit-buffer] + '(menu-item "Edit Occur Buffer" occur-edit-mode + :help "Edit the *Occur* buffer and apply changes to the original buffers.")) + (bindings--define-key map [separator-2] menu-bar-separator) + (bindings--define-key map [occur-mode-goto-occurrence-other-window] + '(menu-item "Go To Occurrence Other Window" occur-mode-goto-occurrence-other-window + :help "Go to the occurrence the current line describes, in another window")) + (bindings--define-key map [occur-mode-goto-occurrence] + '(menu-item "Go To Occurrence" occur-mode-goto-occurrence + :help "Go to the occurrence the current line describes")) + (bindings--define-key map [occur-mode-display-occurrence] + '(menu-item "Display Occurrence" occur-mode-display-occurrence + :help "Display in another window the occurrence the current line describes")) + (bindings--define-key map [occur-next] + '(menu-item "Move to Next Match" occur-next + :help "Move to the Nth (default 1) next match in an Occur mode buffer")) + (bindings--define-key map [occur-prev] + '(menu-item "Move to Previous Match" occur-prev + :help "Move to the Nth (default 1) previous match in an Occur mode buffer")) map) "Menu keymap for `occur-mode'.") @@ -822,7 +821,7 @@ (define-key map "r" 'occur-rename-buffer) (define-key map "c" 'clone-buffer) (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) - (define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) + (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map)) map) "Keymap for `occur-mode'.") @@ -870,7 +869,7 @@ (define-key map "\C-c\C-c" 'occur-cease-edit) (define-key map "\C-o" 'occur-mode-display-occurrence) (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) - (define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) + (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map)) map) "Keymap for `occur-edit-mode'.") === modified file 'lisp/vc/vc-hooks.el' --- lisp/vc/vc-hooks.el 2012-06-02 10:56:09 +0000 +++ lisp/vc/vc-hooks.el 2012-06-27 21:15:13 +0000 @@ -947,66 +947,66 @@ (let ((map (make-sparse-keymap "Version Control"))) ;;(define-key map [show-files] ;; '("Show Files under VC" . (vc-directory t))) - (define-key map [vc-retrieve-tag] - `(menu-item ,(purecopy "Retrieve Tag") vc-retrieve-tag - :help ,(purecopy "Retrieve tagged version or branch"))) - (define-key map [vc-create-tag] - `(menu-item ,(purecopy "Create Tag") vc-create-tag - :help ,(purecopy "Create version tag"))) - (define-key map [separator1] menu-bar-separator) - (define-key map [vc-annotate] - `(menu-item ,(purecopy "Annotate") vc-annotate - :help ,(purecopy "Display the edit history of the current file using colors"))) - (define-key map [vc-rename-file] - `(menu-item ,(purecopy "Rename File") vc-rename-file - :help ,(purecopy "Rename file"))) - (define-key map [vc-revision-other-window] - `(menu-item ,(purecopy "Show Other Version") vc-revision-other-window - :help ,(purecopy "Visit another version of the current file in another window"))) - (define-key map [vc-diff] - `(menu-item ,(purecopy "Compare with Base Version") vc-diff - :help ,(purecopy "Compare file set with the base version"))) - (define-key map [vc-root-diff] - `(menu-item ,(purecopy "Compare Tree with Base Version") vc-root-diff - :help ,(purecopy "Compare current tree with the base version"))) - (define-key map [vc-update-change-log] - `(menu-item ,(purecopy "Update ChangeLog") vc-update-change-log - :help ,(purecopy "Find change log file and add entries from recent version control logs"))) - (define-key map [vc-log-out] - `(menu-item ,(purecopy "Show Outgoing Log") vc-log-outgoing - :help ,(purecopy "Show a log of changes that will be sent with a push operation"))) - (define-key map [vc-log-in] - `(menu-item ,(purecopy "Show Incoming Log") vc-log-incoming - :help ,(purecopy "Show a log of changes that will be received with a pull operation"))) - (define-key map [vc-print-log] - `(menu-item ,(purecopy "Show History") vc-print-log - :help ,(purecopy "List the change log of the current file set in a window"))) - (define-key map [vc-print-root-log] - `(menu-item ,(purecopy "Show Top of the Tree History ") vc-print-root-log - :help ,(purecopy "List the change log for the current tree in a window"))) - (define-key map [separator2] menu-bar-separator) - (define-key map [vc-insert-header] - `(menu-item ,(purecopy "Insert Header") vc-insert-headers - :help ,(purecopy "Insert headers into a file for use with a version control system. -"))) - (define-key map [undo] - `(menu-item ,(purecopy "Undo Last Check-In") vc-rollback - :help ,(purecopy "Remove the most recent changeset committed to the repository"))) - (define-key map [vc-revert] - `(menu-item ,(purecopy "Revert to Base Version") vc-revert - :help ,(purecopy "Revert working copies of the selected file set to their repository contents"))) - (define-key map [vc-update] - `(menu-item ,(purecopy "Update to Latest Version") vc-update - :help ,(purecopy "Update the current fileset's files to their tip revisions"))) - (define-key map [vc-next-action] - `(menu-item ,(purecopy "Check In/Out") vc-next-action - :help ,(purecopy "Do the next logical version control operation on the current fileset"))) - (define-key map [vc-register] - `(menu-item ,(purecopy "Register") vc-register - :help ,(purecopy "Register file set into a version control system"))) - (define-key map [vc-dir] - `(menu-item ,(purecopy "VC Dir") vc-dir - :help ,(purecopy "Show the VC status of files in a directory"))) + (bindings--define-key map [vc-retrieve-tag] + '(menu-item "Retrieve Tag" vc-retrieve-tag + :help "Retrieve tagged version or branch")) + (bindings--define-key map [vc-create-tag] + '(menu-item "Create Tag" vc-create-tag + :help "Create version tag")) + (bindings--define-key map [separator1] menu-bar-separator) + (bindings--define-key map [vc-annotate] + '(menu-item "Annotate" vc-annotate + :help "Display the edit history of the current file using colors")) + (bindings--define-key map [vc-rename-file] + '(menu-item "Rename File" vc-rename-file + :help "Rename file")) + (bindings--define-key map [vc-revision-other-window] + '(menu-item "Show Other Version" vc-revision-other-window + :help "Visit another version of the current file in another window")) + (bindings--define-key map [vc-diff] + '(menu-item "Compare with Base Version" vc-diff + :help "Compare file set with the base version")) + (bindings--define-key map [vc-root-diff] + '(menu-item "Compare Tree with Base Version" vc-root-diff + :help "Compare current tree with the base version")) + (bindings--define-key map [vc-update-change-log] + '(menu-item "Update ChangeLog" vc-update-change-log + :help "Find change log file and add entries from recent version control logs")) + (bindings--define-key map [vc-log-out] + '(menu-item "Show Outgoing Log" vc-log-outgoing + :help "Show a log of changes that will be sent with a push operation")) + (bindings--define-key map [vc-log-in] + '(menu-item "Show Incoming Log" vc-log-incoming + :help "Show a log of changes that will be received with a pull operation")) + (bindings--define-key map [vc-print-log] + '(menu-item "Show History" vc-print-log + :help "List the change log of the current file set in a window")) + (bindings--define-key map [vc-print-root-log] + '(menu-item "Show Top of the Tree History " vc-print-root-log + :help "List the change log for the current tree in a window")) + (bindings--define-key map [separator2] menu-bar-separator) + (bindings--define-key map [vc-insert-header] + '(menu-item "Insert Header" vc-insert-headers + :help "Insert headers into a file for use with a version control system. +")) + (bindings--define-key map [undo] + '(menu-item "Undo Last Check-In" vc-rollback + :help "Remove the most recent changeset committed to the repository")) + (bindings--define-key map [vc-revert] + '(menu-item "Revert to Base Version" vc-revert + :help "Revert working copies of the selected file set to their repository contents")) + (bindings--define-key map [vc-update] + '(menu-item "Update to Latest Version" vc-update + :help "Update the current fileset's files to their tip revisions")) + (bindings--define-key map [vc-next-action] + '(menu-item "Check In/Out" vc-next-action + :help "Do the next logical version control operation on the current fileset")) + (bindings--define-key map [vc-register] + '(menu-item "Register" vc-register + :help "Register file set into a version control system")) + (bindings--define-key map [vc-dir] + '(menu-item "VC Dir" vc-dir + :help "Show the VC status of files in a directory")) map)) (defalias 'vc-menu-map vc-menu-map) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 15:46:48 +0000 +++ src/ChangeLog 2012-06-27 21:15:13 +0000 @@ -1,3 +1,8 @@ +2012-06-27 Stefan Monnier + + * fns.c (maybe_resize_hash_table): Output message when growing the + purify-hashtable. + 2012-06-27 Dmitry Antipov * alloc.c (allocate_string_data): Remove dead code. @@ -29,7 +34,7 @@ 2012-06-26 John Wiegley - * unexmacosx.c (copy_data_segment): Added two section names used + * unexmacosx.c (copy_data_segment): Add two section names used on Mac OS X Lion: __mod_init_func and __mod_term_func. * alloc.c (mark_memory): Do not check with -faddress-sanitizer === modified file 'src/data.c' --- src/data.c 2012-06-26 02:33:51 +0000 +++ src/data.c 2012-06-27 21:15:13 +0000 @@ -517,7 +517,7 @@ return newcdr; } -/* Extract and set components of symbols */ +/* Extract and set components of symbols. */ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, doc: /* Return t if SYMBOL's value is not void. */) === modified file 'src/fns.c' --- src/fns.c 2012-06-22 21:17:42 +0000 +++ src/fns.c 2012-06-27 21:15:13 +0000 @@ -3749,6 +3749,17 @@ if (INDEX_SIZE_BOUND < nsize) error ("Hash table too large to resize"); +#ifdef ENABLE_CHECKING + if (HASH_TABLE_P (Vpurify_flag) + && XHASH_TABLE (Vpurify_flag) == h) + { + Lisp_Object args[2]; + args[0] = build_string ("Growing hash table to: %d"); + args[1] = make_number (new_size); + Fmessage (2, args); + } +#endif + h->key_and_value = larger_vector (h->key_and_value, 2 * (new_size - old_size), -1); h->next = larger_vector (h->next, new_size - old_size, -1); === modified file 'src/puresize.h' --- src/puresize.h 2012-06-24 17:39:14 +0000 +++ src/puresize.h 2012-06-27 21:15:13 +0000 @@ -47,9 +47,9 @@ #ifndef PURESIZE_RATIO #if EMACS_INT_MAX >> 31 != 0 #if PTRDIFF_MAX >> 31 != 0 -#define PURESIZE_RATIO 10/6 /* Don't surround with `()'. */ +#define PURESIZE_RATIO 10 / 6 /* Don't surround with `()'. */ #else -#define PURESIZE_RATIO 8/6 /* Don't surround with `()'. */ +#define PURESIZE_RATIO 8 / 6 /* Don't surround with `()'. */ #endif #else #define PURESIZE_RATIO 1 @@ -60,7 +60,7 @@ /* ENABLE_CHECKING somehow increases the purespace used, probably because it tends to cause some macro arguments to be evaluated twice. This is a bug, but it's difficult to track it down. */ -#define PURESIZE_CHECKING_RATIO 12/10 /* Don't surround with `()'. */ +#define PURESIZE_CHECKING_RATIO 12 / 10 /* Don't surround with `()'. */ #else #define PURESIZE_CHECKING_RATIO 1 #endif ------------------------------------------------------------ revno: 108773 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 14:36:25 -0400 message: * lisp/textmodes/rst.el (rst-adornment-faces-alist): Avoid copy-list. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 15:11:28 +0000 +++ lisp/ChangeLog 2012-06-27 18:36:25 +0000 @@ -1,5 +1,7 @@ 2012-06-27 Stefan Monnier + * textmodes/rst.el (rst-adornment-faces-alist): Avoid copy-list. + * emacs-lisp/cl.el (flet): Mark obsolete. * emacs-lisp/cl-macs.el (cl-flet*): New macro. * vc/vc-rcs.el (vc-rcs-annotate-command, vc-rcs-parse): === modified file 'lisp/textmodes/rst.el' --- lisp/textmodes/rst.el 2012-06-17 08:53:31 +0000 +++ lisp/textmodes/rst.el 2012-06-27 18:36:25 +0000 @@ -3416,10 +3416,11 @@ (defcustom rst-adornment-faces-alist ;; FIXME LEVEL-FACE: Must be redone if `rst-level-face-max' is changed - (let ((alist (copy-list '((t . rst-transition) - (nil . rst-adornment)))) + (let ((alist (copy-sequence '((t . rst-transition) + (nil . rst-adornment)))) (i 1)) (while (<= i rst-level-face-max) + ;; FIXME: why not `push'? (nconc alist (list (cons i (intern (format "rst-level-%d-face" i))))) (setq i (1+ i))) alist) ------------------------------------------------------------ revno: 108772 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-06-27 19:46:48 +0400 message: * alloc.c (allocate_string_data): Remove dead code. * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to avoid GCC warning about unused macro. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 14:35:51 +0000 +++ src/ChangeLog 2012-06-27 15:46:48 +0000 @@ -1,5 +1,11 @@ 2012-06-27 Dmitry Antipov + * alloc.c (allocate_string_data): Remove dead code. + * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to + avoid GCC warning about unused macro. + +2012-06-27 Dmitry Antipov + * alloc.c (allocate_string): Omit intervals initialization. * alloc.c (make_uninit_multibyte_string): Initialize intervals as in make_pure_string and make_pure_c_string. === modified file 'src/alloc.c' --- src/alloc.c 2012-06-27 14:35:51 +0000 +++ src/alloc.c 2012-06-27 15:46:48 +0000 @@ -1991,9 +1991,9 @@ allocate_string_data (struct Lisp_String *s, EMACS_INT nchars, EMACS_INT nbytes) { - struct sdata *data, *old_data; + struct sdata *data; struct sblock *b; - ptrdiff_t needed, old_nbytes; + ptrdiff_t needed; if (STRING_BYTES_MAX < nbytes) string_overflow (); @@ -2001,8 +2001,6 @@ /* Determine the number of bytes needed to store NBYTES bytes of string data. */ needed = SDATA_SIZE (nbytes); - old_data = s->data ? SDATA_OF_STRING (s) : NULL; - old_nbytes = GC_STRING_BYTES (s); MALLOC_BLOCK_INPUT; @@ -2072,16 +2070,6 @@ memcpy ((char *) data + needed, string_overrun_cookie, GC_STRING_OVERRUN_COOKIE_SIZE); #endif - - /* If S had already data assigned, mark that as free by setting its - string back-pointer to null, and recording the size of the data - in it. */ - if (old_data) - { - SDATA_NBYTES (old_data) = old_nbytes; - old_data->string = NULL; - } - consing_since_gc += needed; } === modified file 'src/xsettings.c' --- src/xsettings.c 2012-04-09 13:05:48 +0000 +++ src/xsettings.c 2012-06-27 15:46:48 +0000 @@ -159,8 +159,9 @@ XCAR (dpyinfo->name_list_element)); } - +#ifdef HAVE_XFT #define XSETTINGS_FONT_NAME "Gtk/FontName" +#endif #define XSETTINGS_TOOL_BAR_STYLE "Gtk/ToolbarStyle" enum { ------------------------------------------------------------ revno: 108771 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11780 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 11:11:28 -0400 message: * lisp/emacs-lisp/cl.el (flet): Mark obsolete. * lisp/emacs-lisp/cl-macs.el (cl-flet*): New macro. * lisp/vc/vc-rcs.el (vc-rcs-annotate-command, vc-rcs-parse): * lisp/progmodes/js.el (js-c-fill-paragraph): * lisp/progmodes/ebrowse.el (ebrowse-switch-member-buffer-to-sibling-class) (ebrowse-switch-member-buffer-to-derived-class): * test/automated/ert-x-tests.el (ert-test-run-tests-interactively-2): * lisp/play/5x5.el (5x5-solver): Use cl-flet. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 14:39:30 +0000 +++ lisp/ChangeLog 2012-06-27 15:11:28 +0000 @@ -1,5 +1,13 @@ 2012-06-27 Stefan Monnier + * emacs-lisp/cl.el (flet): Mark obsolete. + * emacs-lisp/cl-macs.el (cl-flet*): New macro. + * vc/vc-rcs.el (vc-rcs-annotate-command, vc-rcs-parse): + * progmodes/js.el (js-c-fill-paragraph): + * progmodes/ebrowse.el (ebrowse-switch-member-buffer-to-sibling-class) + (ebrowse-switch-member-buffer-to-derived-class): + * play/5x5.el (5x5-solver): Use cl-flet. + * emacs-lisp/cl.el: Use lexical-binding. Fix flet (bug#11780). (cl--symbol-function): New macro. (cl--letf, cl--letf*): Use it. === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-06-23 04:24:06 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-06-27 15:11:28 +0000 @@ -260,12 +260,12 @@ ;;;;;; cl-deftype cl-defstruct cl-callf2 cl-callf cl-rotatef cl-shiftf ;;;;;; cl-remf cl-psetf cl-declare cl-the cl-locally cl-multiple-value-setq ;;;;;; cl-multiple-value-bind cl-symbol-macrolet cl-macrolet cl-labels -;;;;;; cl-flet cl-progv cl-psetq cl-do-all-symbols cl-do-symbols +;;;;;; cl-flet* cl-flet cl-progv cl-psetq cl-do-all-symbols cl-do-symbols ;;;;;; cl-dotimes cl-dolist cl-do* cl-do cl-loop cl-return-from ;;;;;; cl-return cl-block cl-etypecase cl-typecase cl-ecase cl-case ;;;;;; cl-load-time-value cl-eval-when cl-destructuring-bind cl-function ;;;;;; cl-defmacro cl-defun cl-gentemp cl-gensym) "cl-macs" "cl-macs.el" -;;;;;; "41a15289eda7e6ae03ac9edd86bbb1a6") +;;;;;; "e7bb76130254614df1603a1c1e89cb49") ;;; Generated autoloads from cl-macs.el (autoload 'cl-gensym "cl-macs" "\ @@ -492,6 +492,14 @@ (put 'cl-flet 'lisp-indent-function '1) +(autoload 'cl-flet* "cl-macs" "\ +Make temporary function definitions. +Like `cl-flet' but the definitions can refer to previous ones. + +\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) + +(put 'cl-flet* 'lisp-indent-function '1) + (autoload 'cl-labels "cl-macs" "\ Make temporary function bindings. The bindings can be recursive. Assumes the use of `lexical-binding'. === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2012-06-23 04:24:06 +0000 +++ lisp/emacs-lisp/cl-macs.el 2012-06-27 15:11:28 +0000 @@ -1570,7 +1570,6 @@ (setq cl--labels-convert-cache (cons f res)) res)))))) -;;; This should really have some way to shadow 'byte-compile properties, etc. ;;;###autoload (defmacro cl-flet (bindings &rest body) "Make temporary function definitions. @@ -1596,6 +1595,18 @@ (cons (cons 'function #'cl--labels-convert) newenv))))))) ;;;###autoload +(defmacro cl-flet* (bindings &rest body) + "Make temporary function definitions. +Like `cl-flet' but the definitions can refer to previous ones. + +\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" + (declare (indent 1) (debug ((&rest (cl-defun)) cl-declarations body))) + (cond + ((null bindings) (macroexp-progn body)) + ((null (cdr bindings)) `(cl-flet ,bindings ,@body)) + (t `(cl-flet (,(pop bindings)) (cl-flet* ,bindings ,@body))))) + +;;;###autoload (defmacro cl-labels (bindings &rest body) "Make temporary function bindings. The bindings can be recursive. Assumes the use of `lexical-binding'. @@ -2257,6 +2268,7 @@ ;;;###autoload (defmacro cl-assert (form &optional show-args string &rest args) + ;; FIXME: This is actually not compatible with Common-Lisp's `assert'. "Verify that FORM returns non-nil; signal an error if not. Second arg SHOW-ARGS means to include arguments of FORM in message. Other args STRING and ARGS... are arguments to be passed to `error'. === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2012-06-27 14:39:30 +0000 +++ lisp/emacs-lisp/cl.el 2012-06-27 15:11:28 +0000 @@ -461,11 +461,13 @@ ;; This should really have some way to shadow 'byte-compile properties, etc. (defmacro flet (bindings &rest body) - "Make temporary function definitions. -This is an analogue of `let' that operates on the function cell of FUNC -rather than its value cell. The FORMs are evaluated with the specified -function definitions in place, then the definitions are undone (the FUNCs -go back to their previous definitions, or lack thereof). + "Make temporary overriding function definitions. +This is an analogue of a dynamically scoped `let' that operates on the function +cell of FUNCs rather than their value cell. +If you want the Common-Lisp style of `flet', you should use `cl-flet'. +The FORMs are evaluated with the specified function definitions in place, +then the definitions are undone (the FUNCs go back to their previous +definitions, or lack thereof). \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" (declare (indent 1) (debug cl-flet)) @@ -491,6 +493,7 @@ (list `(symbol-function ',(car x)) func))) bindings) ,@body)) +(make-obsolete 'flet "Use either `cl-flet' or `letf'." "24.2") (defmacro labels (bindings &rest body) "Make temporary function bindings. === modified file 'lisp/play/5x5.el' --- lisp/play/5x5.el 2012-01-19 07:21:25 +0000 +++ lisp/play/5x5.el 2012-06-27 15:11:28 +0000 @@ -568,14 +568,14 @@ Solutions are sorted from least to greatest Hamming weight." (require 'calc-ext) - (flet ((5x5-mat-mode-2 - (a) - (math-map-vec - (lambda (y) - (math-map-vec - (lambda (x) `(mod ,x 2)) - y)) - a))) + (cl-flet ((5x5-mat-mode-2 + (a) + (math-map-vec + (lambda (y) + (math-map-vec + (lambda (x) `(mod ,x 2)) + y)) + a))) (let* (calc-command-flags (grid-size-squared (* 5x5-grid-size 5x5-grid-size)) @@ -658,8 +658,8 @@ (cdr (5x5-mat-mode-2 '(vec (vec 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0) - (vec 1 1 0 1 1 0 0 0 0 0 1 1 0 1 - 1 0 0 0 0 0 1 1 0 1 1))))) + (vec 1 1 0 1 1 0 0 0 0 0 1 1 0 1 + 1 0 0 0 0 0 1 1 0 1 1))))) (calcFunc-trn id)))) (inv-base-change === modified file 'lisp/progmodes/ebrowse.el' --- lisp/progmodes/ebrowse.el 2012-06-08 16:39:49 +0000 +++ lisp/progmodes/ebrowse.el 2012-06-27 15:11:28 +0000 @@ -2957,10 +2957,10 @@ (let ((containing-list ebrowse--tree) index cls (supers (ebrowse-direct-base-classes ebrowse--displayed-class))) - (flet ((trees-alist (trees) - (loop for tr in trees - collect (cons (ebrowse-cs-name - (ebrowse-ts-class tr)) tr)))) + (cl-flet ((trees-alist (trees) + (loop for tr in trees + collect (cons (ebrowse-cs-name + (ebrowse-ts-class tr)) tr)))) (when supers (let ((tree (if (second supers) (ebrowse-completing-read-value @@ -2985,11 +2985,11 @@ Prefix arg ARG says which class should be displayed. Default is the first derived class." (interactive "P") - (flet ((ebrowse-tree-obarray-as-alist () - (loop for s in (ebrowse-ts-subclasses - ebrowse--displayed-class) - collect (cons (ebrowse-cs-name - (ebrowse-ts-class s)) s)))) + (cl-flet ((ebrowse-tree-obarray-as-alist () + (loop for s in (ebrowse-ts-subclasses + ebrowse--displayed-class) + collect (cons (ebrowse-cs-name + (ebrowse-ts-class s)) s)))) (let ((subs (or (ebrowse-ts-subclasses ebrowse--displayed-class) (error "No derived classes")))) (if (and arg (second subs)) === modified file 'lisp/progmodes/js.el' --- lisp/progmodes/js.el 2012-05-25 15:03:22 +0000 +++ lisp/progmodes/js.el 2012-06-27 15:11:28 +0000 @@ -1821,15 +1821,15 @@ (defun js-c-fill-paragraph (&optional justify) "Fill the paragraph with `c-fill-paragraph'." (interactive "*P") - (flet ((c-forward-sws - (&optional limit) - (js--forward-syntactic-ws limit)) - (c-backward-sws - (&optional limit) - (js--backward-syntactic-ws limit)) - (c-beginning-of-macro - (&optional limit) - (js--beginning-of-macro limit))) + (letf (((symbol-function 'c-forward-sws) + (lambda (&optional limit) + (js--forward-syntactic-ws limit))) + ((symbol-function 'c-backward-sws) + (lambda (&optional limit) + (js--backward-syntactic-ws limit))) + ((symbol-function 'c-beginning-of-macro) + (lambda (&optional limit) + (js--beginning-of-macro limit)))) (let ((fill-paragraph-function 'c-fill-paragraph)) (c-fill-paragraph justify)))) === modified file 'lisp/ses.el' --- lisp/ses.el 2012-06-02 10:56:09 +0000 +++ lisp/ses.el 2012-06-27 15:11:28 +0000 @@ -3380,21 +3380,23 @@ (setq iter (cdr iter)))) (setq result ret))) - (flet ((vectorize-*1 - (clean result) - (cons clean (cons (quote 'vec) (apply 'append result)))) - (vectorize-*2 - (clean result) - (cons clean (cons (quote 'vec) (mapcar (lambda (x) - (cons clean (cons (quote 'vec) x))) - result))))) + (cl-flet ((vectorize-*1 + (clean result) + (cons clean (cons (quote 'vec) (apply 'append result)))) + (vectorize-*2 + (clean result) + (cons clean (cons (quote 'vec) + (mapcar (lambda (x) + (cons clean (cons (quote 'vec) x))) + result))))) (case vectorize ((nil) (cons clean (apply 'append result))) ((*1) (vectorize-*1 clean result)) ((*2) (vectorize-*2 clean result)) - ((*) (if (cdr result) - (vectorize-*2 clean result) - (vectorize-*1 clean result))))))) + ((*) (funcall (if (cdr result) + #'vectorize-*2 + #'vectorize-*1) + clean result)))))) (defun ses-delete-blanks (&rest args) "Return ARGS reversed, with the blank elements (nil and *skip*) removed." === modified file 'lisp/vc/vc-rcs.el' --- lisp/vc/vc-rcs.el 2012-06-06 01:28:08 +0000 +++ lisp/vc/vc-rcs.el 2012-06-27 15:11:28 +0000 @@ -679,9 +679,9 @@ ;; Apply reverse-chronological edits on the trunk, computing and ;; accumulating forward-chronological edits after some point, for ;; later. - (flet ((r/d/a () (vector pre - (cdr (assq 'date meta)) - (cdr (assq 'author meta))))) + (cl-flet ((r/d/a () (vector pre + (cdr (assq 'date meta)) + (cdr (assq 'author meta))))) (while (when (setq pre cur cur (cdr (assq 'next meta))) (not (string= "" cur))) (setq @@ -769,16 +769,16 @@ ht) (setq maxw (max w maxw)))) (let ((padding (make-string maxw 32))) - (flet ((pad (w) (substring-no-properties padding w)) - (render (rda &rest ls) - (propertize - (apply 'concat - (format-time-string "%Y-%m-%d" (aref rda 1)) - " " - (aref rda 0) - ls) - :vc-annotate-prefix t - :vc-rcs-r/d/a rda))) + (cl-flet ((pad (w) (substring-no-properties padding w)) + (render (rda &rest ls) + (propertize + (apply 'concat + (format-time-string "%Y-%m-%d" (aref rda 1)) + " " + (aref rda 0) + ls) + :vc-annotate-prefix t + :vc-rcs-r/d/a rda))) (maphash (if all-me (lambda (rda w) @@ -1306,50 +1306,51 @@ ;; to "de-@@-format" the printed representation as the first step ;; to translating it into some value. See internal func `gather'. @-holes) - (flet ((sw () (skip-chars-forward " \t\n")) ; i.e., `[:space:]' - (at (tag) (save-excursion (eq tag (read buffer)))) - (to-eol () (buffer-substring-no-properties - (point) (progn (forward-line 1) - (1- (point))))) - (to-semi () (setq b (point) - e (progn (search-forward ";") - (1- (point))))) - (to-one@ () (setq @-holes nil - b (progn (search-forward "@") (point)) - e (progn (while (and (search-forward "@") - (= ?@ (char-after)) - (progn - (push (point) @-holes) - (forward-char 1) - (push (point) @-holes)))) - (1- (point))))) - (tok+val (set-b+e name &optional proc) - (unless (eq name (setq tok (read buffer))) - (error "Missing `%s' while parsing %s" name context)) - (sw) - (funcall set-b+e) - (cons tok (if proc - (funcall proc) - (buffer-substring-no-properties b e)))) - (k-semi (name &optional proc) (tok+val 'to-semi name proc)) - (gather () (let ((pairs `(,e ,@@-holes ,b)) - acc) - (while pairs - (push (buffer-substring-no-properties - (cadr pairs) (car pairs)) - acc) - (setq pairs (cddr pairs))) - (apply 'concat acc))) - (k-one@ (name &optional later) (tok+val 'to-one@ name - (if later - (lambda () t) - 'gather)))) + (cl-flet* + ((sw () (skip-chars-forward " \t\n")) ; i.e., `[:space:]' + (at (tag) (save-excursion (eq tag (read buffer)))) + (to-eol () (buffer-substring-no-properties + (point) (progn (forward-line 1) + (1- (point))))) + (to-semi () (setq b (point) + e (progn (search-forward ";") + (1- (point))))) + (to-one@ () (setq @-holes nil + b (progn (search-forward "@") (point)) + e (progn (while (and (search-forward "@") + (= ?@ (char-after)) + (progn + (push (point) @-holes) + (forward-char 1) + (push (point) @-holes)))) + (1- (point))))) + (tok+val (set-b+e name &optional proc) + (unless (eq name (setq tok (read buffer))) + (error "Missing `%s' while parsing %s" name context)) + (sw) + (funcall set-b+e) + (cons tok (if proc + (funcall proc) + (buffer-substring-no-properties b e)))) + (k-semi (name &optional proc) (tok+val #'to-semi name proc)) + (gather () (let ((pairs `(,e ,@@-holes ,b)) + acc) + (while pairs + (push (buffer-substring-no-properties + (cadr pairs) (car pairs)) + acc) + (setq pairs (cddr pairs))) + (apply 'concat acc))) + (k-one@ (name &optional later) (tok+val #'to-one@ name + (if later + (lambda () t) + #'gather)))) (save-excursion (goto-char (point-min)) ;; headers (setq context 'headers) - (flet ((hpush (name &optional proc) - (push (k-semi name proc) headers))) + (cl-flet ((hpush (name &optional proc) + (push (k-semi name proc) headers))) (hpush 'head) (when (at 'branch) (hpush 'branch)) @@ -1391,7 +1392,7 @@ (when (< (car ls) 100) (setcar ls (+ 1900 (car ls)))) (apply 'encode-time (nreverse ls))))) - ,@(mapcar 'k-semi '(author state)) + ,@(mapcar #'k-semi '(author state)) ,(k-semi 'branches (lambda () (split-string @@ -1421,16 +1422,17 @@ ;; only the former since it behaves identically to the ;; latter in the absence of "@@".) sub) - (flet ((incg (beg end) (let ((b beg) (e end) @-holes) - (while (and asc (< (car asc) e)) - (push (pop asc) @-holes)) - ;; Self-deprecate when work is done. - ;; Folding many dimensions into one. - ;; Thanks B.Mandelbrot, for complex sum. - ;; O beauteous math! --the Unvexed Bum - (unless asc - (setq sub 'buffer-substring-no-properties)) - (gather)))) + (cl-flet ((incg (beg end) + (let ((b beg) (e end) @-holes) + (while (and asc (< (car asc) e)) + (push (pop asc) @-holes)) + ;; Self-deprecate when work is done. + ;; Folding many dimensions into one. + ;; Thanks B.Mandelbrot, for complex sum. + ;; O beauteous math! --the Unvexed Bum + (unless asc + (setq sub #'buffer-substring-no-properties)) + (gather)))) (while (and (sw) (not (eobp)) (setq context (to-eol) @@ -1449,8 +1451,8 @@ (setcdr (cadr rev) (gather)) (if @-holes (setq asc (nreverse @-holes) - sub 'incg) - (setq sub 'buffer-substring-no-properties)) + sub #'incg) + (setq sub #'buffer-substring-no-properties)) (goto-char b) (setq acc nil) (while (< (point) e) === modified file 'test/ChangeLog' --- test/ChangeLog 2012-06-10 13:20:58 +0000 +++ test/ChangeLog 2012-06-27 15:11:28 +0000 @@ -1,7 +1,12 @@ +2012-06-27 Stefan Monnier + + * automated/ert-x-tests.el (ert-test-run-tests-interactively-2): + Use cl-flet. + 2012-06-08 Ulf Jasper - * automated/icalendar-tests.el (icalendar--parse-vtimezone): Test - escaped commas in TZID (Bug#11473). + * automated/icalendar-tests.el (icalendar--parse-vtimezone): + Test escaped commas in TZID (Bug#11473). (icalendar-import-with-timezone): New. (icalendar-real-world): Add new testcase as given in the bugreport of Bug#11473. @@ -332,8 +337,8 @@ 2009-12-18 Ulf Jasper * icalendar-testsuite.el - (icalendar-testsuite--run-function-tests): Add - icalendar-testsuite--test-parse-vtimezone. + (icalendar-testsuite--run-function-tests): + Add icalendar-testsuite--test-parse-vtimezone. (icalendar-testsuite--test-parse-vtimezone): New. (icalendar-testsuite--do-test-cycle): Doc changes. (icalendar-testsuite--run-real-world-tests): Remove trailing @@ -375,7 +380,7 @@ 2008-10-31 Ulf Jasper * icalendar-testsuite.el (icalendar-testsuite--run-function-tests): - Added `icalendar-testsuite--test-create-uid'. + Add `icalendar-testsuite--test-create-uid'. (icalendar-testsuite--test-create-uid): New. 2008-06-14 Ulf Jasper === modified file 'test/automated/ert-x-tests.el' --- test/automated/ert-x-tests.el 2012-01-05 09:46:05 +0000 +++ test/automated/ert-x-tests.el 2012-06-27 15:11:28 +0000 @@ -103,79 +103,79 @@ (ert-deftest ert-test-run-tests-interactively-2 () :tags '(:causes-redisplay) - (let ((passing-test (make-ert-test :name 'passing-test - :body (lambda () (ert-pass)))) - (failing-test (make-ert-test :name 'failing-test - :body (lambda () - (ert-info ((propertize "foo\nbar" - 'a 'b)) - (ert-fail - "failure message")))))) - (let ((ert-debug-on-error nil)) - (let* ((buffer-name (generate-new-buffer-name "*ert-test-run-tests*")) - (messages nil) - (mock-message-fn - (lambda (format-string &rest args) - (push (apply #'format format-string args) messages)))) - (flet ((expected-string (with-font-lock-p) - (ert-propertized-string - "Selector: (member )\n" - "Passed: 1\n" - "Failed: 1 (1 unexpected)\n" - "Total: 2/2\n\n" - "Started at:\n" - "Finished.\n" - "Finished at:\n\n" - `(category ,(button-category-symbol - 'ert--results-progress-bar-button) - button (t) - face ,(if with-font-lock-p - 'ert-test-result-unexpected - 'button)) - ".F" nil "\n\n" - `(category ,(button-category-symbol - 'ert--results-expand-collapse-button) - button (t) - face ,(if with-font-lock-p - 'ert-test-result-unexpected - 'button)) - "F" nil " " - `(category ,(button-category-symbol - 'ert--test-name-button) - button (t) - ert-test-name failing-test) - "failing-test" - nil "\n Info: " '(a b) "foo\n" - nil " " '(a b) "bar" - nil "\n (ert-test-failed \"failure message\")\n\n\n" - ))) - (save-window-excursion - (unwind-protect - (let ((case-fold-search nil)) - (ert-run-tests-interactively - `(member ,passing-test ,failing-test) buffer-name - mock-message-fn) - (should (equal messages `(,(concat - "Ran 2 tests, 1 results were " - "as expected, 1 unexpected")))) - (with-current-buffer buffer-name - (font-lock-mode 0) - (should (ert-equal-including-properties - (ert-filter-string (buffer-string) - '("Started at:\\(.*\\)$" 1) - '("Finished at:\\(.*\\)$" 1)) - (expected-string nil))) - ;; `font-lock-mode' only works if interactive, so - ;; pretend we are. - (let ((noninteractive nil)) - (font-lock-mode 1)) - (should (ert-equal-including-properties - (ert-filter-string (buffer-string) - '("Started at:\\(.*\\)$" 1) - '("Finished at:\\(.*\\)$" 1)) - (expected-string t))))) - (when (get-buffer buffer-name) - (kill-buffer buffer-name))))))))) + (let* ((passing-test (make-ert-test :name 'passing-test + :body (lambda () (ert-pass)))) + (failing-test (make-ert-test :name 'failing-test + :body (lambda () + (ert-info ((propertize "foo\nbar" + 'a 'b)) + (ert-fail + "failure message"))))) + (ert-debug-on-error nil) + (buffer-name (generate-new-buffer-name "*ert-test-run-tests*")) + (messages nil) + (mock-message-fn + (lambda (format-string &rest args) + (push (apply #'format format-string args) messages)))) + (cl-flet ((expected-string (with-font-lock-p) + (ert-propertized-string + "Selector: (member )\n" + "Passed: 1\n" + "Failed: 1 (1 unexpected)\n" + "Total: 2/2\n\n" + "Started at:\n" + "Finished.\n" + "Finished at:\n\n" + `(category ,(button-category-symbol + 'ert--results-progress-bar-button) + button (t) + face ,(if with-font-lock-p + 'ert-test-result-unexpected + 'button)) + ".F" nil "\n\n" + `(category ,(button-category-symbol + 'ert--results-expand-collapse-button) + button (t) + face ,(if with-font-lock-p + 'ert-test-result-unexpected + 'button)) + "F" nil " " + `(category ,(button-category-symbol + 'ert--test-name-button) + button (t) + ert-test-name failing-test) + "failing-test" + nil "\n Info: " '(a b) "foo\n" + nil " " '(a b) "bar" + nil "\n (ert-test-failed \"failure message\")\n\n\n" + ))) + (save-window-excursion + (unwind-protect + (let ((case-fold-search nil)) + (ert-run-tests-interactively + `(member ,passing-test ,failing-test) buffer-name + mock-message-fn) + (should (equal messages `(,(concat + "Ran 2 tests, 1 results were " + "as expected, 1 unexpected")))) + (with-current-buffer buffer-name + (font-lock-mode 0) + (should (ert-equal-including-properties + (ert-filter-string (buffer-string) + '("Started at:\\(.*\\)$" 1) + '("Finished at:\\(.*\\)$" 1)) + (expected-string nil))) + ;; `font-lock-mode' only works if interactive, so + ;; pretend we are. + (let ((noninteractive nil)) + (font-lock-mode 1)) + (should (ert-equal-including-properties + (ert-filter-string (buffer-string) + '("Started at:\\(.*\\)$" 1) + '("Finished at:\\(.*\\)$" 1)) + (expected-string t))))) + (when (get-buffer buffer-name) + (kill-buffer buffer-name))))))) (ert-deftest ert-test-describe-test () "Tests `ert-describe-test'." ------------------------------------------------------------ revno: 108770 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 10:40:22 -0400 message: * lisp/gnus/shr.el (shr-render-buffer): New command. (shr-visit-file): Use it. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-06-27 00:47:19 +0000 +++ lisp/gnus/ChangeLog 2012-06-27 14:40:22 +0000 @@ -1,3 +1,8 @@ +2012-06-27 Stefan Monnier + + * shr.el (shr-render-buffer): New command. + (shr-visit-file): Use it. + 2012-06-27 Katsumi Yamaoka * tests/gnustest-nntp.el, tests/gnustest-registry.el: === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2012-06-26 22:52:31 +0000 +++ lisp/gnus/shr.el 2012-06-27 14:40:22 +0000 @@ -129,17 +129,23 @@ ;; Public functions and commands. -(defun shr-visit-file (file) - "Parse FILE as an HTML document, and render it in a new buffer." - (interactive "fHTML file name: ") +(defun shr-render-buffer (buffer) + "Display the HTML rendering of the current buffer." + (interactive (list (current-buffer))) (pop-to-buffer "*html*") (erase-buffer) (shr-insert-document - (with-temp-buffer - (insert-file-contents file) + (with-current-buffer buffer (libxml-parse-html-region (point-min) (point-max)))) (goto-char (point-min))) +(defun shr-visit-file (file) + "Parse FILE as an HTML document, and render it in a new buffer." + (interactive "fHTML file name: ") + (with-temp-buffer + (insert-file-contents file) + (shr-render-buffer (current-buffer)))) + ;;;###autoload (defun shr-insert-document (dom) "Render the parsed document DOM into the current buffer. ------------------------------------------------------------ revno: 108769 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11780 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 10:39:30 -0400 message: * lisp/emacs-lisp/cl.el: Use lexical-binding. Fix flet. (cl--symbol-function): New macro. (cl--letf, cl--letf*): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 14:05:24 +0000 +++ lisp/ChangeLog 2012-06-27 14:39:30 +0000 @@ -1,5 +1,9 @@ 2012-06-27 Stefan Monnier + * emacs-lisp/cl.el: Use lexical-binding. Fix flet (bug#11780). + (cl--symbol-function): New macro. + (cl--letf, cl--letf*): Use it. + * emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): Strip "toggle-" if any. === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2012-06-22 21:24:54 +0000 +++ lisp/emacs-lisp/cl.el 2012-06-27 14:39:30 +0000 @@ -1,4 +1,4 @@ -;;; cl.el --- Compatibility aliases for the old CL library. +;;; cl.el --- Compatibility aliases for the old CL library. -*- lexical-binding: t -*- ;; Copyright (C) 2012 Free Software Foundation, Inc. @@ -235,7 +235,6 @@ multiple-value-bind symbol-macrolet macrolet - flet progv psetq do-all-symbols @@ -450,6 +449,16 @@ (setq body (list `(lexical-let (,(pop bindings)) ,@body)))) (car body))) +(defmacro cl--symbol-function (symbol) + "Like `symbol-function' but return `cl--unbound' if not bound." + ;; (declare (gv-setter (lambda (store) + ;; `(if (eq ,store 'cl--unbound) + ;; (fmakunbound ,symbol) (fset ,symbol ,store))))) + `(if (fboundp ,symbol) (symbol-function ,symbol) 'cl--unbound)) +(gv-define-setter cl--symbol-function (store symbol) + `(if (eq ,store 'cl--unbound) (fmakunbound ,symbol) (fset ,symbol ,store))) + + ;; This should really have some way to shadow 'byte-compile properties, etc. (defmacro flet (bindings &rest body) "Make temporary function definitions. @@ -543,6 +552,8 @@ (funcall setter vold))) binds)))) (let ((binding (car bindings))) + (if (eq (car-safe (car binding)) 'symbol-function) + (setcar (car binding) 'cl--symbol-function)) (gv-letplace (getter setter) (car binding) (macroexp-let2 nil vnew (cadr binding) (if (symbolp (car binding)) @@ -579,7 +590,9 @@ ;; Special-case for simple variables. (macroexp-let* (list (if (cdr binding) binding (list (car binding) (car binding)))) - (cl--letf* (cdr bindings) body)) + (cl--letf* (cdr bindings) body)) + (if (eq (car-safe (car binding)) 'symbol-function) + (setcar (car binding) 'cl--symbol-function)) (gv-letplace (getter setter) (car binding) (macroexp-let2 macroexp-copyable-p vnew (cadr binding) (macroexp-let2 nil vold getter @@ -736,7 +749,7 @@ ;; This is just kept for compatibility with code byte-compiled by Emacs-20. ;; No idea if this might still be needed. -(defun cl-not-hash-table (x &optional y &rest z) +(defun cl-not-hash-table (x &optional y &rest _z) (declare (obsolete nil "24.2")) (signal 'wrong-type-argument (list 'cl-hash-table-p (or y x)))) ------------------------------------------------------------ revno: 108768 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-06-27 18:35:51 +0400 message: * alloc.c (allocate_string): Omit intervals initialization. * alloc.c (make_uninit_multibyte_string): Initialize intervals as in make_pure_string and make_pure_c_string. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 11:25:56 +0000 +++ src/ChangeLog 2012-06-27 14:35:51 +0000 @@ -1,5 +1,11 @@ 2012-06-27 Dmitry Antipov + * alloc.c (allocate_string): Omit intervals initialization. + * alloc.c (make_uninit_multibyte_string): Initialize intervals + as in make_pure_string and make_pure_c_string. + +2012-06-27 Dmitry Antipov + * alloc.c (allocate_string): Fix last change. 2012-06-27 Dmitry Antipov === modified file 'src/alloc.c' --- src/alloc.c 2012-06-27 11:25:56 +0000 +++ src/alloc.c 2012-06-27 14:35:51 +0000 @@ -1959,10 +1959,6 @@ MALLOC_UNBLOCK_INPUT; - /* SIZE and SIZE_BYTE fields will be initialized - by calling allocate_string_data. */ - s->intervals = NULL_INTERVAL; - --total_free_strings; ++total_strings; ++strings_consed; @@ -2529,6 +2525,7 @@ return empty_multibyte_string; s = allocate_string (); + s->intervals = NULL_INTERVAL; allocate_string_data (s, nchars, nbytes); XSETSTRING (string, s); string_chars_consed += nbytes; ------------------------------------------------------------ revno: 108767 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-27 10:05:24 -0400 message: * lisp/emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): Strip "toggle-" if any. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 07:47:56 +0000 +++ lisp/ChangeLog 2012-06-27 14:05:24 +0000 @@ -1,3 +1,8 @@ +2012-06-27 Stefan Monnier + + * emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): + Strip "toggle-" if any. + 2012-06-27 Glenn Morris * info.el (Info-default-directory-list): Move here from paths.el. === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2012-06-10 13:28:26 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2012-06-27 14:05:24 +0000 @@ -65,7 +65,8 @@ ;; "foo-bar-minor" -> "Foo-Bar-Minor" (capitalize (replace-regexp-in-string ;; "foo-bar-minor-mode" -> "foo-bar-minor" - "-mode\\'" "" (symbol-name mode)))) + "toggle-\\|-mode\\'" "" + (symbol-name mode)))) " mode"))) (if (not (stringp lighter)) name ;; Strip leading and trailing whitespace from LIGHTER. ------------------------------------------------------------ revno: 108766 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-06-27 15:25:56 +0400 message: * alloc.c (allocate_string): Fix last change. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 11:19:54 +0000 +++ src/ChangeLog 2012-06-27 11:25:56 +0000 @@ -1,5 +1,9 @@ 2012-06-27 Dmitry Antipov + * alloc.c (allocate_string): Fix last change. + +2012-06-27 Dmitry Antipov + * alloc.c (allocate_string): Remove two redundant calls to memset, add explicit initialization where appropriate. === modified file 'src/alloc.c' --- src/alloc.c 2012-06-27 11:19:54 +0000 +++ src/alloc.c 2012-06-27 11:25:56 +0000 @@ -1962,7 +1962,6 @@ /* SIZE and SIZE_BYTE fields will be initialized by calling allocate_string_data. */ s->intervals = NULL_INTERVAL; - s->data = NULL; --total_free_strings; ++total_strings; ------------------------------------------------------------ revno: 108765 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-06-27 15:19:54 +0400 message: * alloc.c (allocate_string): Remove two redundant calls to memset, add explicit initialization where appropriate. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 07:47:56 +0000 +++ src/ChangeLog 2012-06-27 11:19:54 +0000 @@ -1,3 +1,8 @@ +2012-06-27 Dmitry Antipov + + * alloc.c (allocate_string): Remove two redundant calls + to memset, add explicit initialization where appropriate. + 2012-06-27 Glenn Morris * lisp.mk (lisp): Remove paths.elc. === modified file 'src/alloc.c' --- src/alloc.c 2012-06-27 03:49:35 +0000 +++ src/alloc.c 2012-06-27 11:19:54 +0000 @@ -1936,13 +1936,14 @@ int i; b = (struct string_block *) lisp_malloc (sizeof *b, MEM_TYPE_STRING); - memset (b, 0, sizeof *b); b->next = string_blocks; string_blocks = b; for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i) { s = b->strings + i; + /* Every string on a free list should have NULL data pointer. */ + s->data = NULL; NEXT_FREE_LISP_STRING (s) = string_free_list; string_free_list = s; } @@ -1958,8 +1959,10 @@ MALLOC_UNBLOCK_INPUT; - /* Probably not strictly necessary, but play it safe. */ - memset (s, 0, sizeof *s); + /* SIZE and SIZE_BYTE fields will be initialized + by calling allocate_string_data. */ + s->intervals = NULL_INTERVAL; + s->data = NULL; --total_free_strings; ++total_strings; ------------------------------------------------------------ revno: 108764 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-06-27 00:47:56 -0700 message: Remove paths.el * lisp/info.el (Info-default-directory-list): Move here from paths.el. * lisp/paths.el: Remove file, which is now empty. * lisp/loadup.el: No longer load "paths". * src/lisp.mk (lisp): Remove paths.elc. * lib-src/makefile.w32-in (lisp2): Remove paths.el. * INSTALL: Remove references to paths.el. diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-26 16:57:54 +0000 +++ ChangeLog 2012-06-27 07:47:56 +0000 @@ -1,3 +1,7 @@ +2012-06-27 Glenn Morris + + * INSTALL: Remove references to paths.el. + 2012-06-26 Eli Zaretskii * lib/makefile.w32-in ($(GNULIBOBJS)): Depend on stamp_BLD. This === modified file 'INSTALL' --- INSTALL 2012-06-06 01:06:54 +0000 +++ INSTALL 2012-06-27 07:47:56 +0000 @@ -429,11 +429,19 @@ to the real source directory--there is no need, and installation will fail.) -4) Look at `./lisp/paths.el'; if some of those values are not right -for your system, set up the file `./lisp/site-init.el' with Emacs -Lisp code to override them; it is not a good idea to edit paths.el -itself. YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES, -rather than `defvar', as used by `./lisp/paths.el'. For example, +4) Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs +Lisp code you want Emacs to load before it is dumped out. Use +site-load.el for additional libraries if you arrange for their +documentation strings to be in the etc/DOC file (see +src/Makefile.in if you wish to figure out how to do that). For all +else, use site-init.el. Do not load byte-compiled code which +was built with a non-nil value of `byte-compile-dynamic'. + +It is not a good idea to edit the normal .el files that come with Emacs. +Instead, use a file like site-init.el to change settings. + +To change the value of a variable that is already defined in Emacs, +you should use the Lisp function `setq', not `defvar'. For example, (setq news-inews-program "/usr/bin/inews") @@ -445,14 +453,6 @@ variable should have. If you don't pay attention to what you are doing, you'll make a mistake. -5) Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs -Lisp code you want Emacs to load before it is dumped out. Use -site-load.el for additional libraries if you arrange for their -documentation strings to be in the etc/DOC file (see -src/Makefile.in if you wish to figure out how to do that). For all -else, use site-init.el. Do not load byte-compiled code which -was built with a non-nil value of `byte-compile-dynamic'. - If you set load-path to a different value in site-init.el or site-load.el, Emacs will use *precisely* that value when it starts up again. If you do this, you are on your own! @@ -460,10 +460,10 @@ The `site-*.el' files are nonexistent in the distribution. You do not need to create them if you have nothing to put in them. -6) Refer to the file `./etc/TERMS' for information on fields you may +5) Refer to the file `./etc/TERMS' for information on fields you may wish to add to various termcap entries. (This is unlikely to be necessary.) -7) Run `make' in the top directory of the Emacs distribution to finish +6) Run `make' in the top directory of the Emacs distribution to finish building Emacs in the standard way. The final executable file is named `src/emacs'. You can execute this file "in place" without copying it, if you wish; then it automatically uses the sibling @@ -534,15 +534,15 @@ the command. See the section below called `MAKE VARIABLES' for more information on this. -8) Check the file `dir' in your site's info directory (usually +7) Check the file `dir' in your site's info directory (usually /usr/local/share/info) to make sure that it has a menu entry for the Emacs info files. -9) If your system uses lock files to interlock access to mailer inbox files, +8) If your system uses lock files to interlock access to mailer inbox files, then you might need to make the movemail program setuid or setgid to enable it to write the lock files. We believe this is safe. -10) You are done! You can remove executables and object files from +9) You are done! You can remove executables and object files from the build directory by typing `make clean'. To also remove the files that `configure' created (so you can compile Emacs for a different configuration), type `make distclean'. If you don't need some, or all @@ -727,7 +727,7 @@ used in building Emacs, and are not needed any more. 2) Copy the files in `./info' to the place specified in -`./lisp/site-init.el' or `./lisp/paths.el'. Note that if the +`./lisp/site-init.el' or `./lisp/info.el'. Note that if the destination directory already contains a file named `dir', you probably don't want to replace it with the `dir' file in the Emacs distribution. Instead, you should make sure that the existing `dir' === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-06-26 01:05:39 +0000 +++ lib-src/ChangeLog 2012-06-27 07:47:56 +0000 @@ -1,3 +1,7 @@ +2012-06-27 Glenn Morris + + * makefile.w32-in (lisp2): Remove paths.el. + 2012-06-26 Paul Eggert Clean out last vestiges of the old HAVE_CONFIG_H stuff. === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2012-06-26 01:05:39 +0000 +++ lib-src/makefile.w32-in 2012-06-27 07:47:56 +0000 @@ -236,7 +236,6 @@ $(lispsource)language/georgian.el \ $(lispsource)language/khmer.el \ $(lispsource)language/burmese.el \ - $(lispsource)paths.el \ $(lispsource)register.elc \ $(lispsource)replace.elc \ $(lispsource)simple.elc \ === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 07:10:27 +0000 +++ lisp/ChangeLog 2012-06-27 07:47:56 +0000 @@ -1,5 +1,9 @@ 2012-06-27 Glenn Morris + * info.el (Info-default-directory-list): Move here from paths.el. + * paths.el: Remove file, which is now empty. + * loadup.el: No longer load "paths". + * custom.el (custom-initialize-delay): Doc fix. * eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el: === modified file 'lisp/info.el' --- lisp/info.el 2012-06-23 13:32:29 +0000 +++ lisp/info.el 2012-06-27 07:47:56 +0000 @@ -169,6 +169,83 @@ "Face for Info nodes in a node header." :group 'info) +;; This is a defcustom largely so that we can get the benefit +;; of custom-initialize-delay. Perhaps it would work to make it a +;; defvar and explicitly give it a standard-value property, and +;; call custom-initialize-delay on it. +;; The progn forces the autoloader to include the whole thing, not +;; just an abbreviated version. +;;;###autoload +(progn +(defcustom Info-default-directory-list + (let* ((config-dir + (file-name-as-directory + ;; Self-contained NS build with info/ in the app-bundle. + (or (and (featurep 'ns) + (let ((dir (expand-file-name "../info" data-directory))) + (if (file-directory-p dir) dir))) + configure-info-directory))) + (prefixes + ;; Directory trees in which to look for info subdirectories + (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/"))) + (suffixes + ;; Subdirectories in each directory tree that may contain info + ;; directories. Most of these are rather outdated. + ;; It ought to be fine to stop checking the "emacs" ones now, + ;; since this is Emacs and we have not installed info files + ;; into such directories for a looong time... + '("share/" "" "gnu/" "gnu/lib/" "gnu/lib/emacs/" + "emacs/" "lib/" "lib/emacs/")) + (standard-info-dirs + (apply #'nconc + (mapcar (lambda (pfx) + (let ((dirs + (mapcar (lambda (sfx) + (concat pfx sfx "info/")) + suffixes))) + (prune-directory-list dirs))) + prefixes))) + ;; If $(prefix)/share/info is not one of the standard info + ;; directories, they are probably installing an experimental + ;; version of Emacs, so make sure that experimental version's Info + ;; files override the ones in standard directories. + (dirs + (if (member config-dir standard-info-dirs) + ;; FIXME? What is the point of adding it again at the end + ;; when it is already present earlier in the list? + (nconc standard-info-dirs (list config-dir)) + (cons config-dir standard-info-dirs)))) + (if (not (eq system-type 'windows-nt)) + dirs + ;; Include the info directory near where Emacs executable was installed. + (let* ((instdir (file-name-directory invocation-directory)) + (dir1 (expand-file-name "../info/" instdir)) + (dir2 (expand-file-name "../../../info/" instdir))) + (cond ((file-exists-p dir1) (append dirs (list dir1))) + ((file-exists-p dir2) (append dirs (list dir2))) + (t dirs))))) + + "Default list of directories to search for Info documentation files. +They are searched in the order they are given in the list. +Therefore, the directory of Info files that come with Emacs +normally should come last (so that local files override standard ones), +unless Emacs is installed into a non-standard directory. In the latter +case, the directory of Info files that come with Emacs should be +first in this list. + +Once Info is started, the list of directories to search +comes from the variable `Info-directory-list'. +This variable `Info-default-directory-list' is used as the default +for initializing `Info-directory-list' when Info is started, unless +the environment variable INFOPATH is set. + +Although this is a customizable variable, that is mainly for technical +reasons. Normally, you should either set INFOPATH or customize +`Info-additional-directory-list', rather than changing this variable." + :initialize 'custom-initialize-delay + :type '(repeat directory) + :group 'info)) + (defvar Info-directory-list nil "List of directories to search for Info documentation files. If nil, meaning not yet initialized, Info uses the environment === modified file 'lisp/loadup.el' --- lisp/loadup.el 2012-06-22 13:42:38 +0000 +++ lisp/loadup.el 2012-06-27 07:47:56 +0000 @@ -177,7 +177,6 @@ (load "rfn-eshadow") (load "menu-bar") -(load "paths") (load "emacs-lisp/lisp") (load "textmodes/page") (load "register") === removed file 'lisp/paths.el' --- lisp/paths.el 2012-05-26 21:58:01 +0000 +++ lisp/paths.el 1970-01-01 00:00:00 +0000 @@ -1,108 +0,0 @@ -;;; paths.el --- define pathnames for use by various Emacs commands - -;; Copyright (C) 1986, 1988, 1994, 1999-2012 Free Software Foundation, Inc. - -;; Maintainer: FSF -;; Keywords: internal -;; Package: emacs - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;; These are default settings for names of certain files and directories -;; that Emacs needs to refer to from time to time. - -;; If these settings are not right, override them with `setq' -;; in site-init.el. Do not change this file. - -;;; Code: - -;; This is a defcustom largely so that we can get the benefit -;; of custom-initialize-delay. Perhaps it would work to make it a -;; defvar and explicitly give it a standard-value property, and -;; call custom-initialize-delay on it. -(defcustom Info-default-directory-list - (let* ((config-dir - (file-name-as-directory - ;; Self-contained NS build with info/ in the app-bundle. - (or (and (featurep 'ns) - (let ((dir (expand-file-name "../info" data-directory))) - (if (file-directory-p dir) dir))) - configure-info-directory))) - (prefixes - ;; Directory trees in which to look for info subdirectories - (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/"))) - (suffixes - ;; Subdirectories in each directory tree that may contain info - ;; directories. Most of these are rather outdated. - ;; It ought to be fine to stop checking the "emacs" ones now, - ;; since this is Emacs and we have not installed info files - ;; into such directories for a looong time... - '("share/" "" "gnu/" "gnu/lib/" "gnu/lib/emacs/" - "emacs/" "lib/" "lib/emacs/")) - (standard-info-dirs - (apply #'nconc - (mapcar (lambda (pfx) - (let ((dirs - (mapcar (lambda (sfx) - (concat pfx sfx "info/")) - suffixes))) - (prune-directory-list dirs))) - prefixes))) - ;; If $(prefix)/share/info is not one of the standard info - ;; directories, they are probably installing an experimental - ;; version of Emacs, so make sure that experimental version's Info - ;; files override the ones in standard directories. - (dirs - (if (member config-dir standard-info-dirs) - ;; FIXME? What is the point of adding it again at the end - ;; when it is already present earlier in the list? - (nconc standard-info-dirs (list config-dir)) - (cons config-dir standard-info-dirs)))) - (if (not (eq system-type 'windows-nt)) - dirs - ;; Include the info directory near where Emacs executable was installed. - (let* ((instdir (file-name-directory invocation-directory)) - (dir1 (expand-file-name "../info/" instdir)) - (dir2 (expand-file-name "../../../info/" instdir))) - (cond ((file-exists-p dir1) (append dirs (list dir1))) - ((file-exists-p dir2) (append dirs (list dir2))) - (t dirs))))) - - "Default list of directories to search for Info documentation files. -They are searched in the order they are given in the list. -Therefore, the directory of Info files that come with Emacs -normally should come last (so that local files override standard ones), -unless Emacs is installed into a non-standard directory. In the latter -case, the directory of Info files that come with Emacs should be -first in this list. - -Once Info is started, the list of directories to search -comes from the variable `Info-directory-list'. -This variable `Info-default-directory-list' is used as the default -for initializing `Info-directory-list' when Info is started, unless -the environment variable INFOPATH is set. - -Although this is a customizable variable, that is mainly for technical -reasons. Normally, you should either set INFOPATH or customize -`Info-additional-directory-list', rather than changing this variable." - :initialize 'custom-initialize-delay - :type '(repeat directory) - :group 'info) - - -;;; paths.el ends here === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 06:55:01 +0000 +++ src/ChangeLog 2012-06-27 07:47:56 +0000 @@ -1,3 +1,7 @@ +2012-06-27 Glenn Morris + + * lisp.mk (lisp): Remove paths.elc. + 2012-06-27 Chong Yidong * doc.c (Fsubstitute_command_keys): Fix punctuation. === modified file 'src/lisp.mk' --- src/lisp.mk 2012-05-25 22:13:24 +0000 +++ src/lisp.mk 2012-06-27 07:47:56 +0000 @@ -121,7 +121,6 @@ $(lispsource)/isearch.elc \ $(lispsource)/rfn-eshadow.elc \ $(lispsource)/menu-bar.elc \ - $(lispsource)/paths.elc \ $(lispsource)/emacs-lisp/lisp.elc \ $(lispsource)/textmodes/page.elc \ $(lispsource)/register.elc \ ------------------------------------------------------------ revno: 108763 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-06-27 00:10:27 -0700 message: * lisp/custom.el (custom-initialize-delay): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 07:08:06 +0000 +++ lisp/ChangeLog 2012-06-27 07:10:27 +0000 @@ -1,5 +1,7 @@ 2012-06-27 Glenn Morris + * custom.el (custom-initialize-delay): Doc fix. + * eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el: * eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el: * eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el: === modified file 'lisp/custom.el' --- lisp/custom.el 2012-05-18 01:46:20 +0000 +++ lisp/custom.el 2012-06-27 07:10:27 +0000 @@ -120,7 +120,9 @@ For variables in preloaded files, you can simply use this function for the :initialize property. For autoloaded variables, you will also need to add an autoload stanza calling this -function, and another one setting the standard-value property." +function, and another one setting the standard-value property. +Or you can wrap the defcustom in a progn, to force the autoloader +to include all of it." ; see eg vc-sccs-search-project-dir ;; No longer true: ;; "See `send-mail-function' in sendmail.el for an example." ------------------------------------------------------------ revno: 108762 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-06-27 00:08:06 -0700 message: Replace eshell-defgroup with plain defgroup Borrowing a trick from vc-sccs.el, wrap the defgroup in a progn so that the whole thing ends up in the generated autoload file, esh-groups.el. * em-alias.el, em-banner.el, em-basic.el, em-cmpl.el, em-dirs.el: * em-glob.el, em-hist.el, em-ls.el, em-pred.el, em-prompt.el: * em-rebind.el, em-script.el, em-smart.el, em-term.el, em-unix.el: * em-xtra.el: Replace eshell-defgroup with (progn (defgroup. * eshell.el (eshell-defgroup): Remove alias. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-27 05:47:14 +0000 +++ lisp/ChangeLog 2012-06-27 07:08:06 +0000 @@ -1,3 +1,13 @@ +2012-06-27 Glenn Morris + + * eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el: + * eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el: + * eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el: + * eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el: + * eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el: + * eshell/em-xtra.el: Replace eshell-defgroup with "(progn (defgroup". + * eshell/eshell.el (eshell-defgroup): Remove alias. + 2012-06-27 Chong Yidong * help.el (help-enable-auto-load): New variable. === modified file 'lisp/eshell/em-alias.el' --- lisp/eshell/em-alias.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-alias.el 2012-06-27 07:08:06 +0000 @@ -95,11 +95,12 @@ (require 'eshell) ;;;###autoload -(eshell-defgroup eshell-alias nil +(progn +(defgroup eshell-alias nil "Command aliases allow for easy definition of alternate commands." :tag "Command aliases" ;; :link '(info-link "(eshell)Command aliases") - :group 'eshell-module) + :group 'eshell-module)) (defcustom eshell-aliases-file (expand-file-name "alias" eshell-directory-name) "The file in which aliases are kept. === modified file 'lisp/eshell/em-banner.el' --- lisp/eshell/em-banner.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-banner.el 2012-06-27 07:08:06 +0000 @@ -46,13 +46,14 @@ (require 'esh-util) ;;;###autoload -(eshell-defgroup eshell-banner nil +(progn +(defgroup eshell-banner nil "This sample module displays a welcome banner at login. It exists so that others wishing to create their own Eshell extension modules may have a simple template to begin with." :tag "Login banner" ;; :link '(info-link "(eshell)Login banner") - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-basic.el' --- lisp/eshell/em-basic.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-basic.el 2012-06-27 07:08:06 +0000 @@ -66,14 +66,15 @@ (require 'esh-opt) ;;;###autoload -(eshell-defgroup eshell-basic nil +(progn +(defgroup eshell-basic nil "The \"basic\" code provides a set of convenience functions which are traditionally considered shell builtins. Since all of the functionality provided by them is accessible through Lisp, they are not really builtins at all, but offer a command-oriented way to do the same thing." :tag "Basic shell commands" - :group 'eshell-module) + :group 'eshell-module)) (defcustom eshell-plain-echo-behavior nil "If non-nil, `echo' tries to behave like an ordinary shell echo. === modified file 'lisp/eshell/em-cmpl.el' --- lisp/eshell/em-cmpl.el 2012-03-05 10:44:31 +0000 +++ lisp/eshell/em-cmpl.el 2012-06-27 07:08:06 +0000 @@ -75,12 +75,13 @@ (require 'esh-util) ;;;###autoload -(eshell-defgroup eshell-cmpl nil +(progn +(defgroup eshell-cmpl nil "This module provides a programmable completion function bound to the TAB key, which allows for completing command names, file names, variable names, arguments, etc." :tag "Argument completion" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-dirs.el' --- lisp/eshell/em-dirs.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-dirs.el 2012-06-27 07:08:06 +0000 @@ -47,14 +47,15 @@ (require 'esh-opt) ;;;###autoload -(eshell-defgroup eshell-dirs nil +(progn +(defgroup eshell-dirs nil "Directory navigation involves changing directories, examining the current directory, maintaining a directory stack, and also keeping track of a history of the last directory locations the user was in. Emacs does provide standard Lisp definitions of `pwd' and `cd', but they lack somewhat in feel from the typical shell equivalents." :tag "Directory navigation" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-glob.el' --- lisp/eshell/em-glob.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-glob.el 2012-06-27 07:08:06 +0000 @@ -53,11 +53,12 @@ (require 'esh-util) ;;;###autoload -(eshell-defgroup eshell-glob nil +(progn +(defgroup eshell-glob nil "This module provides extended globbing syntax, similar what is used by zsh for filename generation." :tag "Extended filename globbing" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-hist.el' --- lisp/eshell/em-hist.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-hist.el 2012-06-27 07:08:06 +0000 @@ -63,10 +63,11 @@ (require 'eshell) ;;;###autoload -(eshell-defgroup eshell-hist nil +(progn +(defgroup eshell-hist nil "This module provides command history management." :tag "History list management" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-ls.el' --- lisp/eshell/em-ls.el 2012-02-11 22:13:29 +0000 +++ lisp/eshell/em-ls.el 2012-06-27 07:08:06 +0000 @@ -33,14 +33,15 @@ (require 'esh-opt) ;;;###autoload -(eshell-defgroup eshell-ls nil +(progn +(defgroup eshell-ls nil "This module implements the \"ls\" utility fully in Lisp. If it is passed any unrecognized command switches, it will revert to the operating system's version. This version of \"ls\" uses text properties to colorize its output based on the setting of `eshell-ls-use-colors'." :tag "Implementation of `ls' in Lisp" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-pred.el' --- lisp/eshell/em-pred.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-pred.el 2012-06-27 07:08:06 +0000 @@ -49,13 +49,14 @@ (eval-when-compile (require 'eshell)) ;;;###autoload -(eshell-defgroup eshell-pred nil +(progn +(defgroup eshell-pred nil "This module allows for predicates to be applied to globbing patterns (similar to zsh), in addition to string modifiers which can be applied either to globbing results, variable references, or just ordinary strings." :tag "Value modifiers and predicates" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-prompt.el' --- lisp/eshell/em-prompt.el 2012-06-08 16:39:49 +0000 +++ lisp/eshell/em-prompt.el 2012-06-27 07:08:06 +0000 @@ -29,11 +29,12 @@ (eval-when-compile (require 'eshell)) ;;;###autoload -(eshell-defgroup eshell-prompt nil +(progn +(defgroup eshell-prompt nil "This module provides command prompts, and navigation between them, as is common with most shells." :tag "Command prompts" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-rebind.el' --- lisp/eshell/em-rebind.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-rebind.el 2012-06-27 07:08:06 +0000 @@ -26,7 +26,8 @@ (eval-when-compile (require 'eshell)) ;;;###autoload -(eshell-defgroup eshell-rebind nil +(progn +(defgroup eshell-rebind nil "This module allows for special keybindings that only take effect while the point is in a region of input text. By default, it binds C-a to move to the beginning of the input text (rather than just the @@ -37,7 +38,7 @@ `backward-word', `previous-line', etc. This module intends to mimic the behavior of normal shells while the user editing new input text." :tag "Rebind keys at input" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-script.el' --- lisp/eshell/em-script.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-script.el 2012-06-27 07:08:06 +0000 @@ -26,11 +26,12 @@ (require 'eshell) ;;;###autoload -(eshell-defgroup eshell-script nil +(progn +(defgroup eshell-script nil "This module allows for the execution of files containing Eshell commands, as a script file." :tag "Running script files." - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-smart.el' --- lisp/eshell/em-smart.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-smart.el 2012-06-27 07:08:06 +0000 @@ -71,7 +71,8 @@ (eval-when-compile (require 'eshell)) ;;;###autoload -(eshell-defgroup eshell-smart nil +(progn +(defgroup eshell-smart nil "This module combines the facility of normal, modern shells with some of the edit/review concepts inherent in the design of Plan 9's 9term. See the docs for more details. @@ -80,7 +81,7 @@ it to get a real sense of how it works." :tag "Smart display of output" ;; :link '(info-link "(eshell)Smart display of output") - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-term.el' --- lisp/eshell/em-term.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-term.el 2012-06-27 07:08:06 +0000 @@ -35,14 +35,15 @@ (require 'term) ;;;###autoload -(eshell-defgroup eshell-term nil +(progn +(defgroup eshell-term nil "This module causes visual commands (e.g., 'vi') to be executed by the `term' package, which comes with Emacs. This package handles most of the ANSI control codes, allowing curses-based applications to run within an Emacs window. The variable `eshell-visual-commands' defines which commands are considered visual in nature." :tag "Running visual commands" - :group 'eshell-module) + :group 'eshell-module)) ;;; User Variables: === modified file 'lisp/eshell/em-unix.el' --- lisp/eshell/em-unix.el 2012-02-28 08:17:21 +0000 +++ lisp/eshell/em-unix.el 2012-06-27 07:08:06 +0000 @@ -40,7 +40,8 @@ (require 'pcomplete) ;;;###autoload -(eshell-defgroup eshell-unix nil +(progn +(defgroup eshell-unix nil "This module defines many of the more common UNIX utilities as aliases implemented in Lisp. These include mv, ln, cp, rm, etc. If the user passes arguments which are too complex, or are unrecognized @@ -51,7 +52,7 @@ \(such as being able to use `kill' to kill Eshell background processes by name)." :tag "UNIX commands in Lisp" - :group 'eshell-module) + :group 'eshell-module)) (defcustom eshell-unix-load-hook nil "A list of functions to run when `eshell-unix' is loaded." === modified file 'lisp/eshell/em-xtra.el' --- lisp/eshell/em-xtra.el 2012-02-28 08:17:21 +0000 +++ lisp/eshell/em-xtra.el 2012-06-27 07:08:06 +0000 @@ -29,13 +29,14 @@ (require 'compile) ;;;###autoload -(eshell-defgroup eshell-xtra nil +(progn +(defgroup eshell-xtra nil "This module defines some extra alias functions which are entirely optional. They can be viewed as samples for how to write Eshell alias functions, or as aliases which make some of Emacs's behavior more naturally accessible within Emacs." :tag "Extra alias functions" - :group 'eshell-module) + :group 'eshell-module)) ;;; Functions: === modified file 'lisp/eshell/esh-module.el' --- lisp/eshell/esh-module.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/esh-module.el 2012-06-27 07:08:06 +0000 @@ -36,7 +36,9 @@ ;; load the defgroup's for the standard extension modules, so that ;; documentation can be provided when the user customize's -;; `eshell-modules-list'. +;; `eshell-modules-list'. We use "(progn (defgroup ..." in each file +;; to force the autoloader into including the entire defgroup, rather +;; than an abbreviated version. (load "esh-groups" nil 'nomessage) ;;; User Variables: === modified file 'lisp/eshell/eshell.el' --- lisp/eshell/eshell.el 2012-04-22 13:58:00 +0000 +++ lisp/eshell/eshell.el 2012-06-27 07:08:06 +0000 @@ -236,10 +236,6 @@ :version "21.1" :group 'applications) -;; This is hack to force make-autoload to put the whole definition -;; into the autoload file (see esh-module.el). -(defalias 'eshell-defgroup 'defgroup) - ;;;_* User Options ;; ;; The following user options modify the behavior of Eshell overall. ------------------------------------------------------------ revno: 108761 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-06-26 23:55:01 -0700 message: Fix ChangeLog entry from trunk r108758. For some reason, this included an extraneous entry from the emacs-24 branch. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 05:47:14 +0000 +++ src/ChangeLog 2012-06-27 06:55:01 +0000 @@ -175,11 +175,6 @@ when time_t is unsigned and as wide as intmax_t. See . -2012-06-26 Andreas Schwab - - * gnutls.c (emacs_gnutls_handshake): Only retry if - GNUTLS_E_INTERRUPTED. - 2012-06-23 Eli Zaretskii * dispnew.c (sit_for, Fsleep_for):