Merge from mainline.

This commit is contained in:
Xue Fuqiao 2013-06-12 20:12:47 +08:00
commit 6186a2767f
55 changed files with 1464 additions and 819 deletions

2
.gitignore vendored
View file

@ -10,8 +10,10 @@ lib/Makefile.in
src/config.in
autom4te.cache
makefile
TAGS
*~
/README.W32
/bin/
/site-lisp/
/leim/ja-dic/

View file

@ -1,3 +1,14 @@
2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
--without-all should imply --with-file-notification=no. (Bug#14569)
* configure.ac (with_file_notification): Default to $with_features.
2013-06-09 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:
2013-06-02 sig2str: port to C++
2013-05-29 c-ctype, regex, verify: port to gcc -std=c90 -pedantic
2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
* configure.ac (HAVE_GLIB): Only set XGSELOBJ if HAVE_NS = no.
@ -6,8 +17,8 @@
2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
* Makefile.in (msys_to_w32): Modify to support d:\foo file names.
(msys_lisppath_to_w32, msys_prefix_subst, msys_sed_sh_escape): New
variables.
(msys_lisppath_to_w32, msys_prefix_subst, msys_sed_sh_escape):
New variables.
(epaths-force-w32): Use them. (Bug#14513)
2013-06-03 Michael Albinus <michael.albinus@gmx.de>
@ -28,7 +39,7 @@
* configure.ac (file-notification): New option, replaces inotify option.
(HAVE_W32): Remove w32notify.o.
(with_file_notification): Add checks for glib and w32. Adapt check
(with_file_notification): Add checks for glib and w32. Adapt check
for inotify.
(Summary): Add entry for file notification.
@ -118,7 +129,7 @@
2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
* configure.ac: Remove -with-acl option, since Gnulib does that for
us now.
(LIBACL_LIBS): Remove; no longer needed.
@ -490,7 +501,7 @@
2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
Fix permissions bugs with setgid directories etc. (Bug#13125)
Fix permissions bugs with setgid directories etc. (Bug#13125)
* configure.ac (BSD4_2): Remove; no longer needed.
2012-12-13 Glenn Morris <rgm@gnu.org>
@ -2180,7 +2191,7 @@
2012-02-05 Christoph Scholtes <cschol2112@googlemail.com>
* make-dist (README.W32): Include file in source tarball. (Bug#9750)
* make-dist (README.W32): Include file in source tarball. (Bug#9750)
* lib/makefile.w32-in (PRAGMA_SYSTEM_HEADER): Move to platform
specific makefiles to support getopt_.h generation with MSVC.

10
autogen/configure vendored
View file

@ -4355,7 +4355,7 @@ this option's value should be \`yes', \`no', \`gfile', \`inotify' or \`w32'.
with_file_notification=$val
else
with_file_notification=yes
with_file_notification=$with_features
fi
@ -12032,7 +12032,9 @@ if test "${with_file_notification}" = "yes"; then
if test "${opsys}" = "mingw32"; then
with_file_notification=w32
else
with_file_notification=gfile
if test "${with_ns}" != yes; then
with_file_notification=gfile
fi
fi
fi
@ -16197,7 +16199,9 @@ if test "${links_glib}" = "yes"; then
$as_echo "#define HAVE_GLIB 1" >>confdefs.h
XGSELOBJ=xgselect.o
if test "$HAVE_NS" = no;then
XGSELOBJ=xgselect.o
fi
fi

View file

@ -216,7 +216,7 @@ this option's value should be `yes', `no', `gfile', `inotify' or `w32'.
esac
with_file_notification=$val
],
[with_file_notification=yes])
[with_file_notification=$with_features])
## For the times when you want to build Emacs but don't have
## a suitable makeinfo, and can live without the manuals.

View file

@ -1,3 +1,8 @@
2013-06-11 Glenn Morris <rgm@gnu.org>
* maintaining.texi (VC Directory Commands): Copyedit.
(Branches): Put back milder version of pre 2013-06-07 text.
2013-06-09 Xue Fuqiao <xfq.free@gmail.com>
* vc1-xtra.texi (Revision Tags): Add a cross reference.
@ -5,8 +10,7 @@
2013-06-07 Xue Fuqiao <xfq.free@gmail.com>
* maintaining.texi (Branches): Remove text copied from other
sources.
* maintaining.texi (Branches): Remove text copied from other sources.
2013-06-05 Alan Mackenzie <acm@muc.de>

View file

@ -1204,7 +1204,7 @@ files and directories.
@item x
Hide files with @samp{up-to-date} status
(@code{vc-dir-hide-up-to-date}). With a prefix argument, hide items
that are in state of item at point from display.
whose state is that of the item at point.
@end table
@findex vc-dir-mark
@ -1267,7 +1267,10 @@ bring them back at a later time).
@cindex branch (version control)
One use of version control is to support multiple independent lines
of development, which are called @dfn{branches}.
of development, which are called @dfn{branches}. Amongst other
things, branches can be used for maintaining separate ``stable'' and
``development'' versions of a program, and for developing unrelated
features in isolation from one another.
VC's support for branch operations is currently fairly limited. For
decentralized version control systems, it provides commands for

View file

@ -1,3 +1,22 @@
2013-06-11 Xue Fuqiao <xfq.free@gmail.com>
* files.texi (File Name Expansion): Make the example more
intuitive.
2013-06-10 Paul Eggert <eggert@cs.ucla.edu>
Documentation fix for 'ls' and hard links.
* compile.texi (Compilation Functions):
* files.texi (File Attributes, Changing Files):
Use current format for GNU 'ls' output.
(File Attributes): Fix problem introduced in previous change:
the link count is the number of hard links, not the number
of hard links + 1.
2013-06-10 Xue Fuqiao <xfq.free@gmail.com>
* files.texi (File Attributes): Fix typo.
2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
* functions.texi (Lambda Expressions): Lambda expressions don't

View file

@ -181,8 +181,8 @@ after compiling it. Interactively, @var{load} is the prefix argument.
@example
@group
% ls -l push*
-rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el
$ ls -l push*
-rw-r--r-- 1 lewis lewis 791 Oct 5 20:31 push.el
@end group
@group
@ -191,9 +191,9 @@ after compiling it. Interactively, @var{load} is the prefix argument.
@end group
@group
% ls -l push*
-rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el
-rw-rw-rw- 1 lewis 638 Oct 8 20:25 push.elc
$ ls -l push*
-rw-r--r-- 1 lewis lewis 791 Oct 5 20:31 push.el
-rw-rw-rw- 1 lewis lewis 638 Oct 8 20:25 push.elc
@end group
@end example
@end deffn
@ -232,7 +232,7 @@ If @var{noforce} is non-@code{nil}, this function does not recompile
files that have an up-to-date @samp{.elc} file.
@example
% emacs -batch -f batch-byte-compile *.el
$ emacs -batch -f batch-byte-compile *.el
@end example
@end defun

View file

@ -1139,8 +1139,8 @@ both others and group, and that the sticky bit is set.
@end group
@group
% ls -l diffs
-rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs
$ ls -l diffs
-rw-rw-rw- 1 lewis lewis 3063 Oct 30 16:00 diffs
@end group
@end example
@ -1166,17 +1166,17 @@ target. However, they both recursively follow symbolic links at all
levels of parent directories.
@defun file-nlinks filename
This functions returns the number of names (i.e., hard links) that
file @var{filename} has. If the file does not exist, then this function
This function returns the number of names (i.e., hard links) that
file @var{filename} has. If the file does not exist, this function
returns @code{nil}. Note that symbolic links have no effect on this
function, because they are not considered to be names of the files they
link to.
function, because they are not considered to be names of the files
they link to.
@example
@group
% ls -l foo*
-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo
-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo1
$ ls -l foo*
-rw-rw-rw- 2 rms rms 4 Aug 19 01:27 foo
-rw-rw-rw- 2 rms rms 4 Aug 19 01:27 foo1
@end group
@group
@ -1477,9 +1477,9 @@ In the first part of the following example, we list two files,
@example
@group
% ls -li fo*
81908 -rw-rw-rw- 1 rms 29 Aug 18 20:32 foo
84302 -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3
$ ls -li fo*
81908 -rw-rw-rw- 1 rms rms 29 Aug 18 20:32 foo
84302 -rw-rw-rw- 1 rms rms 24 Aug 18 20:31 foo3
@end group
@end example
@ -1494,10 +1494,10 @@ the files again. This shows two names for one file, @file{foo} and
@end group
@group
% ls -li fo*
81908 -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo2
84302 -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3
$ ls -li fo*
81908 -rw-rw-rw- 2 rms rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 2 rms rms 29 Aug 18 20:32 foo2
84302 -rw-rw-rw- 1 rms rms 24 Aug 18 20:31 foo3
@end group
@end example
@ -1519,10 +1519,10 @@ contents of @file{foo3} are lost.
@end group
@group
% ls -li fo*
81908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo2
81908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo3
$ ls -li fo*
81908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo2
81908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo3
@end group
@end example
@ -2105,10 +2105,6 @@ start with @samp{~}.) Otherwise, the current buffer's value of
(expand-file-name "foo" "/usr/spool/")
@result{} "/usr/spool/foo"
@end group
@group
(expand-file-name "$HOME/foo")
@result{} "/xcssun/users/rms/lewis/$HOME/foo"
@end group
@end example
If the part of the combined file name before the first slash is
@ -2142,7 +2138,14 @@ This is for the sake of filesystems that have the concept of a
@file{/../} is interpreted exactly the same as @file{/}.
Note that @code{expand-file-name} does @emph{not} expand environment
variables; only @code{substitute-in-file-name} does that.
variables; only @code{substitute-in-file-name} does that:
@example
@group
(expand-file-name "$HOME/foo")
@result{} "/xcssun/users/rms/lewis/$HOME/foo"
@end group
@end example
Note also that @code{expand-file-name} does not follow symbolic links
at any level. This results in a difference between the way

View file

@ -1,3 +1,13 @@
2013-06-10 Aidan Gauland <aidalgol@amuri.net>
* eshell.texi (Input/Output): Expand to cover new visual-command
options, eshell-visual-subcommands and eshell-visual-options.
Divide into separate Visual Commands and Redirection sections.
2013-06-10 Glenn Morris <rgm@gnu.org>
* epa.texi (Cryptographic operations on files): Update epa-decrypt-file.
2013-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Article Date):

View file

@ -240,8 +240,9 @@ you answered yes, it will let you select the signing keys.
@node Cryptographic operations on files
@section Cryptographic operations on files
@deffn Command epa-decrypt-file file
Decrypt @var{file}.
@deffn Command epa-decrypt-file file &optional output
Decrypt @var{file}. If you do not specify the name @var{output} to
use for the decrypted file, this function prompts for the value to use.
@end deffn
@deffn Command epa-verify-file file

View file

@ -701,14 +701,25 @@ groups ``eshell-glob'' and ``eshell-pred''.
@node Input/Output
@chapter Input/Output
Since Eshell does not communicate with a terminal like most command
shells, IO is a little different. If you try to run programs from
within Eshell that are not line-oriented, such as programs that use
ncurses, you will just get garbage output, since the Eshell buffer is
not a terminal emulator. Eshell solves this problem by running
specified commands in Emacs's terminal emulator; to let Eshell know
which commands need to be run in a terminal, add them to the list
@var{eshell-visual-commands}.
shells, IO is a little different.
@section Visual Commands
If you try to run programs from within Eshell that are not
line-oriented, such as programs that use ncurses, you will just get
garbage output, since the Eshell buffer is not a terminal emulator.
Eshell solves this problem by running such programs in Emacs's
terminal emulator.
Programs that need a terminal to display output properly are referred
to in this manual as ``visual commands,'' because they are not simply
line-oriented. You must tell Eshell which commands are visual, by
adding them to @var{eshell-visual-commands}; for commands that are
visual for only certain @emph{sub}-commands -- e.g. @samp{git log} but
not @samp{git status} -- use @var{eshell-visual-subcommands}; and for
commands that are visual only when passed certain options, use
@var{eshell-visual-options}.
@section Redirection
Redirection is mostly the same in Eshell as it is in other command
shells. The output redirection operators @code{>} and @code{>>} as
well as pipes are supported, but there is not yet any support for

View file

@ -445,6 +445,7 @@ file using `set-file-extended-attributes'.
*** `minibuffer-completion-contents'
*** `isearch-nonincremental-exit-minibuffer'
*** `isearch-filter-visible'
*** `generic-make-keywords-list'
** `with-wrapper-hook' is obsoleted by `add-function'.
The few hooks that used with-wrapper-hook are replaced as follows:

View file

@ -136,7 +136,8 @@ extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
/* ASCII optimizations. */

View file

@ -27,9 +27,17 @@
/* Size of a buffer needed to hold a signal name like "HUP". */
# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1)
#ifdef __cplusplus
extern "C" {
#endif
int sig2str (int, char *);
int str2sig (char const *, int *);
#ifdef __cplusplus
}
#endif
#endif
/* An upper bound on signal numbers allowed by the system. */

View file

@ -31,7 +31,9 @@
Use this only with GCC. If we were willing to slow 'configure'
down we could also use it with other compilers, but since this
affects only the quality of diagnostics, why bother? */
# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus
# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
&& (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
&& !defined __cplusplus)
# define _GL_HAVE__STATIC_ASSERT 1
# endif
/* The condition (99 < __GNUC__) is temporary, until we know about the

View file

@ -1,7 +1,147 @@
2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
* ibuf-ext.el (ibuffer-mark-help-buffers): Doc fix.
2013-06-12 Andreas Schwab <schwab@suse.de>
* international/mule.el (auto-coding-alist): Use utf-8-emacs-unix
for auto-save files.
2013-06-12 Glenn Morris <rgm@gnu.org>
* ido.el (ido-delete-ignored-files): Remove.
(ido-wide-find-dirs-or-files, ido-make-file-list-1):
Go back to calling ido-ignore-item-p directly.
2013-06-12 Eyal Lotem <eyal.lotem@gmail.com> (tiny change)
* ido.el (ido-wide-find-dirs-or-files): Respect ido-case-fold.
* ido.el (ido-delete-ignored-files): New function,
split from ido-make-file-list-1.
(ido-wide-find-dirs-or-files): Maybe ignore files. (Bug#13003)
(ido-make-file-list-1): Use ido-delete-ignored-files.
2013-06-12 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (inferior-octave-startup)
(inferior-octave-completion-table)
(inferior-octave-track-window-width-change)
(octave-eldoc-function-signatures, octave-help)
(octave-find-definition): Use single quoted strings.
(inferior-octave-startup-args): Change default value.
(inferior-octave-startup): Do not hard code "-i" and
"--no-line-editing".
(inferior-octave-resync-dirs): Add optional arg NOERROR.
(inferior-octave-directory-tracker): Use it.
(octave-goto-function-definition): Robustify.
(octave-help): Support highlighting operators in 'See also'.
(octave-find-definition): Find subfunctions only in Octave mode.
2013-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
* help-fns.el (help-fns--compiler-macro): If the handler function is
named, then put a link to it.
* help-mode.el (help-function-cmacro): Adjust regexp for cl-lib names.
* emacs-lisp/cl-macs.el (cl--compiler-macro-typep): New function.
(cl-typep): Use it.
(cl-eval-when): Simplify debug spec.
(cl-define-compiler-macro): Use eval-and-compile. Give a name to the
compiler-macro function instead of setting `compiler-macro-file'.
2013-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
Daniel Hackney <dan@haxney.org>
First part of Daniel Hackney's patch to package.el.
* emacs-lisp/package.el: Use defstruct.
(package-desc): New, main struct.
(package--bi-desc, package--ac-desc): New structs, used to describe the
format in external files.
(package-desc-vers): Replace with package-desc-version accessor.
(package-desc-doc): Replace with package-desc-summary accessor.
(package-activate-1): Remove `package' arg since the pkg-vec now
includes the name.
(define-package): Use package-desc-from-define.
(package-unpack-single): Change file-name arg to be a symbol.
(package--add-to-archive-contents): Use package-desc-create and new
accessor functions to package--ac-desc.
(package-buffer-info, package-tar-file-info): Return a package-desc.
(package-install-from-buffer): Remove `type' argument. Change pkg-info
arg to be a package-desc.
(package-install-file): Adjust accordingly. Use \' to match EOS.
(package--from-builtin): New function.
(describe-package-1, package-menu--generate): Use it.
(package--make-autoloads-and-compile): Change name arg to be a symbol.
(package-generate-autoloads): Idem and return the name of the file.
* emacs-lisp/package-x.el (package-upload-buffer-internal):
Change pkg-info arg to be a package-desc.
Use package-make-ac-desc.
(package-upload-file): Use \' to match EOS.
* finder.el (finder-compile-keywords): Use package-make-builtin.
2013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
* vc/vc.el (vc-deduce-fileset): Change error message.
(vc-read-backend): New function.
(vc-next-action): Use it.
* subr.el (function-arity): Remove (mistakenly added) (bug#14590).
* progmodes/prolog.el (prolog-make-keywords-regexp): Remove.
(prolog-font-lock-keywords): Use regexp-opt instead.
Don't manually highlight strings.
(prolog-mode-variables): Simplify comment-start-skip.
(prolog-consult-compile): Use display-buffer. Remove unused old-filter.
* emacs-lisp/generic.el (generic--normalise-comments)
(generic-set-comment-syntax, generic-set-comment-vars): New functions.
(generic-mode-set-comments): Use them.
(generic-bracket-support): Use setq-local.
(generic-make-keywords-list): Declare obsolete.
2013-06-11 Glenn Morris <rgm@gnu.org>
* emacs-lisp/lisp-mode.el (lisp-mode-variables):
Prettify after setting font-lock-defaults. (Bug#14574)
2013-06-11 Juanma Barranquero <lekktu@gmail.com>
* replace.el (query-replace, occur-read-regexp-defaults-function)
(replace-search):
* subr.el (declare-function, number-sequence, local-set-key)
(substitute-key-definition, locate-user-emacs-file)
(with-silent-modifications, split-string, eval-after-load):
Fix typos, remove unneeded backslashes and reflow some docstrings.
2013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
* international/mule-conf.el (file-coding-system-alist): Use utf-8 as
default for Elisp files.
2013-06-11 Glenn Morris <rgm@gnu.org>
* vc/log-view.el (log-view-mode-map): Inherit from special-mode-map,
although define-derived-mode was doing this anyway. (Bug#14583)
2013-06-10 Juanma Barranquero <lekktu@gmail.com>
* allout.el (allout-encryption-plaintext-sanitization-regexps):
Fix make-variable-buffer-local call to refer to the correct variable.
2013-06-10 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-term.el (eshell-visual-commands)
(eshell-visual-subcommands, eshell-visual-options):
Add summary line to docstrings. Add cross-references.
2013-06-10 Glenn Morris <rgm@gnu.org>
* epa.el (epa-read-file-name): New function. (Bug#14510)
(epa-decrypt-file): Make plain-file optional. Use epa-read-file-name.
2013-06-09 Xue Fuqiao <xfq.free@gmail.com>
* vc/vc-cvs.el (vc-cvs-stay-local): Doc fix.
* vc/vc-hooks.el (vc-stay-local): Doc fix.
2013-06-09 Aidan Gauland <aidalgol@amuri.net>
@ -12,9 +152,11 @@
2013-06-09 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-term.el (eshell-visual-command-p): New function.
(eshell-term-initialize): Move long lambda to separate function eshell-visual-command-p.
* eshell/em-dirs.el (eshell-dirs-initialise): Add missing #' to lambda.
* eshell/em-script.el (eshell-script-initialize): Add missing #' to lambda.
(eshell-term-initialize): Move long lambda to separate function
eshell-visual-command-p.
* eshell/em-dirs.el (eshell-dirs-initialise):
* eshell/em-script.el (eshell-script-initialize):
Add missing #' to lambda.
2013-06-08 Leo Liu <sdl.web@gmail.com>
@ -235,7 +377,7 @@
(auto-revert-notify-event-p, auto-revert-notify-event-file-name)
(auto-revert-notify-handler): Handle also gfilenotify.
* subr.el (file-notify-handle-event): New defun. Replacing ...
* subr.el (file-notify-handle-event): New defun. Replacing ...
(inotify-event-p, inotify-handle-event, w32notify-handle-event):
Remove.
@ -347,10 +489,10 @@
(eshell-find-interpreter): Add new second parameter ARGS.
* eshell/em-script.el (eshell-script-initialize): Add second arg
to the function added as MATCH to `eshell-interpreter-alist'
to the function added as MATCH to `eshell-interpreter-alist'.
* eshell/em-dirs.el (eshell-dirs-initialize): Add second arg to
the function added as MATCH to `eshell-interpreter-alist'
the function added as MATCH to `eshell-interpreter-alist'.
* eshell/em-term.el (eshell-visual-subcommands): New defcustom.
(eshell-visual-options): New defcustom.
@ -2255,7 +2397,7 @@
* comint.el (comint-dynamic-complete-functions, comint-mode-map):
`comint-dynamic-complete' is obsolete since 24.1, replaced by
`completion-at-point'. (Bug#13774)
`completion-at-point'. (Bug#13774)
* startup.el (normal-no-mouse-startup-screen): Bug fix, the
default key binding for `describe-distribution' has been moved to
@ -2284,7 +2426,8 @@
* comint.el (comint-redirect-original-filter-function): Remove.
(comint-redirect-cleanup, comint-redirect-send-command-to-process):
* vc/vc-cvs.el (vc-cvs-annotate-process-filter,vc-cvs-annotate-command):
* vc/vc-cvs.el (vc-cvs-annotate-process-filter)
(vc-cvs-annotate-command):
* progmodes/octave-inf.el (inferior-octave-send-list-and-digest):
* progmodes/prolog.el (prolog-consult-compile):
* progmodes/gdb-mi.el (gdb, gdb--check-interpreter):
@ -2723,7 +2866,6 @@
* emacs-lisp/package.el (package-pinned-packages): New var.
(package--add-to-archive-contents): Obey it (bug#14118).
2013-04-03 Alan Mackenzie <acm@muc.de>
Handle `parse-partial-sexp' landing inside a comment opener (Bug#13244).
@ -4954,7 +5096,7 @@
2013-01-12 Eli Zaretskii <eliz@gnu.org>
* autorevert.el (auto-revert-notify-handler): Fix filtering of
file notification by ACTION. For filtering by file name, compare
file notification by ACTION. For filtering by file name, compare
only the non-directory part of the file name.
2013-01-12 Stefan Monnier <monnier@iro.umontreal.ca>
@ -5037,7 +5179,7 @@
2013-01-11 Julien Danjou <julien@danjou.info>
* color.el (color-rgb-to-hsv): Fix conversion computing in case min and
max are almost equal. Also return the correct value for V which is
max are almost equal. Also return the correct value for V which is
already between 0 and 1.
2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
@ -5491,7 +5633,7 @@
2012-12-31 Jürgen Hötzel <juergen@archlinux.org>
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
(No device connected, invalid device name). (Bug #13299)
(No device connected, invalid device name). (Bug #13299)
2012-12-31 Martin Rudalics <rudalics@gmx.at>
@ -5876,7 +6018,7 @@
2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
Fix permissions bugs with setgid directories etc. (Bug#13125)
Fix permissions bugs with setgid directories etc. (Bug#13125)
* files.el (backup-buffer): Don't rely on 9th output of
file-attributes, as it's now a placeholder. Instead, use the new
optional arg of file-ownership-preserved-p.
@ -6334,7 +6476,7 @@
* textmodes/ispell.el (ispell-init-process)
(ispell-start-process, ispell-internal-change-dictionary):
Make sure personal dictionary name is expanded after initial
`default-directory' value. Use expanded strings for
`default-directory' value. Use expanded strings for
keep/restart checks and for value (Bug#13019).
2012-12-03 Jay Belanger <jay.p.belanger@gmail.com>
@ -7016,7 +7158,7 @@
* play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
Don't signal an error with a score that is too low to add to the
list of top scores. (Bug#12779)
list of top scores. (Bug#12779)
2012-11-17 Chong Yidong <cyd@gnu.org>
@ -7085,7 +7227,7 @@
* window.el (record-window-buffer)
(display-buffer-record-window): When copying the markers to
window-point preserve window-point-insertion-type. (Bug#12588)
window-point preserve window-point-insertion-type. (Bug#12588)
2012-11-16 Glenn Morris <rgm@gnu.org>
@ -7173,8 +7315,8 @@
(ad-advice-definition): Redefine as functions.
(ad-advice-classes): Move before first use.
(ad-make-origname, ad-set-orig-definition, ad-clear-orig-definition)
(ad-make-mapped-call, ad-make-advised-docstring,ad-make-plain-docstring)
(ad--defalias-fset): Remove functions.
(ad-make-mapped-call, ad-make-advised-docstring)
(ad-make-plain-docstring, ad--defalias-fset): Remove functions.
(ad-make-advicefunname, ad-clear-advicefunname-definition): New funs.
(ad-get-orig-definition): Rewrite.
(ad-make-advised-definition-docstring): Change base docstring.
@ -7522,7 +7664,7 @@
buffer and calls `ispell-buffer' with debugging enabled.
* textmodes/ispell.el (ispell-region): Do not prefix sent string by
comment in autoconf mode. (Bug#12768)
comment in autoconf mode. (Bug#12768)
2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
@ -8667,13 +8809,13 @@
* textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure
that entries with whitespace at various places are found.
Doc fix. Include entries that are cross-referenced from cited entries.
Doc fix. Include entries that are cross-referenced from cited entries.
Include @String definitions in the resulting bib file. Add header
and footer defined in `reftex-create-bibtex-header' and
`reftex-create-bibtex-footer'.
(reftex-do-citation): Make it possible again to insert
non-existent entries. Save match data when asking for optional
arguments. Return all keys, not just the first one.
arguments. Return all keys, not just the first one.
(reftex-all-used-citation-keys): Fix regexp to correctly extract
all citations in the same line.
(reftex-parse-bibtex-entry): Accept additional optional argument
@ -8733,7 +8875,7 @@
* textmodes/reftex-sel.el
(reftex-select-cycle-ref-style-internal): Adapt to new structure
of `reftex-ref-style-alist'. Remove code for testing macro type.
of `reftex-ref-style-alist'. Remove code for testing macro type.
(reftex-select-toggle-varioref)
(reftex-select-toggle-fancyref): Remove.
(reftex-select-cycle-ref-style-internal)
@ -9275,7 +9417,7 @@
* textmodes/bibtex.el (bibtex-autokey-transcriptions):
Transcribe also LaTeX hyphenation.
(bibtex-reformat): Bug fix. Do not quote twice the elements of
(bibtex-reformat): Bug fix. Do not quote twice the elements of
bibtex-reformat-previous-options.
2012-09-23 Roland Winkler <winkler@gnu.org>
@ -12302,7 +12444,7 @@
(xml-name-start-char-re, xml-name-char-re, xml-name-re)
(xml-names-re, xml-nmtoken-re, xml-nmtokens-re, xml-char-ref-re)
(xml-entity-ref, xml-pe-reference-re)
(xml-reference-re,xml-att-value-re, xml-tokenized-type-re)
(xml-reference-re, xml-att-value-re, xml-tokenized-type-re)
(xml-notation-type-re, xml-enumeration-re, xml-enumerated-type-re)
(xml-att-type-re, xml-default-decl-re, xml-att-def-re)
(xml-entity-value-re): Use syntax references in regexps where
@ -20687,7 +20829,7 @@
2011-10-07 Chong Yidong <cyd@stupidchicken.com>
* bindings.el ([M-left],[M-right]): Bind to left-word and
* bindings.el ([M-left], [M-right]): Bind to left-word and
right-word respectively.
2011-10-07 Glenn Morris <rgm@gnu.org>
@ -26009,15 +26151,15 @@
2011-05-10 Jim Meyering <meyering@redhat.com>
Fix doubled-word typos.
* international/quail.el (quail-insert-kbd-layout): and and -> and
* kermit.el: and and -> and
* net/ldap.el (ldap-search-internal): to to -> to
* international/quail.el (quail-insert-kbd-layout): and and -> and.
* kermit.el: and and -> and.
* net/ldap.el (ldap-search-internal): to to -> to.
* progmodes/vhdl-mode.el (vhdl-offsets-alist): Likewise.
* progmodes/js.el (js-mode): and and -> and
* textmodes/artist.el (artist-move-to-xy): at at -> at
(artist-draw-region-trim-line-endings): if if -> if
* progmodes/js.el (js-mode): and and -> and.
* textmodes/artist.el (artist-move-to-xy): at at -> at.
(artist-draw-region-trim-line-endings): if if -> if.
And Safetyc -> Safety.
* textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a
* textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a.
2011-05-10 Glenn Morris <rgm@gnu.org>
Stefan Monnier <monnier@iro.umontreal.ca>

View file

@ -777,7 +777,7 @@
1987-12-21 Richard Stallman (rms@frosted-flakes)
* window.el (split-widow-{vertically,horizontally}):
* window.el (split-window-{vertically,horizontally}):
Make the arg optional.
1987-12-09 Richard Stallman (rms@frosted-flakes)
@ -1392,7 +1392,7 @@
* shell.el: Minor doc fixes.
* rmail.el (rmail-get-new-mail):
Handle errors competently. (Don't attempt to
Handle errors competently. (Don't attempt to
handle them, rather than botching the job)
* rmail.el (rmail-insert-inbox-text):
@ -3032,7 +3032,7 @@
Rename "kill" -> "delete" for both function-names and documentation.
Define C-d as Buffer-menu-delete-backwards. (also in ebuff-menu)
Define C-d as Buffer-menu-delete-backwards (also in ebuff-menu).
Save space: Merge buffer-menu-{execute,do-saves,do-kills}.

View file

@ -1561,7 +1561,7 @@ Each value can be a regexp or a list with a regexp followed by a
substitution string. If it's just a regexp, all its matches are removed
before the text is encrypted. If it's a regexp and a substitution, the
substitution is used against the regexp matches, a la `replace-match'.")
(make-variable-buffer-local 'allout-encryption-text-removal-regexps)
(make-variable-buffer-local 'allout-encryption-plaintext-sanitization-regexps)
;;;_ = allout-encryption-ciphertext-rejection-regexps
(defvar allout-encryption-ciphertext-rejection-regexps nil
"Variable for regexps matching plaintext to remove before encryption.

View file

@ -366,7 +366,7 @@ For example, in the C statement:
If the cursor is on 'this', will move point to the ; after entry.")
(defun semantic-ctxt-end-of-symbol-default (&optional point)
"Move poin to the end of the current symbol under POINT.
"Move point to the end of the current symbol under POINT.
This will move past type/field names when applicable.
Depends on `semantic-type-relation-separator-character', and will
work on C like languages."
@ -422,18 +422,18 @@ work on C like languages."
;; Skip the separator and the symbol.
(goto-char (match-end 0))
(if (looking-at "\\w\\|\\s_")
;; Skip symbols
(forward-sexp 1)
;; No symbol, exit the search...
(setq continuesearch nil))
(setq end (point)))
;; Cont...
)
;; Restore position if we go to far....
(error (goto-char end)) )

View file

@ -396,7 +396,7 @@ decoration API found in this library."
(let ((predicate (semantic-decorate-style-predicate name))
(highlighter (semantic-decorate-style-highlighter name))
(predicatedef (semantic-decorate-style-predicate-default name))
(highlighterdef (semantic-decorate-style-highlighter-default name))
(highlighterdef (semantic-decorate-style-highlighter-default name))
(defaultenable (if (plist-member flags :enabled)
(plist-get flags :enabled)
t))
@ -422,14 +422,14 @@ decoration API found in this library."
(add-to-list 'semantic-decoration-styles
(cons ',(symbol-name name)
,defaultenable))
;; If there is a load file, then create the autload tokens for
;; If there is a load file, then create the autoload tokens for
;; those functions to load the token, but only if the fsym
;; doesn't exist yet.
(when (stringp ,loadfile)
(unless (fboundp ',predicatedef)
(autoload ',predicatedef ',loadfile "Return non-nil to decorate TAG."
nil 'function))
(unless (fboundp ',highlighterdef)
(autoload ',highlighterdef ',loadfile "Decorate TAG."
nil 'function))

View file

@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'.
;;;;;; 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--compiler-macro-cXXr cl--compiler-macro-list*)
;;;;;; "cl-macs" "cl-macs.el" "80cb53f97b21adb6069c43c38a2e094d")
;;;;;; "cl-macs" "cl-macs.el" "fd824d987086eafec0b1cb2efa8312f4")
;;; Generated autoloads from cl-macs.el
(autoload 'cl--compiler-macro-list* "cl-macs" "\
@ -699,9 +699,10 @@ OPTION is either a single keyword or (KEYWORD VALUE) where
KEYWORD can be one of :conc-name, :constructor, :copier, :predicate,
:type, :named, :initial-offset, :print-function, or :include.
Each SLOT may instead take the form (SLOT SLOT-OPTS...), where
SLOT-OPTS are keyword-value pairs for that slot. Currently, only
one keyword is supported, `:read-only'. If this has a non-nil
Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
pairs for that slot.
Currently, only one keyword is supported, `:read-only'. If this has a non-nil
value, that slot cannot be set via `setf'.
\(fn NAME SLOTS...)" nil t)
@ -724,6 +725,8 @@ TYPE is a Common Lisp-style type specifier.
\(fn OBJECT TYPE)" nil nil)
(eval-and-compile (put 'cl-typep 'compiler-macro #'cl--compiler-macro-typep))
(autoload 'cl-check-type "cl-macs" "\
Verify that FORM is of type TYPE; signal an error if not.
STRING is an optional description of the desired type.

View file

@ -584,7 +584,7 @@ If `load' is in WHEN, BODY is evaluated when loaded after top-level compile.
If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level.
\(fn (WHEN...) BODY...)"
(declare (indent 1) (debug ((&rest &or "compile" "load" "eval") body)))
(declare (indent 1) (debug (sexp body)))
(if (and (fboundp 'cl--compiling-file) (cl--compiling-file)
(not cl--not-toplevel) (not (boundp 'for-effect))) ;Horrible kludge.
(let ((comp (or (memq 'compile when) (memq :compile-toplevel when)))
@ -2276,9 +2276,10 @@ OPTION is either a single keyword or (KEYWORD VALUE) where
KEYWORD can be one of :conc-name, :constructor, :copier, :predicate,
:type, :named, :initial-offset, :print-function, or :include.
Each SLOT may instead take the form (SLOT SLOT-OPTS...), where
SLOT-OPTS are keyword-value pairs for that slot. Currently, only
one keyword is supported, `:read-only'. If this has a non-nil
Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
pairs for that slot.
Currently, only one keyword is supported, `:read-only'. If this has a non-nil
value, that slot cannot be set via `setf'.
\(fn NAME SLOTS...)"
@ -2574,9 +2575,16 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc."
(defun cl-typep (object type) ; See compiler macro below.
"Check that OBJECT is of type TYPE.
TYPE is a Common Lisp-style type specifier."
(declare (compiler-macro cl--compiler-macro-typep))
(let ((cl--object object)) ;; Yuck!!
(eval (cl--make-type-test 'cl--object type))))
(defun cl--compiler-macro-typep (form val type)
(if (macroexp-const-p type)
(macroexp-let2 macroexp-copyable-p temp val
(cl--make-type-test temp (cl--const-expr-val type)))
form))
;;;###autoload
(defmacro cl-check-type (form type &optional string)
"Verify that FORM is of type TYPE; signal an error if not.
@ -2635,19 +2643,13 @@ and then returning foo."
(let ((p args) (res nil))
(while (consp p) (push (pop p) res))
(setq args (nconc (nreverse res) (and p (list '&rest p)))))
`(cl-eval-when (compile load eval)
(put ',func 'compiler-macro
(cl-function (lambda ,(if (memq '&whole args) (delq '&whole args)
(cons '_cl-whole-arg args))
,@body)))
;; This is so that describe-function can locate
;; the macro definition.
(let ((file ,(or buffer-file-name
(and (boundp 'byte-compile-current-file)
(stringp byte-compile-current-file)
byte-compile-current-file))))
(if file (put ',func 'compiler-macro-file
(purecopy (file-name-nondirectory file)))))))
(let ((fname (make-symbol (concat (symbol-name func) "--cmacro"))))
`(eval-and-compile
;; Name the compiler-macro function, so that `symbol-file' can find it.
(cl-defun ,fname ,(if (memq '&whole args) (delq '&whole args)
(cons '_cl-whole-arg args))
,@body)
(put ',func 'compiler-macro #',fname))))
;;;###autoload
(defun cl-compiler-macroexpand (form)
@ -2773,12 +2775,6 @@ surrounded by (cl-block NAME ...).
`(cl-getf (symbol-plist ,sym) ,prop ,def)
`(get ,sym ,prop)))
(cl-define-compiler-macro cl-typep (&whole form val type)
(if (macroexp-const-p type)
(macroexp-let2 macroexp-copyable-p temp val
(cl--make-type-test temp (cl--const-expr-val type)))
form))
(dolist (y '(cl-first cl-second cl-third cl-fourth
cl-fifth cl-sixth cl-seventh
cl-eighth cl-ninth cl-tenth

View file

@ -93,6 +93,8 @@
;;; Code:
(eval-when-compile (require 'pcase))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Internal Variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -224,18 +226,11 @@ Some generic modes are defined in `generic-x.el'."
(funcall (intern mode)))
;;; Comment Functionality
(defun generic-mode-set-comments (comment-list)
"Set up comment functionality for generic mode."
(let ((st (make-syntax-table))
(chars nil)
(comstyles))
(make-local-variable 'comment-start)
(make-local-variable 'comment-start-skip)
(make-local-variable 'comment-end)
;; Go through all the comments
(defun generic--normalise-comments (comment-list)
(let ((normalized '()))
(dolist (start comment-list)
(let (end (comstyle ""))
(let (end)
;; Normalize
(when (consp start)
(setq end (cdr start))
@ -244,58 +239,79 @@ Some generic modes are defined in `generic-x.el'."
(cond
((characterp end) (setq end (char-to-string end)))
((zerop (length end)) (setq end "\n")))
(push (cons start end) normalized)))
(nreverse normalized)))
;; Setup the vars for `comment-region'
(if comment-start
;; We have already setup a comment-style, so use style b
(progn
(setq comstyle "b")
(setq comment-start-skip
(concat comment-start-skip "\\|" (regexp-quote start) "+\\s-*")))
;; First comment-style
(setq comment-start start)
(setq comment-end (if (string-equal end "\n") "" end))
(setq comment-start-skip (concat (regexp-quote start) "+\\s-*")))
(defun generic-set-comment-syntax (st comment-list)
"Set up comment functionality for generic mode."
(let ((chars nil)
(comstyles)
(comstyle "")
(comment-start nil))
;; Reuse comstyles if necessary
(setq comstyle
;; Go through all the comments.
(pcase-dolist (`(,start . ,end) comment-list)
(let ((comstyle
;; Reuse comstyles if necessary.
(or (cdr (assoc start comstyles))
(cdr (assoc end comstyles))
comstyle))
;; Otherwise, use a style not yet in use.
(if (not (rassoc "" comstyles)) "")
(if (not (rassoc "b" comstyles)) "b")
"c")))
(push (cons start comstyle) comstyles)
(push (cons end comstyle) comstyles)
;; Setup the syntax table
;; Setup the syntax table.
(if (= (length start) 1)
(modify-syntax-entry (string-to-char start)
(modify-syntax-entry (aref start 0)
(concat "< " comstyle) st)
(let ((c0 (elt start 0)) (c1 (elt start 1)))
;; Store the relevant info but don't update yet
(let ((c0 (aref start 0)) (c1 (aref start 1)))
;; Store the relevant info but don't update yet.
(push (cons c0 (concat (cdr (assoc c0 chars)) "1")) chars)
(push (cons c1 (concat (cdr (assoc c1 chars))
(concat "2" comstyle))) chars)))
(if (= (length end) 1)
(modify-syntax-entry (string-to-char end)
(modify-syntax-entry (aref end 0)
(concat ">" comstyle) st)
(let ((c0 (elt end 0)) (c1 (elt end 1)))
;; Store the relevant info but don't update yet
(let ((c0 (aref end 0)) (c1 (aref end 1)))
;; Store the relevant info but don't update yet.
(push (cons c0 (concat (cdr (assoc c0 chars))
(concat "3" comstyle))) chars)
(push (cons c1 (concat (cdr (assoc c1 chars)) "4")) chars)))))
;; Process the chars that were part of a 2-char comment marker
(with-syntax-table st ;For `char-syntax'.
(dolist (cs (nreverse chars))
(modify-syntax-entry (car cs)
(concat (char-to-string (char-syntax (car cs)))
" " (cdr cs))
st))
st)))))
(defun generic-set-comment-vars (comment-list)
(when comment-list
(setq-local comment-start (caar comment-list))
(setq-local comment-end
(let ((end (cdar comment-list)))
(if (string-equal end "\n") "" end)))
(setq-local comment-start-skip
(concat (regexp-opt (mapcar #'car comment-list))
"+[ \t]*"))
(setq-local comment-end-skip
(concat "[ \t]*" (regexp-opt (mapcar #'cdr comment-list))))))
(defun generic-mode-set-comments (comment-list)
"Set up comment functionality for generic mode."
(let ((st (make-syntax-table))
(comment-list (generic--normalise-comments comment-list)))
(generic-set-comment-syntax st comment-list)
(generic-set-comment-vars comment-list)
(set-syntax-table st)))
(defun generic-bracket-support ()
"Imenu support for [KEYWORD] constructs found in INF, INI and Samba files."
(setq imenu-generic-expression
'((nil "^\\[\\(.*\\)\\]" 1))
imenu-case-fold-search t))
(setq-local imenu-generic-expression '((nil "^\\[\\(.*\\)\\]" 1)))
(setq-local imenu-case-fold-search t))
;;;###autoload
(defun generic-make-keywords-list (keyword-list face &optional prefix suffix)
@ -306,6 +322,7 @@ expression that matches these keywords and concatenates it with
PREFIX and SUFFIX. Then it returns a construct based on this
regular expression that can be used as an element of
`font-lock-keywords'."
(declare (obsolete regexp-opt "24.4"))
(unless (listp keyword-list)
(error "Keywords argument must be a list of strings"))
(list (concat prefix "\\_<"

View file

@ -223,7 +223,6 @@ font-lock keywords will not be case sensitive."
(setq-local imenu-generic-expression lisp-imenu-generic-expression)
(setq-local multibyte-syntax-as-symbol t)
(setq-local syntax-begin-function 'beginning-of-defun)
(prog-prettify-install lisp--prettify-symbols-alist)
(setq font-lock-defaults
`((lisp-font-lock-keywords
lisp-font-lock-keywords-1
@ -231,7 +230,8 @@ font-lock keywords will not be case sensitive."
nil ,keywords-case-insensitive nil nil
(font-lock-mark-block-function . mark-defun)
(font-lock-syntactic-face-function
. lisp-font-lock-syntactic-face-function))))
. lisp-font-lock-syntactic-face-function)))
(prog-prettify-install lisp--prettify-symbols-alist))
(defun lisp-outline-level ()
"Lisp mode `outline-level' function."

View file

@ -162,9 +162,11 @@ DESCRIPTION is the text of the news item."
description
archive-url))
(defun package-upload-buffer-internal (pkg-info extension &optional archive-url)
(declare-function lm-commentary "lisp-mnt" (&optional file))
(defun package-upload-buffer-internal (pkg-desc extension &optional archive-url)
"Upload a package whose contents are in the current buffer.
PKG-INFO is the package info, see `package-buffer-info'.
PKG-DESC is the `package-desc'.
EXTENSION is the file extension, a string. It can be either
\"el\" or \"tar\".
@ -196,18 +198,18 @@ if it exists."
(error "Aborted")))
(save-excursion
(save-restriction
(let* ((file-type (cond
((equal extension "el") 'single)
((equal extension "tar") 'tar)
(t (error "Unknown extension `%s'" extension))))
(file-name (aref pkg-info 0))
(pkg-name (intern file-name))
(requires (aref pkg-info 1))
(desc (if (string= (aref pkg-info 2) "")
(let* ((file-type (package-desc-kind pkg-desc))
(pkg-name (package-desc-name pkg-desc))
(requires (package-desc-reqs pkg-desc))
(desc (if (eq (package-desc-summary pkg-desc)
package--default-summary)
(read-string "Description of package: ")
(aref pkg-info 2)))
(pkg-version (aref pkg-info 3))
(commentary (aref pkg-info 4))
(package-desc-summary pkg-desc)))
(pkg-version (package-desc-version pkg-desc))
(commentary
(pcase file-type
(`single (lm-commentary))
(`tar nil))) ;; FIXME: Get it from the README file.
(split-version (version-to-list pkg-version))
(pkg-buffer (current-buffer)))
@ -215,7 +217,8 @@ if it exists."
;; from `package-archive-upload-base' otherwise.
(let ((contents (or (package--archive-contents-from-url archive-url)
(package--archive-contents-from-file)))
(new-desc (vector split-version requires desc file-type)))
(new-desc (package-make-ac-desc
split-version requires desc file-type)))
(if (> (car contents) package-archive-version)
(error "Unrecognized archive version %d" (car contents)))
(let ((elt (assq pkg-name (cdr contents))))
@ -232,6 +235,7 @@ if it exists."
;; this and the package itself. For now we assume ELPA is
;; writable via file primitives.
(let ((print-level nil)
(print-quoted t)
(print-length nil))
(write-region (concat (pp-to-string contents) "\n")
nil
@ -241,29 +245,29 @@ if it exists."
;; If there is a commentary section, write it.
(when commentary
(write-region commentary nil
(expand-file-name
(concat (symbol-name pkg-name) "-readme.txt")
package-archive-upload-base)))
(expand-file-name
(concat (symbol-name pkg-name) "-readme.txt")
package-archive-upload-base)))
(set-buffer pkg-buffer)
(write-region (point-min) (point-max)
(expand-file-name
(concat file-name "-" pkg-version "." extension)
(format "%s-%s.%s" pkg-name pkg-version extension)
package-archive-upload-base)
nil nil nil 'excl)
;; Write a news entry.
(and package-update-news-on-upload
archive-url
(package--update-news (concat file-name "." extension)
(package--update-news (format "%s.%s" pkg-name extension)
pkg-version desc archive-url))
;; special-case "package": write a second copy so that the
;; installer can easily find the latest version.
(if (string= file-name "package")
(if (eq pkg-name 'package)
(write-region (point-min) (point-max)
(expand-file-name
(concat file-name "." extension)
(format "%s.%s" pkg-name extension)
package-archive-upload-base)
nil nil nil 'ask))))))))
@ -275,8 +279,8 @@ destination, prompt for one."
(save-excursion
(save-restriction
;; Find the package in this buffer.
(let ((pkg-info (package-buffer-info)))
(package-upload-buffer-internal pkg-info "el")))))
(let ((pkg-desc (package-buffer-info)))
(package-upload-buffer-internal pkg-desc "el")))))
(defun package-upload-file (file)
"Upload the Emacs Lisp package FILE to the package archive.
@ -288,12 +292,13 @@ destination, prompt for one."
(interactive "fPackage file name: ")
(with-temp-buffer
(insert-file-contents-literally file)
(let ((info (cond
((string-match "\\.tar$" file) (package-tar-file-info file))
((string-match "\\.el$" file) (package-buffer-info))
(t (error "Unrecognized extension `%s'"
(file-name-extension file))))))
(package-upload-buffer-internal info (file-name-extension file)))))
(let ((pkg-desc
(cond
((string-match "\\.tar\\'" file) (package-tar-file-info file))
((string-match "\\.el\\'" file) (package-buffer-info))
(t (error "Unrecognized extension `%s'"
(file-name-extension file))))))
(package-upload-buffer-internal pkg-desc (file-name-extension file)))))
(defun package-gnus-summary-upload ()
"Upload a package contained in the current *Article* buffer.

View file

@ -170,6 +170,8 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
(require 'tabulated-list)
(defgroup package nil
@ -262,11 +264,8 @@ Lower version numbers than this will probably be understood as well.")
;; We don't prime the cache since it tends to get out of date.
(defvar package-archive-contents nil
"Cache of the contents of the Emacs Lisp Package Archive.
This is an alist mapping package names (symbols) to package
descriptor vectors. These are like the vectors for `package-alist'
but have extra entries: one which is 'tar for tar packages and
'single for single-file packages, and one which is the name of
the archive from which it came.")
This is an alist mapping package names (symbols) to
`package--desc' structures.")
(put 'package-archive-contents 'risky-local-variable t)
(defcustom package-user-dir (locate-user-emacs-file "elpa")
@ -297,6 +296,62 @@ contrast, `package-user-dir' contains packages for personal use."
:group 'package
:version "24.1")
(defvar package--default-summary "No description available.")
(cl-defstruct (package-desc
;; Rename the default constructor from `make-package-desc'.
(:constructor package-desc-create)
;; Has the same interface as the old `define-package',
;; which is still used in the "foo-pkg.el" files. Extra
;; options can be supported by adding additional keys.
(:constructor
package-desc-from-define
(name-string version-string &optional summary requirements
&key kind archive
&aux
(name (intern name-string))
(version (version-to-list version-string))
(reqs (mapcar #'(lambda (elt)
(list (car elt)
(version-to-list (cadr elt))))
(if (eq 'quote (car requirements))
(nth 1 requirements)
requirements))))))
"Structure containing information about an individual package.
Slots:
`name' Name of the package, as a symbol.
`version' Version of the package, as a version list.
`summary' Short description of the package, typically taken from
the first line of the file.
`reqs' Requirements of the package. A list of (PACKAGE
VERSION-LIST) naming the dependent package and the minimum
required version.
`kind' The distribution format of the package. Currently, it is
either `single' or `tar'.
`archive' The name of the archive (as a string) whence this
package came."
name
version
(summary package--default-summary)
reqs
kind
archive)
;; Package descriptor format used in finder-inf.el and package--builtins.
(cl-defstruct (package--bi-desc
(:constructor package-make-builtin (version summary))
(:type vector))
version
reqs
summary)
;; The value is precomputed in finder-inf.el, but don't load that
;; until it's needed (i.e. when `package-initialize' is called).
(defvar package--builtins nil
@ -305,27 +360,14 @@ The actual value is initialized by loading the library
`finder-inf'; this is not done until it is needed, e.g. by the
function `package-built-in-p'.
Each element has the form (PKG . DESC), where PKG is a package
name (a symbol) and DESC is a vector that describes the package.
The vector DESC has the form [VERSION-LIST REQS DOCSTRING].
VERSION-LIST is a version list.
REQS is a list of packages required by the package, each
requirement having the form (NAME VL), where NAME is a string
and VL is a version list.
DOCSTRING is a brief description of the package.")
Each element has the form (PKG . PACKAGE-BI-DESC), where PKG is a package
name (a symbol) and DESC is a `package--bi-desc' structure.")
(put 'package--builtins 'risky-local-variable t)
(defvar package-alist nil
"Alist of all packages available for activation.
Each element has the form (PKG . DESC), where PKG is a package
name (a symbol) and DESC is a vector that describes the package.
The vector DESC has the form [VERSION-LIST REQS DOCSTRING].
VERSION-LIST is a version list.
REQS is a list of packages required by the package, each
requirement having the form (NAME VL) where NAME is a string
and VL is a version list.
DOCSTRING is a brief description of the package.
name (a symbol) and DESC is a `package-desc' structure.
This variable is set automatically by `package-load-descriptor',
called via `package-initialize'. To change which packages are
@ -339,7 +381,10 @@ loaded and/or activated, customize `package-load-list'.")
(defvar package-obsolete-alist nil
"Representation of obsolete packages.
Like `package-alist', but maps package name to a second alist.
The inner alist is keyed by version.")
The inner alist is keyed by version.
Each element of the list is (NAME . VERSION-ALIST), where each
entry in VERSION-ALIST is (VERSION-LIST . PACKAGE-DESC).")
(put 'package-obsolete-alist 'risky-local-variable t)
(defun package-version-join (vlist)
@ -430,26 +475,16 @@ the package by calling `package-load-descriptor'."
;; Actually load the descriptor:
(package-load-descriptor dir subdir))))
(defsubst package-desc-vers (desc)
"Extract version from a package description vector."
(aref desc 0))
(define-obsolete-function-alias 'package-desc-vers 'package-desc-version "24.4")
(defsubst package-desc-reqs (desc)
"Extract requirements from a package description vector."
(aref desc 1))
(define-obsolete-function-alias 'package-desc-doc 'package-desc-summary "24.4")
(defsubst package-desc-doc (desc)
"Extract doc string from a package description vector."
(aref desc 2))
(defsubst package-desc-kind (desc)
"Extract the kind of download from an archive package description vector."
(aref desc 3))
(defun package--dir (name version)
;; FIXME: Keep this as a field in the package-desc.
"Return the directory where a package is installed, or nil if none.
NAME and VERSION are both strings."
(let* ((subdir (concat name "-" version))
NAME is a symbol and VERSION is a string."
(let* ((subdir (format "%s-%s" name version))
(dir-list (cons package-user-dir package-directory-list))
pkg-dir)
(while dir-list
@ -460,9 +495,9 @@ NAME and VERSION are both strings."
(setq dir-list (cdr dir-list)))))
pkg-dir))
(defun package-activate-1 (package pkg-vec)
(let* ((name (symbol-name package))
(version-str (package-version-join (package-desc-vers pkg-vec)))
(defun package-activate-1 (pkg-desc)
(let* ((name (package-desc-name pkg-desc))
(version-str (package-version-join (package-desc-version pkg-desc)))
(pkg-dir (package--dir name version-str)))
(unless pkg-dir
(error "Internal error: unable to find directory for `%s-%s'"
@ -475,8 +510,8 @@ NAME and VERSION are both strings."
(push pkg-dir Info-directory-list))
;; Add to load path, add autoloads, and activate the package.
(push pkg-dir load-path)
(load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
(push package package-activated-list)
(load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t)
(push name package-activated-list)
;; Don't return nil.
t))
@ -489,7 +524,12 @@ specifying the minimum acceptable version."
(version-list-<= min-version (version-to-list emacs-version))
(let ((elt (assq package package--builtins)))
(and elt (version-list-<= min-version
(package-desc-vers (cdr elt)))))))
(package--bi-desc-version (cdr elt)))))))
(defun package--from-builtin (bi-desc)
(package-desc-create :name (pop bi-desc)
:version (package--bi-desc-version bi-desc)
:summary (package--bi-desc-summary bi-desc)))
;; This function goes ahead and activates a newer version of a package
;; if an older one was already activated. This is not ideal; we'd at
@ -504,7 +544,7 @@ Return nil if the package could not be activated."
available-version found)
;; Check if PACKAGE is available in `package-alist'.
(when pkg-vec
(setq available-version (package-desc-vers pkg-vec)
(setq available-version (package-desc-version pkg-vec)
found (version-list-<= min-version available-version)))
(cond
;; If no such package is found, maybe it's built-in.
@ -525,7 +565,7 @@ Return nil if the package could not be activated."
Required package `%s-%s' is unavailable"
package (car fail) (package-version-join (cadr fail)))
;; If all goes well, activate the package itself.
(package-activate-1 package pkg-vec)))))))
(package-activate-1 pkg-vec)))))))
(defun package-mark-obsolete (package pkg-vec)
"Put package on the obsolete list, if not already there."
@ -533,11 +573,11 @@ Required package `%s-%s' is unavailable"
(if elt
;; If this obsolete version does not exist in the list, update
;; it the list.
(unless (assoc (package-desc-vers pkg-vec) (cdr elt))
(setcdr elt (cons (cons (package-desc-vers pkg-vec) pkg-vec)
(unless (assoc (package-desc-version pkg-vec) (cdr elt))
(setcdr elt (cons (cons (package-desc-version pkg-vec) pkg-vec)
(cdr elt))))
;; Make a new association.
(push (cons package (list (cons (package-desc-vers pkg-vec)
(push (cons package (list (cons (package-desc-version pkg-vec)
pkg-vec)))
package-obsolete-alist))))
@ -555,21 +595,17 @@ REQUIREMENTS is a list of dependencies on other packages.
EXTRA-PROPERTIES is currently unused."
(let* ((name (intern name-string))
(version (version-to-list version-string))
(new-pkg-desc
(cons name
(vector version
(mapcar
(lambda (elt)
(list (car elt)
(version-to-list (car (cdr elt)))))
requirements)
docstring)))
(new-pkg-desc (cons name
(package-desc-from-define name-string
version-string
docstring
requirements)))
(old-pkg (assq name package-alist)))
(cond
;; If there's no old package, just add this to `package-alist'.
((null old-pkg)
(push new-pkg-desc package-alist))
((version-list-< (package-desc-vers (cdr old-pkg)) version)
((version-list-< (package-desc-version (cdr old-pkg)) version)
;; Remove the old package and declare it obsolete.
(package-mark-obsolete name (cdr old-pkg))
(setq package-alist (cons new-pkg-desc
@ -577,7 +613,7 @@ EXTRA-PROPERTIES is currently unused."
;; You can have two packages with the same version, e.g. one in
;; the system package directory and one in your private
;; directory. We just let the first one win.
((not (version-list-= (package-desc-vers (cdr old-pkg)) version))
((not (version-list-= (package-desc-version (cdr old-pkg)) version))
;; The package is born obsolete.
(package-mark-obsolete name (cdr new-pkg-desc))))))
@ -603,14 +639,15 @@ EXTRA-PROPERTIES is currently unused."
(defun package-generate-autoloads (name pkg-dir)
(require 'autoload) ;Load before we let-bind generated-autoload-file!
(let* ((auto-name (concat name "-autoloads.el"))
(let* ((auto-name (format "%s-autoloads.el" name))
;;(ignore-name (concat name "-pkg.el"))
(generated-autoload-file (expand-file-name auto-name pkg-dir))
(version-control 'never))
(package-autoload-ensure-default-file generated-autoload-file)
(update-directory-autoloads pkg-dir)
(let ((buf (find-buffer-visiting generated-autoload-file)))
(when buf (kill-buffer buf)))))
(when buf (kill-buffer buf)))
auto-name))
(defvar tar-parse-info)
(declare-function tar-untar-buffer "tar-mode" ())
@ -644,57 +681,62 @@ untar into a directory named DIR; otherwise, signal an error."
;; FIXME: should we delete PKG-DIR if it exists?
(let* ((default-directory (file-name-as-directory package-user-dir)))
(package-untar-buffer dirname)
(package--make-autoloads-and-compile name pkg-dir))))
(package--make-autoloads-and-compile package pkg-dir))))
(defun package--make-autoloads-and-compile (name pkg-dir)
"Generate autoloads and do byte-compilation for package named NAME.
PKG-DIR is the name of the package directory."
(package-generate-autoloads name pkg-dir)
(let ((load-path (cons pkg-dir load-path)))
(let ((auto-name (package-generate-autoloads name pkg-dir))
(load-path (cons pkg-dir load-path)))
;; We must load the autoloads file before byte compiling, in
;; case there are magic cookies to set up non-trivial paths.
(load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
(load auto-name nil t)
;; FIXME: Compilation should be done as a separate, optional, step.
;; E.g. for multi-package installs, we should first install all packages
;; and then compile them.
(byte-recompile-directory pkg-dir 0 t)))
(defun package--write-file-no-coding (file-name)
(let ((buffer-file-coding-system 'no-conversion))
(write-region (point-min) (point-max) file-name)))
(defun package-unpack-single (file-name version desc requires)
(defun package-unpack-single (name version desc requires)
"Install the contents of the current buffer as a package."
;; Special case "package".
(if (string= file-name "package")
;; Special case "package". FIXME: Should this still be supported?
(if (eq name 'package)
(package--write-file-no-coding
(expand-file-name (concat file-name ".el") package-user-dir))
(let* ((pkg-dir (expand-file-name (concat file-name "-"
(expand-file-name (format "%s.el" name) package-user-dir))
(let* ((pkg-dir (expand-file-name (format "%s-%s" name
(package-version-join
(version-to-list version)))
package-user-dir))
(el-file (expand-file-name (concat file-name ".el") pkg-dir))
(pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir)))
(el-file (expand-file-name (format "%s.el" name) pkg-dir))
(pkg-file (expand-file-name (format "%s-pkg.el" name) pkg-dir)))
(make-directory pkg-dir t)
(package--write-file-no-coding el-file)
(let ((print-level nil)
(print-quoted t)
(print-length nil))
(write-region
(concat
(prin1-to-string
(list 'define-package
file-name
(symbol-name name)
version
desc
(list 'quote
;; Turn version lists into string form.
(mapcar
(lambda (elt)
(list (car elt)
(package-version-join (cadr elt))))
requires))))
(when requires ;Don't bother quoting nil.
(list 'quote
;; Turn version lists into string form.
(mapcar
(lambda (elt)
(list (car elt)
(package-version-join (cadr elt))))
requires)))))
"\n")
nil
pkg-file
nil nil nil 'excl))
(package--make-autoloads-and-compile file-name pkg-dir))))
(package--make-autoloads-and-compile name pkg-dir))))
(defmacro package--with-work-buffer (location file &rest body)
"Run BODY in a buffer containing the contents of FILE at LOCATION.
@ -744,7 +786,7 @@ It will move point to somewhere in the headers."
(let ((location (package-archive-base name))
(file (concat (symbol-name name) "-" version ".el")))
(package--with-work-buffer location file
(package-unpack-single (symbol-name name) version desc requires))))
(package-unpack-single name version desc requires))))
(defun package-download-tar (name version)
"Download and install a tar package."
@ -762,7 +804,7 @@ MIN-VERSION should be a version list."
(let ((pkg-desc (assq package package-alist)))
(if pkg-desc
(version-list-<= min-version
(package-desc-vers (cdr pkg-desc)))
(package-desc-version (cdr pkg-desc)))
;; Also check built-in packages.
(package-built-in-p package min-version))))
@ -785,7 +827,7 @@ not included in this list."
(unless (package-installed-p next-pkg next-version)
;; A package is required, but not installed. It might also be
;; blocked via `package-load-list'.
(let ((pkg-desc (assq next-pkg package-archive-contents))
(let ((pkg-desc (cdr (assq next-pkg package-archive-contents)))
hold)
(when (setq hold (assq next-pkg package-load-list))
(setq hold (cadr hold))
@ -805,17 +847,17 @@ but version %s required"
(symbol-name next-pkg)
(package-version-join next-version)))
(unless (version-list-<= next-version
(package-desc-vers (cdr pkg-desc)))
(package-desc-version pkg-desc))
(error
"Need package `%s-%s', but only %s is available"
(symbol-name next-pkg) (package-version-join next-version)
(package-version-join (package-desc-vers (cdr pkg-desc)))))
(package-version-join (package-desc-version pkg-desc))))
;; Move to front, so it gets installed early enough (bug#14082).
(setq package-list (cons next-pkg (delq next-pkg package-list)))
(setq package-list
(package-compute-transaction package-list
(package-desc-reqs
(cdr pkg-desc))))))))
pkg-desc)))))))
package-list)
(defun package-read-from-string (str)
@ -867,13 +909,29 @@ If the archive version is too new, signal an error."
(dolist (package contents)
(package--add-to-archive-contents package archive)))))
;; Package descriptor objects used inside the "archive-contents" file.
;; Changing this defstruct implies changing the format of the
;; "archive-contents" files.
(cl-defstruct (package--ac-desc
(:constructor package-make-ac-desc (version reqs summary kind))
(:copier nil)
(:type vector))
version reqs summary kind)
(defun package--add-to-archive-contents (package archive)
"Add the PACKAGE from the given ARCHIVE if necessary.
Also, add the originating archive to the end of the package vector."
(let* ((name (car package))
(version (package-desc-vers (cdr package)))
(entry (cons name
(vconcat (cdr package) (vector archive))))
PACKAGE should have the form (NAME . PACKAGE--AC-DESC).
Also, add the originating archive to the `package-desc' structure."
(let* ((name (car package))
(pkg-desc
(package-desc-create
:name name
:version (package--ac-desc-version (cdr package))
:reqs (package--ac-desc-reqs (cdr package))
:summary (package--ac-desc-summary (cdr package))
:kind (package--ac-desc-kind (cdr package))
:archive archive))
(entry (cons name pkg-desc))
(existing-package (assq name package-archive-contents))
(pinned-to-archive (assoc name package-pinned-packages)))
(cond ((and pinned-to-archive
@ -881,9 +939,9 @@ Also, add the originating archive to the end of the package vector."
(not (equal (cdr pinned-to-archive) archive)))
nil)
((not existing-package)
(add-to-list 'package-archive-contents entry))
((version-list-< (package-desc-vers (cdr existing-package))
version)
(push entry package-archive-contents))
((version-list-< (package-desc-version (cdr existing-package))
(package-desc-version pkg-desc))
;; Replace the entry with this one.
(setq package-archive-contents
(cons entry
@ -902,14 +960,14 @@ using `package-compute-transaction'."
;; `package-load-list', download the held version.
(hold (cadr (assq elt package-load-list)))
(v-string (or (and (stringp hold) hold)
(package-version-join (package-desc-vers desc))))
(package-version-join (package-desc-version desc))))
(kind (package-desc-kind desc)))
(cond
((eq kind 'tar)
(package-download-tar elt v-string))
((eq kind 'single)
(package-download-single elt v-string
(package-desc-doc desc)
(package-desc-summary desc)
(package-desc-reqs desc)))
(t
(error "Unknown package kind: %s" (symbol-name kind))))
@ -961,17 +1019,7 @@ Otherwise return nil."
(error nil))))
(defun package-buffer-info ()
"Return a vector describing the package in the current buffer.
The vector has the form
[FILENAME REQUIRES DESCRIPTION VERSION COMMENTARY]
FILENAME is the file name, a string, sans the \".el\" extension.
REQUIRES is a list of requirements, each requirement having the
form (NAME VER); NAME is a string and VER is a version list.
DESCRIPTION is the package description, a string.
VERSION is the version, a string.
COMMENTARY is the commentary section, a string, or nil if none.
"Return a `package-desc' describing the package in the current buffer.
If the buffer does not contain a conforming package, signal an
error. If there is a package, narrow the buffer to the file's
@ -990,25 +1038,18 @@ boundaries."
(require 'lisp-mnt)
;; Use some headers we've invented to drive the process.
(let* ((requires-str (lm-header "package-requires"))
(requires (if requires-str
(package-read-from-string requires-str)))
;; Prefer Package-Version; if defined, the package author
;; probably wants us to use it. Otherwise try Version.
(pkg-version
(or (package-strip-rcs-id (lm-header "package-version"))
(package-strip-rcs-id (lm-header "version"))))
(commentary (lm-commentary)))
(package-strip-rcs-id (lm-header "version")))))
(unless pkg-version
(error
"Package lacks a \"Version\" or \"Package-Version\" header"))
;; Turn string version numbers into list form.
(setq requires
(mapcar
(lambda (elt)
(list (car elt)
(version-to-list (car (cdr elt)))))
requires))
(vector file-name requires desc pkg-version commentary))))
(package-desc-from-define
file-name pkg-version desc
(if requires-str (package-read-from-string requires-str))
:kind 'single))))
(defun package-tar-file-info (file)
"Find package information for a tar file.
@ -1025,67 +1066,46 @@ The return result is a vector like `package-buffer-info'."
(pkg-def-contents (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/"
pkg-name "-pkg.el")))
(pkg-def-parsed (package-read-from-string pkg-def-contents)))
(unless (eq (car pkg-def-parsed) 'define-package)
(error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
(let ((name-str (nth 1 pkg-def-parsed))
(version-string (nth 2 pkg-def-parsed))
(docstring (nth 3 pkg-def-parsed))
(requires (nth 4 pkg-def-parsed))
(readme (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/README"))))
(unless (equal pkg-version version-string)
(let ((pkg-desc
(apply #'package-desc-from-define (append (cdr pkg-def-parsed)
'(:kind tar)))))
(unless (equal pkg-version
(package-version-join (package-desc-version pkg-desc)))
(error "Package has inconsistent versions"))
(unless (equal pkg-name name-str)
(unless (equal pkg-name (symbol-name (package-desc-name pkg-desc)))
(error "Package has inconsistent names"))
;; Kind of a hack.
(if (string-match ": Not found in archive" readme)
(setq readme nil))
;; Turn string version numbers into list form.
(if (eq (car requires) 'quote)
(setq requires (car (cdr requires))))
(setq requires
(mapcar (lambda (elt)
(list (car elt)
(version-to-list (cadr elt))))
requires))
(vector pkg-name requires docstring version-string readme)))))
pkg-desc))))
;;;###autoload
(defun package-install-from-buffer (pkg-info type)
(defun package-install-from-buffer (pkg-desc)
"Install a package from the current buffer.
When called interactively, the current buffer is assumed to be a
single .el file that follows the packaging guidelines; see info
node `(elisp)Packaging'.
When called from Lisp, PKG-INFO is a vector describing the
information, of the type returned by `package-buffer-info'; and
TYPE is the package type (either `single' or `tar')."
(interactive (list (package-buffer-info) 'single))
When called from Lisp, PKG-DESC is a `package-desc' describing the
information)."
(interactive (list (package-buffer-info)))
(save-excursion
(save-restriction
(let* ((file-name (aref pkg-info 0))
(requires (aref pkg-info 1))
(desc (if (string= (aref pkg-info 2) "")
"No description available."
(aref pkg-info 2)))
(pkg-version (aref pkg-info 3)))
(let* ((name (package-desc-name pkg-desc))
(requires (package-desc-reqs pkg-desc))
(desc (package-desc-summary pkg-desc))
(pkg-version (package-desc-version pkg-desc)))
;; Download and install the dependencies.
(let ((transaction (package-compute-transaction nil requires)))
(package-download-transaction transaction))
;; Install the package itself.
(cond
((eq type 'single)
(package-unpack-single file-name pkg-version desc requires))
((eq type 'tar)
(package-unpack (intern file-name) pkg-version))
(t
(error "Unknown type: %s" (symbol-name type))))
(pcase (package-desc-kind pkg-desc)
(`single (package-unpack-single name pkg-version desc requires))
(`tar (package-unpack name pkg-version))
(type (error "Unknown type: %S" type)))
;; Try to activate it.
(package-initialize)))))
@ -1097,10 +1117,10 @@ The file can either be a tar file or an Emacs Lisp file."
(with-temp-buffer
(insert-file-contents-literally file)
(cond
((string-match "\\.el$" file)
(package-install-from-buffer (package-buffer-info) 'single))
((string-match "\\.tar$" file)
(package-install-from-buffer (package-tar-file-info file) 'tar))
((string-match "\\.el\\'" file)
(package-install-from-buffer (package-buffer-info)))
((string-match "\\.tar\\'" file)
(package-install-from-buffer (package-tar-file-info file)))
(t (error "Unrecognized extension `%s'" (file-name-extension file))))))
(defun package-delete (name version)
@ -1118,7 +1138,7 @@ The file can either be a tar file or an Emacs Lisp file."
(defun package-archive-base (name)
"Return the archive containing the package NAME."
(let ((desc (cdr (assq (intern-soft name) package-archive-contents))))
(cdr (assoc (aref desc (- (length desc) 1)) package-archives))))
(cdr (assoc (package-desc-archive desc) package-archives))))
(defun package--download-one-archive (archive file)
"Retrieve an archive file FILE from ARCHIVE, and cache it.
@ -1163,7 +1183,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(package-read-all-archive-contents)
(unless no-activate
(dolist (elt package-alist)
(package-activate (car elt) (package-desc-vers (cdr elt)))))
(package-activate (car elt) (package-desc-version (cdr elt)))))
(setq package--initialized t))
@ -1210,22 +1230,22 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(cond
;; Loaded packages are in `package-alist'.
((setq desc (cdr (assq package package-alist)))
(setq version (package-version-join (package-desc-vers desc)))
(setq version (package-version-join (package-desc-version desc)))
(if (setq pkg-dir (package--dir package-name version))
(insert "an installed package.\n\n")
;; This normally does not happen.
(insert "a deleted package.\n\n")))
;; Available packages are in `package-archive-contents'.
((setq desc (cdr (assq package package-archive-contents)))
(setq version (package-version-join (package-desc-vers desc))
archive (aref desc (- (length desc) 1))
(setq version (package-version-join (package-desc-version desc))
archive (package-desc-archive desc)
installable t)
(if built-in
(insert "a built-in package.\n\n")
(insert "an uninstalled package.\n\n")))
(built-in
(setq desc (cdr built-in)
version (package-version-join (package-desc-vers desc)))
(setq desc (package--from-builtin built-in)
version (package-version-join (package-desc-version desc)))
(insert "a built-in package.\n\n"))
(t
(insert "an orphan package.\n\n")))
@ -1246,7 +1266,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(insert "'.")))
(installable
(if built-in
(insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face)
(insert (propertize "Built-in."
'font-lock-face 'font-lock-builtin-face)
" Alternate version available")
(insert "Available"))
(insert " from " archive)
@ -1261,7 +1282,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
'package-symbol package
'action 'package-install-button-action)))
(built-in
(insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face)))
(insert (propertize "Built-in."
'font-lock-face 'font-lock-builtin-face)))
(t (insert "Deleted.")))
(insert "\n")
(and version (> (length version) 0)
@ -1286,7 +1308,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(help-insert-xref-button text 'help-package name))
(insert "\n")))
(insert " " (propertize "Summary" 'font-lock-face 'bold)
": " (if desc (package-desc-doc desc)) "\n\n")
": " (if desc (package-desc-summary desc)) "\n\n")
(if built-in
;; For built-in packages, insert the commentary.
@ -1418,10 +1440,10 @@ If the alist stored in the symbol LISTNAME lacks an entry for a
package PACKAGE with descriptor DESC, add one. The alist is
keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is
a symbol and VERSION-LIST is a version list."
`(let* ((version (package-desc-vers ,desc))
`(let* ((version (package-desc-version ,desc))
(key (cons ,package version)))
(unless (assoc key ,listname)
(push (list key ,status (package-desc-doc ,desc)) ,listname))))
(push (list key ,status (package-desc-summary ,desc)) ,listname))))
(defun package-menu--generate (remember-pos packages)
"Populate the Package Menu.
@ -1444,7 +1466,7 @@ or a list of package names (symbols) to display."
(setq name (car elt))
(when (and (not (eq name 'emacs)) ; Hide the `emacs' package.
(or (eq packages t) (memq name packages)))
(package--push name (cdr elt) "built-in" info-list)))
(package--push name (package--from-builtin elt) "built-in" info-list)))
;; Available and disabled packages:
(dolist (elt package-archive-contents)

View file

@ -620,21 +620,24 @@ If SECRET is non-nil, list secret keys instead of public keys."
(floor (* (/ current (float total)) 100))))
(message "%s..." prompt))))
(defun epa-read-file-name (input)
"Interactively read an output file name based on INPUT file name."
(setq input (file-name-sans-extension (expand-file-name input)))
(expand-file-name
(read-file-name
(concat "To file (default " (file-name-nondirectory input) ") ")
(file-name-directory input)
input)))
;;;###autoload
(defun epa-decrypt-file (decrypt-file plain-file)
"Decrypt DECRYPT-FILE into PLAIN-FILE."
(defun epa-decrypt-file (decrypt-file &optional plain-file)
"Decrypt DECRYPT-FILE into PLAIN-FILE.
If you do not specify PLAIN-FILE, this functions prompts for the value to use."
(interactive
(let (file default-name plain)
(setq file (read-file-name "File to decrypt: "))
(setq default-name (file-name-sans-extension (expand-file-name file)))
(setq plain (expand-file-name
(read-file-name
(concat "To file (default "
(file-name-nondirectory default-name)
") ")
(file-name-directory default-name)
default-name)))
(let* ((file (read-file-name "File to decrypt: "))
(plain (epa-read-file-name file)))
(list file plain)))
(or plain-file (setq plain-file (epa-read-file-name decrypt-file)))
(setq decrypt-file (expand-file-name decrypt-file))
(let ((context (epg-make-context epa-protocol)))
(epg-context-set-passphrase-callback context

View file

@ -62,13 +62,19 @@ which commands are considered visual in nature."
"less" "more" ; M-x view-file
"lynx" "ncftp" ; w3.el, ange-ftp
"pine" "tin" "trn" "elm") ; GNUS!!
"A list of commands that present their output in a visual fashion."
"A list of commands that present their output in a visual fashion.
Commands listed here are run in a term buffer.
See also `eshell-visual-subcommands' and `eshell-visual-options'."
:type '(repeat string)
:group 'eshell-term)
(defcustom eshell-visual-subcommands
nil
"An alist of the form
"An alist of subcommands that present their output in a visual fashion.
An alist of the form
((COMMAND1 SUBCOMMAND1 SUBCOMMAND2...)
(COMMAND2 SUBCOMMAND1 ...))
@ -78,7 +84,9 @@ visual fashion. A likely entry is
(\"git\" \"log\" \"diff\" \"show\")
because git shows logs and diffs using a pager by default."
because git shows logs and diffs using a pager by default.
See also `eshell-visual-commands' and `eshell-visual-options'."
:type '(repeat (cons (string :tag "Command")
(repeat (string :tag "Subcommand"))))
:version "24.4"
@ -97,7 +105,9 @@ fashion. For example, a sensible entry would be
(\"git\" \"--help\")
because \"git <command> --help\" shows the command's
documentation with a pager."
documentation with a pager.
See also `eshell-visual-commands' and `eshell-visual-subcommands'."
:type '(repeat (cons (string :tag "Command")
(repeat (string :tag "Option"))))
:version "24.4"

View file

@ -206,7 +206,8 @@ from; the default is `load-path'."
(setq version (ignore-errors (version-to-list version)))
(setq entry (assq package package--builtins))
(cond ((null entry)
(push (cons package (vector version nil summary))
(push (cons package
(package-make-builtin version summary))
package--builtins))
((eq base-name package)
(setq desc (cdr entry))

View file

@ -1,3 +1,76 @@
2013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-convert-widgets): Make widgets from non-tabular layouts
work, too.
(eww-tag-select): Implement <select>.
2013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de>
* sieve-manage.el (sieve-manage-open): work with STARTTLS: shorten
stream managing functions by using open-protocol-stream to do most of
the work. Has the nice benefit of enabling STARTTLS.
Wait for capabilities after STARTTLS: following RFC5804, the server
sends new capabilities after successfully establishing a TLS connection
with the client. The client should update the cached list of
capabilities, but we just ignore the answer for now.
(sieve-manage-network-p, sieve-manage-network-open)
(sieve-manage-starttls-p, sieve-manage-starttls-open)
(sieve-manage-forward, sieve-manage-streams)
(sieve-manage-stream-alist): Remove unneeded functions neither in the
API, nor called by any other function.
Enable Multibyte for SieveManage buffers: The parser won't properly
handle umlauts and line endings unless multibyte is turned on in the
process buffer.
2013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-tag-input): Support password fields.
(eww-submit): Support POST.
2013-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-tag-form): Protect against degenerate forms.
* shr.el (shr-expand-url): Expand URLs that start with a slash
correctly.
* eww.el (eww-submit): Get submit button logic right.
* shr.el (shr-final-table-render): New variable to signal when we're
doing the final table rendering so that we can collect more data at
that point.
* eww.el (eww-submit): Make form submission work.
(eww-tag-input): Implement submit buttons.
(eww-click-radio): Implement radio and checkboxes.
(eww-submit): Handle hidden elements.
* shr.el (shr-descend): Allow other packages to override (or provide)
rendering of elements.
(shr-expand-url): Strip query strings from URLs before expanding them.
* eww.el: Don't require cl-lib.
(eww-tag-form): Start form support.
* eww.el: Start writing a new, tiny web browser.
(eww-previous-url): New command.
(eww-quit): New command.
2013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de>
* sieve.el: Put point at beginning of buffer when viewing a script.
(sieve-open-server): respect the PORT parameter. Show the correct port
number in sieve-buffer's header. Fixed code to also work with a string
as port specifier. Properly close the connection on pressing 'q'. Make
sieve-manage-quit close the connection and process buffer. Also, remove
duplicate keybinding for 'q'.
2013-06-10 Roy Hashimoto <roy.hashimoto@gmail.com> (tiny change)
* mm-view.el (mm-pkcs7-signed-magic): Allow newline in the regexp and
make it easier to read.
(mm-pkcs7-enveloped-magic): Ditto.
2013-06-06 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-ems.el (gnus-image-type-available-p): Test `display-images-p'

349
lisp/gnus/eww.el Normal file
View file

@ -0,0 +1,349 @@
;;; eww.el --- Emacs Web Wowser
;; Copyright (C) 2013 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: html
;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(eval-when-compile (require 'cl))
(require 'shr)
(require 'url)
(require 'mm-url)
(defvar eww-current-url nil)
(defvar eww-history nil)
;;;###autoload
(defun eww (url)
"Fetch URL and render the page."
(interactive "sUrl: ")
(url-retrieve url 'eww-render (list url)))
(defun eww-render (status url &optional point)
(let* ((headers (eww-parse-headers))
(content-type
(mail-header-parse-content-type
(or (cdr (assoc "content-type" headers))
"text/plain")))
(charset (intern
(downcase
(or (cdr (assq 'charset (cdr content-type)))
"utf8"))))
(data-buffer (current-buffer)))
(unwind-protect
(progn
(cond
((equal (car content-type) "text/html")
(eww-display-html charset url))
((string-match "^image/" (car content-type))
(eww-display-image))
(t
(eww-display-raw charset)))
(when point
(goto-char point)))
(kill-buffer data-buffer))))
(defun eww-parse-headers ()
(let ((headers nil))
(while (and (not (eobp))
(not (eolp)))
(when (looking-at "\\([^:]+\\): *\\(.*\\)")
(push (cons (downcase (match-string 1))
(match-string 2))
headers))
(forward-line 1))
(unless (eobp)
(forward-line 1))
headers))
(defun eww-display-html (charset url)
(unless (eq charset 'utf8)
(decode-coding-region (point) (point-max) charset))
(let ((document
(list
'base (list (cons 'href url))
(libxml-parse-html-region (point) (point-max)))))
(eww-setup-buffer)
(setq eww-current-url url)
(let ((inhibit-read-only t)
(shr-external-rendering-functions
'((form . eww-tag-form)
(input . eww-tag-input)
(select . eww-tag-select))))
(shr-insert-document document)
(eww-convert-widgets))
(goto-char (point-min))))
(defun eww-display-raw (charset)
(let ((data (buffer-substring (point) (point-max))))
(eww-setup-buffer)
(let ((inhibit-read-only t))
(insert data))
(goto-char (point-min))))
(defun eww-display-image ()
(let ((data (buffer-substring (point) (point-max))))
(eww-setup-buffer)
(let ((inhibit-read-only t))
(shr-put-image data nil))
(goto-char (point-min))))
(defun eww-setup-buffer ()
(pop-to-buffer (get-buffer-create "*eww*"))
(remove-overlays)
(setq widget-field-list nil)
(let ((inhibit-read-only t))
(erase-buffer))
(eww-mode))
(defvar eww-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
(define-key map "q" 'eww-quit)
(define-key map "g" 'eww-reload)
(define-key map [tab] 'widget-forward)
(define-key map [backtab] 'widget-backward)
(define-key map [delete] 'scroll-down-command)
(define-key map "\177" 'scroll-down-command)
(define-key map " " 'scroll-up-command)
(define-key map "p" 'eww-previous-url)
;;(define-key map "n" 'eww-next-url)
map))
(defun eww-mode ()
"Mode for browsing the web.
\\{eww-mode-map}"
(interactive)
(setq major-mode 'eww-mode
mode-name "eww")
(set (make-local-variable 'eww-current-url) 'author)
(set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)
;;(setq buffer-read-only t)
(use-local-map eww-mode-map))
(defun eww-browse-url (url &optional new-window)
(push (list eww-current-url (point))
eww-history)
(eww url))
(defun eww-quit ()
"Exit the Emacs Web Wowser."
(interactive)
(setq eww-history nil)
(kill-buffer (current-buffer)))
(defun eww-previous-url ()
"Go to the previously displayed page."
(interactive)
(when (zerop (length eww-history))
(error "No previous page"))
(let ((prev (pop eww-history)))
(url-retrieve (car prev) 'eww-render (list (car prev) (cadr prev)))))
(defun eww-reload ()
"Reload the current page."
(interactive)
(url-retrieve eww-current-url 'eww-render
(list eww-current-url (point))))
;; Form support.
(defvar eww-form nil)
(defun eww-tag-form (cont)
(let ((eww-form
(list (assq :method cont)
(assq :action cont)))
(start (point)))
(shr-ensure-paragraph)
(shr-generic cont)
(shr-ensure-paragraph)
(when (> (point) start)
(put-text-property start (1+ start)
'eww-form eww-form))))
(defun eww-tag-input (cont)
(let* ((start (point))
(type (downcase (or (cdr (assq :type cont))
"text")))
(widget
(cond
((equal type "submit")
(list
'push-button
:notify 'eww-submit
:name (cdr (assq :name cont))
:eww-form eww-form
(or (cdr (assq :value cont)) "Submit")))
((or (equal type "radio")
(equal type "checkbox"))
(list 'checkbox
:notify 'eww-click-radio
:name (cdr (assq :name cont))
:checkbox-value (cdr (assq :value cont))
:checkbox-type type
:eww-form eww-form
(cdr (assq :checked cont))))
((equal type "hidden")
(list 'hidden
:name (cdr (assq :name cont))
:value (cdr (assq :value cont))))
(t
(list
'editable-field
:size (string-to-number
(or (cdr (assq :size cont))
"40"))
:value (or (cdr (assq :value cont)) "")
:secret (and (equal type "password") ?*)
:action 'eww-submit
:name (cdr (assq :name cont))
:eww-form eww-form)))))
(if (eq (car widget) 'hidden)
(when shr-final-table-render
(nconc eww-form (list widget)))
(apply 'widget-create widget))
(put-text-property start (point) 'eww-widget widget)
(insert " ")))
(defun eww-tag-select (cont)
(shr-ensure-paragraph)
(let ((menu (list 'menu-choice
:name (cdr (assq :name cont))
:eww-form eww-form))
(options nil)
(start (point)))
(dolist (elem cont)
(when (eq (car elem) 'option)
(when (cdr (assq :selected (cdr elem)))
(nconc menu (list :value
(cdr (assq :value (cdr elem))))))
(push (list 'item
:value (cdr (assq :value (cdr elem)))
:tag (cdr (assq 'text (cdr elem))))
options)))
(nconc menu options)
(apply 'widget-create menu)
(put-text-property start (point) 'eww-widget menu)
(shr-ensure-paragraph)))
(defun eww-click-radio (widget &rest ignore)
(let ((form (plist-get (cdr widget) :eww-form))
(name (plist-get (cdr widget) :name)))
(when (equal (plist-get (cdr widget) :type) "radio")
(if (widget-value widget)
;; Switch all the other radio buttons off.
(dolist (overlay (overlays-in (point-min) (point-max)))
(let ((field (plist-get (overlay-properties overlay) 'button)))
(when (and (eq (plist-get (cdr field) :eww-form) form)
(equal name (plist-get (cdr field) :name)))
(unless (eq field widget)
(widget-value-set field nil)))))
(widget-value-set widget t)))
(eww-fix-widget-keymap)))
(defun eww-submit (widget &rest ignore)
(let ((form (plist-get (cdr widget) :eww-form))
(first-button t)
values)
(dolist (overlay (sort (overlays-in (point-min) (point-max))
(lambda (o1 o2)
(< (overlay-start o1) (overlay-start o2)))))
(let ((field (or (plist-get (overlay-properties overlay) 'field)
(plist-get (overlay-properties overlay) 'button)
(plist-get (overlay-properties overlay) 'eww-hidden))))
(when (eq (plist-get (cdr field) :eww-form) form)
(let ((name (plist-get (cdr field) :name)))
(when name
(cond
((eq (car field) 'checkbox)
(when (widget-value field)
(push (cons name (plist-get (cdr field) :checkbox-value))
values)))
((eq (car field) 'eww-hidden)
(push (cons name (plist-get (cdr field) :value))
values))
((eq (car field) 'push-button)
;; We want the values from buttons if we hit a button,
;; or we're submitting something and this is the first
;; button displayed.
(when (or (and (eq (car widget) 'push-button)
(eq widget field))
(and (not (eq (car widget) 'push-button))
(eq (car field) 'push-button)
first-button))
(setq first-button nil)
(push (cons name (widget-value field))
values)))
(t
(push (cons name (widget-value field))
values))))))))
(dolist (elem form)
(when (and (consp elem)
(eq (car elem) 'hidden))
(push (cons (plist-get (cdr elem) :name)
(plist-get (cdr elem) :value))
values)))
(let ((shr-base eww-current-url))
(if (and (stringp (cdr (assq :method form)))
(equal (downcase (cdr (assq :method form))) "post"))
(let ((url-request-method "POST")
(url-request-extra-headers
'(("Content-Type" . "application/x-www-form-urlencoded")))
(url-request-data (mm-url-encode-www-form-urlencoded values)))
(eww-browse-url (shr-expand-url (cdr (assq :action form)))))
(eww-browse-url
(shr-expand-url
(concat
(cdr (assq :action form))
"?"
(mm-url-encode-www-form-urlencoded values))))))))
(defun eww-convert-widgets ()
(let ((start (point-min))
widget)
;; Some widgets come from different buffers (rendered for tables),
;; so we need to nix out the list of widgets and recreate them.
(setq widget-field-list nil
widget-field-new nil)
(while (setq start (next-single-property-change start 'eww-widget))
(setq widget (get-text-property start 'eww-widget))
(goto-char start)
(let ((end (next-single-property-change start 'eww-widget)))
(dolist (overlay (overlays-in start end))
(when (or (plist-get (overlay-properties overlay) 'button)
(plist-get (overlay-properties overlay) 'field))
(delete-overlay overlay)))
(delete-region start end))
(apply 'widget-create widget))
(widget-setup)
(eww-fix-widget-keymap)))
(defun eww-fix-widget-keymap ()
(dolist (overlay (overlays-in (point-min) (point-max)))
(when (plist-get (overlay-properties overlay) 'button)
(overlay-put overlay 'local-map widget-keymap))))
(provide 'eww)
;;; eww.el ends here

View file

@ -660,14 +660,26 @@ If MODE is not set, try to find mode automatically."
;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
(defvar mm-pkcs7-signed-magic
"\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\
\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x02")
(concat
"0"
"\\(\\(\x80\\)"
"\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
"\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
"\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
"\\)"
"\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x02"))
;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
(defvar mm-pkcs7-enveloped-magic
"\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\
\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x03")
(concat
"0"
"\\(\\(\x80\\)"
"\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
"\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
"\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
"\\)"
"\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x03"))
(defun mm-view-pkcs7-get-type (handle)
(mm-with-unibyte-buffer

View file

@ -114,6 +114,8 @@ cid: URL as the argument.")
(defvar shr-stylesheet nil)
(defvar shr-base nil)
(defvar shr-ignore-cache nil)
(defvar shr-external-rendering-functions nil)
(defvar shr-final-table-render nil)
(defvar shr-map
(let ((map (make-sparse-keymap)))
@ -291,7 +293,12 @@ size, and full-buffer size."
(nreverse result)))
(defun shr-descend (dom)
(let ((function (intern (concat "shr-tag-" (symbol-name (car dom))) obarray))
(let ((function
(or
;; Allow other packages to override (or provide) rendering
;; of elements.
(cdr (assq (car dom) shr-external-rendering-functions))
(intern (concat "shr-tag-" (symbol-name (car dom))) obarray)))
(style (cdr (assq :style (cdr dom))))
(shr-stylesheet shr-stylesheet)
(start (point)))
@ -478,20 +485,27 @@ size, and full-buffer size."
(not failed)))
(defun shr-expand-url (url)
(cond
;; Absolute URL.
((or (not url)
(string-match "\\`[a-z]*:" url)
(not shr-base))
url)
((and (string-match "\\`//" url)
(string-match "\\`[a-z]*:" shr-base))
(concat (match-string 0 shr-base) url))
((and (not (string-match "/\\'" shr-base))
(not (string-match "\\`/" url)))
(concat shr-base "/" url))
(t
(concat shr-base url))))
(if (or (not url)
(string-match "\\`[a-z]*:" url)
(not shr-base))
;; Absolute URL.
url
(let ((base shr-base))
;; Chop off query string.
(when (string-match "^\\([^?]+\\)[?]" base)
(setq base (match-string 1 base)))
(cond
((and (string-match "\\`//" url)
(string-match "\\`[a-z]*:" base))
(concat (match-string 0 base) url))
((and (not (string-match "/\\'" base))
(not (string-match "\\`/" url)))
(concat base "/" url))
((and (string-match "\\`/" url)
(string-match "\\(\\`[^:]*://[^/]+\\)/" base))
(concat (match-string 1 base) url))
(t
(concat base url))))))
(defun shr-ensure-newline ()
(unless (zerop (current-column))
@ -945,7 +959,8 @@ ones, in case fg and bg are nil."
plist)))
(defun shr-tag-base (cont)
(setq shr-base (cdr (assq :href cont))))
(setq shr-base (cdr (assq :href cont)))
(shr-generic cont))
(defun shr-tag-a (cont)
(let ((url (cdr (assq :href cont)))
@ -1167,7 +1182,8 @@ ones, in case fg and bg are nil."
(frame-width))
(setq truncate-lines t))
;; Then render the table again with these new "hard" widths.
(shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))
(let ((shr-final-table-render t))
(shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)))
;; Finally, insert all the images after the table. The Emacs buffer
;; model isn't strong enough to allow us to put the images actually
;; into the tables.

View file

@ -3,6 +3,7 @@
;; Copyright (C) 2001-2013 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
;; Albert Krewinkel <tarleb@moltkeplatz.de>
;; This file is part of GNU Emacs.
@ -66,6 +67,7 @@
;; 2001-10-31 Committed to Oort Gnus.
;; 2002-07-27 Added DELETESCRIPT. Suggested by Ned Ludd.
;; 2002-08-03 Use SASL library.
;; 2013-06-05 Enabled STARTTLS support, fixed bit rot.
;;; Code:
@ -82,7 +84,6 @@
(require 'sasl)
(require 'starttls))
(autoload 'sasl-find-mechanism "sasl")
(autoload 'starttls-open-stream "starttls")
(autoload 'auth-source-search "auth-source")
;; User customizable variables:
@ -107,23 +108,6 @@
:type 'string
:group 'sieve-manage)
(defcustom sieve-manage-streams '(network starttls shell)
"Priority of streams to consider when opening connection to server."
:group 'sieve-manage)
(defcustom sieve-manage-stream-alist
'((network sieve-manage-network-p sieve-manage-network-open)
(shell sieve-manage-shell-p sieve-manage-shell-open)
(starttls sieve-manage-starttls-p sieve-manage-starttls-open))
"Definition of network streams.
\(NAME CHECK OPEN)
NAME names the stream, CHECK is a function returning non-nil if the
server support the stream and OPEN is a function for opening the
stream."
:group 'sieve-manage)
(defcustom sieve-manage-authenticators '(digest-md5
cram-md5
scram-md5
@ -156,8 +140,7 @@ for doing the actual authentication."
:group 'sieve-manage)
(defcustom sieve-manage-default-stream 'network
"Default stream type to use for `sieve-manage'.
Must be a name of a stream in `sieve-manage-stream-alist'."
"Default stream type to use for `sieve-manage'."
:version "24.1"
:type 'symbol
:group 'sieve-manage)
@ -185,17 +168,21 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
(defvar sieve-manage-capability nil)
;; Internal utility functions
(defmacro sieve-manage-disable-multibyte ()
"Enable multibyte in the current buffer."
(unless (featurep 'xemacs)
'(set-buffer-multibyte nil)))
(defun sieve-manage-make-process-buffer ()
(with-current-buffer
(generate-new-buffer (format " *sieve %s:%s*"
sieve-manage-server
sieve-manage-port))
(mapc 'make-local-variable sieve-manage-local-variables)
(mm-enable-multibyte)
(buffer-disable-undo)
(current-buffer)))
(defun sieve-manage-erase (&optional p buffer)
(let ((buffer (or buffer (current-buffer))))
(and sieve-manage-log
(with-current-buffer (get-buffer-create sieve-manage-log)
(sieve-manage-disable-multibyte)
(mm-enable-multibyte)
(buffer-disable-undo)
(goto-char (point-max))
(insert-buffer-substring buffer (with-current-buffer buffer
@ -204,71 +191,32 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
(point-max)))))))
(delete-region (point-min) (or p (point-max))))
(defun sieve-manage-open-1 (buffer)
(defun sieve-manage-open-server (server port &optional stream buffer)
"Open network connection to SERVER on PORT.
Return the buffer associated with the connection."
(with-current-buffer buffer
(sieve-manage-erase)
(setq sieve-manage-state 'initial
sieve-manage-process
(condition-case ()
(funcall (nth 2 (assq sieve-manage-stream
sieve-manage-stream-alist))
"sieve" buffer sieve-manage-server sieve-manage-port)
((error quit) nil)))
(when sieve-manage-process
(while (and (eq sieve-manage-state 'initial)
(memq (process-status sieve-manage-process) '(open run)))
(message "Waiting for response from %s..." sieve-manage-server)
(accept-process-output sieve-manage-process 1))
(message "Waiting for response from %s...done" sieve-manage-server)
(and (memq (process-status sieve-manage-process) '(open run))
sieve-manage-process))))
;; Streams
(defun sieve-manage-network-p (buffer)
t)
(defun sieve-manage-network-open (name buffer server port)
(let* ((port (or port sieve-manage-default-port))
(coding-system-for-read sieve-manage-coding-system-for-read)
(coding-system-for-write sieve-manage-coding-system-for-write)
(process (open-network-stream name buffer server port)))
(when process
(while (and (memq (process-status process) '(open run))
(set-buffer buffer) ;; XXX "blue moon" nntp.el bug
(goto-char (point-min))
(not (sieve-manage-parse-greeting-1)))
(accept-process-output process 1)
(sit-for 1))
(sieve-manage-erase nil buffer)
(when (memq (process-status process) '(open run))
process))))
(defun sieve-manage-starttls-p (buffer)
(condition-case ()
(progn
(require 'starttls)
(call-process "starttls"))
(error nil)))
(defun sieve-manage-starttls-open (name buffer server port)
(let* ((port (or port sieve-manage-default-port))
(coding-system-for-read sieve-manage-coding-system-for-read)
(coding-system-for-write sieve-manage-coding-system-for-write)
(process (starttls-open-stream name buffer server port))
done)
(when process
(while (and (memq (process-status process) '(open run))
(set-buffer buffer) ;; XXX "blue moon" nntp.el bug
(goto-char (point-min))
(not (sieve-manage-parse-greeting-1)))
(accept-process-output process 1)
(sit-for 1))
(sieve-manage-erase nil buffer)
(sieve-manage-send "STARTTLS")
(starttls-negotiate process))
(when (memq (process-status process) '(open run))
process)))
(setq sieve-manage-state 'initial)
(destructuring-bind (proc . props)
(open-protocol-stream
"SIEVE" buffer server port
:type stream
:capability-command "CAPABILITY\r\n"
:end-of-command "^\\(OK\\|NO\\).*\n"
:success "^OK.*\n"
:return-list t
:starttls-function
'(lambda (capabilities)
(when (string-match "\\bSTARTTLS\\b" capabilities)
"STARTTLS\r\n")))
(setq sieve-manage-process proc)
(setq sieve-manage-capability
(sieve-manage-parse-capability (getf props :capabilities)))
;; Ignore new capabilities issues after successful STARTTLS
(when (and (memq stream '(nil network starttls))
(eq (getf props :type) 'tls))
(sieve-manage-drop-next-answer))
(current-buffer))))
;; Authenticators
(defun sieve-sasl-auth (buffer mech)
@ -396,63 +344,33 @@ Optional argument AUTH indicates authenticator to use, see
If nil, chooses the best stream the server is capable of.
Optional argument BUFFER is buffer (buffer, or string naming buffer)
to work in."
(or port (setq port sieve-manage-default-port))
(setq buffer (or buffer (format " *sieve* %s:%s" server port)))
(with-current-buffer (get-buffer-create buffer)
(mapc 'make-local-variable sieve-manage-local-variables)
(sieve-manage-disable-multibyte)
(buffer-disable-undo)
(setq sieve-manage-server (or server sieve-manage-server))
(setq sieve-manage-port port)
(setq sieve-manage-stream (or stream sieve-manage-stream))
(setq sieve-manage-port (or port sieve-manage-default-port))
(with-current-buffer (or buffer (sieve-manage-make-process-buffer))
(setq sieve-manage-server (or server
sieve-manage-server)
sieve-manage-stream (or stream
sieve-manage-stream
sieve-manage-default-stream)
sieve-manage-auth (or auth
sieve-manage-auth))
(message "sieve: Connecting to %s..." sieve-manage-server)
(if (let ((sieve-manage-stream
(or sieve-manage-stream sieve-manage-default-stream)))
(sieve-manage-open-1 buffer))
;; Choose stream.
(let (stream-changed)
(message "sieve: Connecting to %s...done" sieve-manage-server)
(when (null sieve-manage-stream)
(let ((streams sieve-manage-streams))
(while (setq stream (pop streams))
(if (funcall (nth 1 (assq stream
sieve-manage-stream-alist)) buffer)
(setq stream-changed
(not (eq (or sieve-manage-stream
sieve-manage-default-stream)
stream))
sieve-manage-stream stream
streams nil)))
(unless sieve-manage-stream
(error "Couldn't figure out a stream for server"))))
(when stream-changed
(message "sieve: Reconnecting with stream `%s'..."
sieve-manage-stream)
(sieve-manage-close buffer)
(if (sieve-manage-open-1 buffer)
(message "sieve: Reconnecting with stream `%s'...done"
sieve-manage-stream)
(message "sieve: Reconnecting with stream `%s'...failed"
sieve-manage-stream))
(setq sieve-manage-capability nil))
(if (sieve-manage-opened buffer)
;; Choose authenticator
(when (and (null sieve-manage-auth)
(not (eq sieve-manage-state 'auth)))
(let ((auths sieve-manage-authenticators))
(while (setq auth (pop auths))
(if (funcall (nth 1 (assq
auth
sieve-manage-authenticator-alist))
buffer)
(setq sieve-manage-auth auth
auths nil)))
(unless sieve-manage-auth
(error "Couldn't figure out authenticator for server"))))))
(message "sieve: Connecting to %s...failed" sieve-manage-server))
(when (sieve-manage-opened buffer)
(sieve-manage-open-server sieve-manage-server
sieve-manage-port
sieve-manage-stream
(current-buffer))
(when (sieve-manage-opened (current-buffer))
;; Choose authenticator
(when (and (null sieve-manage-auth)
(not (eq sieve-manage-state 'auth)))
(dolist (auth sieve-manage-authenticators)
(when (funcall (nth 1 (assq auth sieve-manage-authenticator-alist))
buffer)
(setq sieve-manage-auth auth)
(return)))
(unless sieve-manage-auth
(error "Couldn't figure out authenticator for server")))
(sieve-manage-erase)
buffer)))
(current-buffer))))
(defun sieve-manage-authenticate (&optional buffer)
"Authenticate on server in BUFFER.
@ -544,12 +462,22 @@ If NAME is nil, return the full server list of capabilities."
;; Protocol parsing routines
(defun sieve-manage-wait-for-answer ()
(let ((pattern "^\\(OK\\|NO\\).*\n")
pos)
(while (not pos)
(setq pos (search-forward-regexp pattern nil t))
(goto-char (point-min))
(sleep-for 0 50))
pos))
(defun sieve-manage-drop-next-answer ()
(sieve-manage-wait-for-answer)
(sieve-manage-erase))
(defun sieve-manage-ok-p (rsp)
(string= (downcase (or (car-safe rsp) "")) "ok"))
(defsubst sieve-manage-forward ()
(or (eobp) (forward-char)))
(defun sieve-manage-is-okno ()
(when (looking-at (concat
"^\\(OK\\|NO\\)\\( (\\([^)]+\\))\\)?\\( \\(.*\\)\\)?"
@ -571,21 +499,15 @@ If NAME is nil, return the full server list of capabilities."
(sieve-manage-erase)
rsp))
(defun sieve-manage-parse-capability-1 ()
"Accept a managesieve greeting."
(let (str)
(while (setq str (sieve-manage-is-string))
(if (eq (char-after) ? )
(progn
(sieve-manage-forward)
(push (list str (sieve-manage-is-string))
sieve-manage-capability))
(push (list str) sieve-manage-capability))
(forward-line)))
(when (re-search-forward (concat "^OK.*" sieve-manage-server-eol) nil t)
(setq sieve-manage-state 'nonauth)))
(defalias 'sieve-manage-parse-greeting-1 'sieve-manage-parse-capability-1)
(defun sieve-manage-parse-capability (str)
"Parse managesieve capability string `STR'.
Set variable `sieve-manage-capability' to "
(let ((capas (remove-if #'null
(mapcar #'split-string-and-unquote
(split-string str "\n")))))
(when (string= "OK" (caar (last capas)))
(setq sieve-manage-state 'nonauth))
capas))
(defun sieve-manage-is-string ()
(cond ((looking-at "\"\\([^\"]+\\)\"")
@ -639,7 +561,7 @@ If NAME is nil, return the full server list of capabilities."
(setq cmdstr (concat cmdstr sieve-manage-client-eol))
(and sieve-manage-log
(with-current-buffer (get-buffer-create sieve-manage-log)
(sieve-manage-disable-multibyte)
(mm-enable-multibyte)
(buffer-disable-undo)
(goto-char (point-max))
(insert cmdstr)))

View file

@ -109,7 +109,6 @@ require \"fileinto\";
;; various
(define-key map "?" 'sieve-help)
(define-key map "h" 'sieve-help)
(define-key map "q" 'kill-buffer)
;; activating
(define-key map "m" 'sieve-activate)
(define-key map "u" 'sieve-deactivate)
@ -152,6 +151,8 @@ require \"fileinto\";
(defun sieve-manage-quit ()
"Quit."
(interactive)
(sieve-manage-close sieve-manage-buffer)
(kill-buffer sieve-manage-buffer)
(kill-buffer (current-buffer)))
(defun sieve-activate (&optional pos)
@ -206,6 +207,7 @@ require \"fileinto\";
(insert sieve-template))
(sieve-mode)
(setq sieve-buffer-script-name name)
(beginning-of-buffer)
(message
(substitute-command-keys
"Press \\[sieve-upload] to upload script to server."))))
@ -256,10 +258,9 @@ Used to bracket operations which move point in the sieve-buffer."
(setq buffer-read-only nil)
(erase-buffer)
(buffer-disable-undo)
(insert "\
Server : " server ":" (or port sieve-manage-default-port) "
")
(let* ((port (or port sieve-manage-default-port))
(header (format "Server : %s:%s\n\n" server port)))
(insert header))
(set (make-local-variable 'sieve-buffer-header-end)
(point-max)))
@ -305,7 +306,7 @@ Server : " server ":" (or port sieve-manage-default-port) "
(with-current-buffer
(or ;; open server
(set (make-local-variable 'sieve-manage-buffer)
(sieve-manage-open server))
(sieve-manage-open server port))
(error "Error opening server %s" server))
(sieve-manage-authenticate)))

View file

@ -435,14 +435,19 @@ suitable file is found, return nil."
(let ((handler (function-get function 'compiler-macro)))
(when handler
(insert "\nThis function has a compiler macro")
(let ((lib (get function 'compiler-macro-file)))
;; FIXME: rather than look at the compiler-macro-file property,
;; just look at `handler' itself.
(when (stringp lib)
(insert (format " in `%s'" lib))
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function-cmacro function lib))))
(if (symbolp handler)
(progn
(insert (format " `%s'" handler))
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function handler)))
;; FIXME: Obsolete since 24.4.
(let ((lib (get function 'compiler-macro-file)))
(when (stringp lib)
(insert (format " in `%s'" lib))
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function-cmacro function lib)))))
(insert ".\n"))))
(defun help-fns--signature (function doc real-def real-function)

View file

@ -204,7 +204,7 @@ The format is (FUNCTION ARGS...).")
(message "Unable to find location in file"))))
'help-echo (purecopy "mouse-2, RET: find function's definition"))
(define-button-type 'help-function-cmacro
(define-button-type 'help-function-cmacro ; FIXME: Obsolete since 24.4.
:supertype 'help-xref
'help-function (lambda (fun file)
(setq file (locate-library file t))
@ -213,7 +213,7 @@ The format is (FUNCTION ARGS...).")
(pop-to-buffer (find-file-noselect file))
(goto-char (point-min))
(if (re-search-forward
(format "^[ \t]*(define-compiler-macro[ \t]+%s"
(format "^[ \t]*(\\(cl-\\)?define-compiler-macro[ \t]+%s"
(regexp-quote (symbol-name fun))) nil t)
(forward-line 0)
(message "Unable to find location in file")))

View file

@ -1523,7 +1523,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
;;;###autoload
(defun ibuffer-mark-help-buffers ()
"Mark buffers like *Help*, *Apropos*, *Info*."
"Mark buffers whose major mode is in variable `ibuffer-help-buffer-modes'."
(interactive)
(ibuffer-mark-on-buffer
#'(lambda (buf)

View file

@ -3276,14 +3276,18 @@ for first matching file."
(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
(let ((filenames
(split-string
(shell-command-to-string
(concat "find "
(shell-quote-argument dir)
" -name "
(shell-quote-argument
(concat (if prefix "" "*") file "*"))
" -type " (if finddir "d" "f") " -print"))))
(delq nil
(mapcar (lambda (name)
(unless (ido-ignore-item-p name ido-ignore-files t)
name))
(split-string
(shell-command-to-string
(concat "find "
(shell-quote-argument dir)
(if ido-case-fold " -iname " " -name ")
(shell-quote-argument
(concat (if prefix "" "*") file "*"))
" -type " (if finddir "d" "f") " -print"))))))
filename d f
res)
(while filenames
@ -3297,7 +3301,7 @@ for first matching file."
res))
(defun ido-flatten-merged-list (items)
;; Create a list of directory names based on a merged directory list.
"Create a list of directory names based on a merged directory list."
(let (res)
(while items
(let* ((item (car items))
@ -3400,7 +3404,7 @@ for first matching file."
res))
(defun ido-make-buffer-list-1 (&optional frame visible)
;; Return list of non-ignored buffer names
"Return list of non-ignored buffer names."
(delq nil
(mapcar
(lambda (x)
@ -3410,12 +3414,12 @@ for first matching file."
(buffer-list frame))))
(defun ido-make-buffer-list (default)
;; Return the current list of buffers.
;; Currently visible buffers are put at the end of the list.
;; The hook `ido-make-buffer-list-hook' is run after the list has been
;; created to allow the user to further modify the order of the buffer names
;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
;; it is put to the start of the list.
"Return the current list of buffers.
Currently visible buffers are put at the end of the list.
The hook `ido-make-buffer-list-hook' is run after the list has been
created to allow the user to further modify the order of the buffer names
in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
it is put to the start of the list."
(let* ((ido-current-buffers (ido-get-buffers-in-frames 'current))
(ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers)))
(if ido-temp-list
@ -3457,9 +3461,9 @@ This is to make them appear as if they were \"virtual buffers\"."
(nreverse (mapcar #'car ido-virtual-buffers))))))
(defun ido-make-choice-list (default)
;; Return the current list of choices.
;; If DEFAULT is non-nil, and corresponds to an element of choices,
;; it is put to the start of the list.
"Return the current list of choices.
If DEFAULT is non-nil, and corresponds to an element of choices,
it is put to the start of the list."
(let ((ido-temp-list ido-choice-list))
(if default
(progn
@ -3471,7 +3475,7 @@ This is to make them appear as if they were \"virtual buffers\"."
ido-temp-list))
(defun ido-to-end (items)
;; Move the elements from ITEMS to the end of `ido-temp-list'
"Move the elements from ITEMS to the end of `ido-temp-list'."
(mapc
(lambda (elem)
(setq ido-temp-list (delq elem ido-temp-list)))
@ -3515,8 +3519,8 @@ This is to make them appear as if they were \"virtual buffers\"."
(file-name-all-completions "" dir))))
(defun ido-file-name-all-completions (dir)
;; Return name of all files in DIR
;; Uses and updates ido-dir-file-cache
"Return name of all files in DIR.
Uses and updates `ido-dir-file-cache'."
(cond
((ido-is-unc-root dir)
(mapcar
@ -3565,7 +3569,7 @@ This is to make them appear as if they were \"virtual buffers\"."
(ido-file-name-all-completions-1 dir))))
(defun ido-remove-cached-dir (dir)
;; Remove dir from ido-dir-file-cache
"Remove DIR from `ido-dir-file-cache'."
(if (and ido-dir-file-cache
(stringp dir) (> (length dir) 0))
(let ((cached (assoc dir ido-dir-file-cache)))
@ -3574,8 +3578,8 @@ This is to make them appear as if they were \"virtual buffers\"."
(defun ido-make-file-list-1 (dir &optional merged)
;; Return list of non-ignored files in DIR
;; If MERGED is non-nil, each file is cons'ed with DIR
"Return list of non-ignored files in DIR
If MERGED is non-nil, each file is cons'ed with DIR."
(and (or (ido-is-tramp-root dir) (ido-is-unc-root dir)
(file-directory-p dir))
(delq nil
@ -3586,11 +3590,11 @@ This is to make them appear as if they were \"virtual buffers\"."
(ido-file-name-all-completions dir)))))
(defun ido-make-file-list (default)
;; Return the current list of files.
;; Currently visible files are put at the end of the list.
;; The hook `ido-make-file-list-hook' is run after the list has been
;; created to allow the user to further modify the order of the file names
;; in this list.
"Return the current list of files.
Currently visible files are put at the end of the list.
The hook `ido-make-file-list-hook' is run after the list has been
created to allow the user to further modify the order of the file names
in this list."
(let ((ido-temp-list (ido-make-file-list-1 ido-current-directory)))
(setq ido-temp-list (sort ido-temp-list
(if ido-file-extensions-order
@ -3631,8 +3635,8 @@ This is to make them appear as if they were \"virtual buffers\"."
ido-temp-list))
(defun ido-make-dir-list-1 (dir &optional merged)
;; Return list of non-ignored subdirs in DIR
;; If MERGED is non-nil, each subdir is cons'ed with DIR
"Return list of non-ignored subdirs in DIR.
If MERGED is non-nil, each subdir is cons'ed with DIR."
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
(delq nil
(mapcar
@ -3642,10 +3646,10 @@ This is to make them appear as if they were \"virtual buffers\"."
(ido-file-name-all-completions dir)))))
(defun ido-make-dir-list (default)
;; Return the current list of directories.
;; The hook `ido-make-dir-list-hook' is run after the list has been
;; created to allow the user to further modify the order of the
;; directory names in this list.
"Return the current list of directories.
The hook `ido-make-dir-list-hook' is run after the list has been
created to allow the user to further modify the order of the
directory names in this list."
(let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory)))
(setq ido-temp-list (sort ido-temp-list #'ido-file-lessp))
(ido-to-end ;; move . files to end
@ -3676,10 +3680,9 @@ This is to make them appear as if they were \"virtual buffers\"."
(defvar ido-bufs-in-frame)
(defun ido-get-buffers-in-frames (&optional current)
;; Return the list of buffers that are visible in the current frame.
;; If optional argument `current' is given, restrict searching to the
;; current frame, rather than all frames, regardless of value of
;; `ido-all-frames'.
"Return the list of buffers that are visible in the current frame.
If optional argument CURRENT is given, restrict searching to the current
frame, rather than all frames, regardless of value of `ido-all-frames'."
(let ((ido-bufs-in-frame nil))
(walk-windows 'ido-get-bufname nil
(if current
@ -3688,7 +3691,7 @@ This is to make them appear as if they were \"virtual buffers\"."
ido-bufs-in-frame))
(defun ido-get-bufname (win)
;; Used by `ido-get-buffers-in-frames' to walk through all windows
"Used by `ido-get-buffers-in-frames' to walk through all windows."
(let ((buf (buffer-name (window-buffer win))))
(unless (or (member buf ido-bufs-in-frame)
(member buf ido-ignore-item-temp-list))
@ -3701,7 +3704,7 @@ This is to make them appear as if they were \"virtual buffers\"."
;;; FIND MATCHING ITEMS
(defun ido-set-matches-1 (items &optional do-full)
;; Return list of matches in items
"Return list of matches in ITEMS."
(let* ((case-fold-search ido-case-fold)
(slash (and (not ido-enable-prefix) (ido-final-slash ido-text)))
(text (if slash (substring ido-text 0 -1) ido-text))
@ -3789,13 +3792,13 @@ This is to make them appear as if they were \"virtual buffers\"."
(defun ido-set-matches ()
;; Set `ido-matches' to the list of items matching prompt
"Set `ido-matches' to the list of items matching prompt."
(when ido-rescan
(setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate))
ido-rotate nil)))
(defun ido-ignore-item-p (name re-list &optional ignore-ext)
;; Return t if the buffer or file NAME should be ignored.
"Return t if the buffer or file NAME should be ignored."
(or (member name ido-ignore-item-temp-list)
(and
ido-process-ignore-lists re-list
@ -3835,7 +3838,7 @@ This is to make them appear as if they were \"virtual buffers\"."
(defvar ido-change-word-sub)
(defun ido-find-common-substring (items subs)
;; Return common string following SUBS in each element of ITEMS.
"Return common string following SUBS in each element of ITEMS."
(let (res
alist
ido-change-word-sub)
@ -3855,8 +3858,8 @@ This is to make them appear as if they were \"virtual buffers\"."
comp))))
(defun ido-word-matching-substring (word)
;; Return part of WORD before 1st match to `ido-change-word-sub'.
;; If `ido-change-word-sub' cannot be found in WORD, return nil.
"Return part of WORD before first match to `ido-change-word-sub'.
If `ido-change-word-sub' cannot be found in WORD, return nil."
(let ((case-fold-search ido-case-fold))
(let ((m (string-match ido-change-word-sub (ido-name word))))
(if m
@ -3865,7 +3868,7 @@ This is to make them appear as if they were \"virtual buffers\"."
nil))))
(defun ido-makealist (res)
;; Return dotted pair (RES . 1).
"Return dotted pair (RES . 1)."
(cons res 1))
(defun ido-choose-completion-string (choice &rest ignored)
@ -4048,8 +4051,8 @@ Record command in `command-history' if optional RECORD is non-nil."
(defun ido-buffer-window-other-frame (buffer)
;; Return window pointer if BUFFER is visible in another frame.
;; If BUFFER is visible in the current frame, return nil.
"Return window pointer if BUFFER is visible in another frame.
If BUFFER is visible in the current frame, return nil."
(let ((blist (ido-get-buffers-in-frames 'current)))
;;If the buffer is visible in current frame, return nil
(if (member buffer blist)
@ -4533,9 +4536,8 @@ For details of keybindings, see `ido-find-file'."
))))
(defun ido-completions (name)
;; Return the string that is displayed after the user's text.
;; Modified from `icomplete-completions'.
"Return the string that is displayed after the user's text.
Modified from `icomplete-completions'."
(let* ((comps ido-matches)
(ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
ido-merged-indicator))

View file

@ -1508,6 +1508,7 @@ for decoding and encoding files, process I/O, etc."
(setq file-coding-system-alist
(mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
'(("\\.elc\\'" . utf-8-emacs)
("\\.el\\'" . utf-8)
("\\.utf\\(-8\\)?\\'" . utf-8)
("\\.xml\\'" . xml-find-file-coding-system)
;; We use raw-text for reading loaddefs.el so that if it

View file

@ -1691,7 +1691,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'"
("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion)
("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion)
("\\.pdf\\'" . no-conversion)
("/#[^/]+#\\'" . emacs-mule)))
("/#[^/]+#\\'" . utf-8-emacs-unix)))
"Alist of filename patterns vs corresponding coding systems.
Each element looks like (REGEXP . CODING-SYSTEM).
A file whose name matches REGEXP is decoded by CODING-SYSTEM on reading.

View file

@ -608,12 +608,13 @@ startup."
:group 'octave
:version "24.4")
(defcustom inferior-octave-startup-args nil
(defcustom inferior-octave-startup-args '("-i" "--no-line-editing")
"List of command line arguments for the inferior Octave process.
For example, for suppressing the startup message and using `traditional'
mode, set this to (\"-q\" \"--traditional\")."
mode, include \"-q\" and \"--traditional\"."
:type '(repeat string)
:group 'octave)
:group 'octave
:version "24.4")
(defcustom inferior-octave-mode-hook nil
"Hook to be run when Inferior Octave mode is started."
@ -723,13 +724,13 @@ startup file, `~/.emacs-octave'."
(substring inferior-octave-buffer 1 -1)
inferior-octave-buffer
inferior-octave-program
(append (list "-i" "--no-line-editing")
;; --no-gui is introduced in Octave > 3.7
(when (zerop (process-file inferior-octave-program
nil nil nil
"--no-gui" "--help"))
(list "--no-gui"))
inferior-octave-startup-args))))
(append
inferior-octave-startup-args
;; --no-gui is introduced in Octave > 3.7
(and (not (member "--no-gui" inferior-octave-startup-args))
(zerop (process-file inferior-octave-program
nil nil nil "--no-gui" "--help"))
'("--no-gui"))))))
(set-process-filter proc 'inferior-octave-output-digest)
(setq inferior-octave-process proc
inferior-octave-output-list nil
@ -759,10 +760,10 @@ startup file, `~/.emacs-octave'."
(inferior-octave-send-list-and-digest (list "PS2\n"))
(when (string-match "\\(PS2\\|ans\\) = *$"
(car inferior-octave-output-list))
(inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n")))
(inferior-octave-send-list-and-digest (list "PS2 ('> ');\n")))
(inferior-octave-send-list-and-digest
(list "disp(getenv(\"OCTAVE_SRCDIR\"))\n"))
(list "disp (getenv ('OCTAVE_SRCDIR'))\n"))
(process-put proc 'octave-srcdir
(unless (equal (car inferior-octave-output-list) "")
(car inferior-octave-output-list)))
@ -771,19 +772,19 @@ startup file, `~/.emacs-octave'."
(inferior-octave-send-list-and-digest
(list "more off;\n"
(unless (equal inferior-octave-output-string ">> ")
"PS1 (\"\\\\s> \");\n")
"PS1 ('\\s> ');\n")
(when (and inferior-octave-startup-file
(file-exists-p inferior-octave-startup-file))
(format "source (\"%s\");\n" inferior-octave-startup-file))))
(format "source ('%s');\n" inferior-octave-startup-file))))
(when inferior-octave-output-list
(insert-before-markers
(mapconcat 'identity inferior-octave-output-list "\n")))
;; And finally, everything is back to normal.
(set-process-filter proc 'comint-output-filter)
;; Just in case, to be sure a cd in the startup file
;; won't have detrimental effects.
(inferior-octave-resync-dirs)
;; Just in case, to be sure a cd in the startup file won't have
;; detrimental effects.
(with-demoted-errors (inferior-octave-resync-dirs))
;; Generate a proper prompt, which is critical to
;; `comint-history-isearch-backward-regexp'. Bug#14433.
(comint-send-string proc "\n")))
@ -799,7 +800,7 @@ startup file, `~/.emacs-octave'."
(unless (and (equal (car cache) command)
(< (float-time) (+ 5 (cadr cache))))
(inferior-octave-send-list-and-digest
(list (concat "completion_matches (\"" command "\");\n")))
(list (format "completion_matches ('%s');\n" command)))
(setq cache (list command (float-time)
(delete-consecutive-dups
(sort inferior-octave-output-list 'string-lessp)))))
@ -898,8 +899,8 @@ output is passed to the filter `inferior-octave-output-digest'."
"Tracks `cd' commands issued to the inferior Octave process.
Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
(when inferior-octave-directory-tracker-resync
(setq inferior-octave-directory-tracker-resync nil)
(inferior-octave-resync-dirs))
(or (inferior-octave-resync-dirs 'noerror)
(setq inferior-octave-directory-tracker-resync nil)))
(cond
((string-match "^[ \t]*cd[ \t;]*$" string)
(cd "~"))
@ -911,13 +912,17 @@ Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
(error-message-string err)
(match-string 1 string)))))))
(defun inferior-octave-resync-dirs ()
(defun inferior-octave-resync-dirs (&optional noerror)
"Resync the buffer's idea of the current directory.
This command queries the inferior Octave process about its current
directory and makes this the current buffer's default directory."
(interactive)
(inferior-octave-send-list-and-digest '("disp (pwd ())\n"))
(cd (car inferior-octave-output-list)))
(condition-case err
(progn
(cd (car inferior-octave-output-list))
t)
(error (unless noerror (signal (car err) (cdr err))))))
(defcustom inferior-octave-minimal-columns 80
"The minimal column width for the inferior Octave process."
@ -935,7 +940,7 @@ directory and makes this the current buffer's default directory."
(when (and inferior-octave-process
(process-live-p inferior-octave-process))
(inferior-octave-send-list-and-digest
(list (format "putenv(\"COLUMNS\", \"%s\");\n" width)))))))
(list (format "putenv ('COLUMNS', '%s');\n" width)))))))
;;; Miscellaneous useful functions
@ -989,7 +994,7 @@ directory and makes this the current buffer's default directory."
(setq found t)))
(unless found (goto-char orig))
found))))
(pcase (file-name-extension (buffer-file-name))
(pcase (and buffer-file-name (file-name-extension buffer-file-name))
(`"cc" (funcall search
"\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
(t (funcall search octave-function-header-regexp 3)))))
@ -1519,9 +1524,7 @@ code line."
(defun octave-eldoc-function-signatures (fn)
(unless (equal fn (car octave-eldoc-cache))
(inferior-octave-send-list-and-digest
(list (format "\
if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
fn fn)))
(list (format "print_usage ('%s');\n" fn)))
(let (result)
(dolist (line inferior-octave-output-list)
(when (string-match
@ -1622,7 +1625,7 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
"Display the documentation of FN."
(interactive (list (octave-completing-read)))
(inferior-octave-send-list-and-digest
(list (format "help \"%s\"\n" fn)))
(list (format "help ('%s');\n" fn)))
(let ((lines inferior-octave-output-list)
(inhibit-read-only t))
(when (string-match "error: \\(.*\\)$" (car lines))
@ -1658,12 +1661,15 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
(help-insert-xref-button (file-relative-name file dir)
'octave-help-file fn)
(insert "'")))
;; Make 'See also' clickable
;; Make 'See also' clickable.
(with-syntax-table octave-mode-syntax-table
(when (re-search-forward "^\\s-*See also:" nil t)
(let ((end (save-excursion (re-search-forward "^\\s-*$" nil t))))
(while (re-search-forward "\\_<\\(?:\\sw\\|\\s_\\)+\\_>" end t)
(make-text-button (match-beginning 0) (match-end 0)
(while (re-search-forward
;; Match operators and symbols.
"\\(?1:\\s.+?\\)\\(?:$\\|[,;]\\|\\s-\\)\\|\\_<\\(?1:\\(?:\\sw\\|\\s_\\)+\\)\\_>"
end t)
(make-text-button (match-beginning 1) (match-end 1)
:type 'octave-help-function)))))
(octave-help-mode)))))
@ -1716,12 +1722,13 @@ Functions implemented in C++ can be found if
(interactive (list (octave-completing-read)))
(require 'etags)
(let ((orig (point)))
(if (octave-goto-function-definition fn)
(if (and (derived-mode-p 'octave-mode)
(octave-goto-function-definition fn))
(ring-insert find-tag-marker-ring (copy-marker orig))
(inferior-octave-send-list-and-digest
;; help NAME is more verbose
(list (format "\
if iskeyword(\"%s\") disp(\"`%s' is a keyword\") else which(\"%s\") endif\n"
if iskeyword('%s') disp('`%s'' is a keyword') else which('%s') endif\n"
fn fn fn)))
(let (line file)
;; Skip garbage lines such as
@ -1738,6 +1745,5 @@ if iskeyword(\"%s\") disp(\"`%s' is a keyword\") else which(\"%s\") endif\n"
(find-file file)
(octave-goto-function-definition fn)))))))
(provide 'octave)
;;; octave.el ends here

View file

@ -1149,11 +1149,7 @@ VERSION is of the format (Major . Minor)"
(set (make-local-variable 'comment-start) "%")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-add) 1)
(set (make-local-variable 'comment-start-skip)
;; This complex regexp makes sure that comments cannot start
;; inside quoted atoms or strings
(format "^\\(\\(%s\\|%s\\|[^\n\'\"%%]\\)*\\)\\(/\\*+ *\\|%%+ *\\)"
prolog-quoted-atom-regexp prolog-string-regexp))
(set (make-local-variable 'comment-start-skip) "\\(?:/\\*+ *\\|%%+ *\\)")
(set (make-local-variable 'parens-require-spaces) nil)
;; Initialize Prolog system specific variables
(dolist (var '(prolog-keywords prolog-types prolog-mode-specificators
@ -1739,8 +1735,7 @@ This function must be called from the source code buffer."
(real-file buffer-file-name)
(command-string (prolog-build-prolog-command compilep file
real-file first-line))
(process (get-process "prolog"))
(old-filter (process-filter process)))
(process (get-process "prolog")))
(with-current-buffer buffer
(delete-region (point-min) (point-max))
;; FIXME: Wasn't this supposed to use prolog-inferior-mode?
@ -1759,8 +1754,7 @@ This function must be called from the source code buffer."
'prolog-parse-sicstus-compilation-errors))
(setq buffer-read-only nil)
(insert command-string "\n"))
(save-selected-window
(pop-to-buffer buffer))
(display-buffer buffer)
(setq prolog-process-flag t
prolog-consult-compile-output ""
prolog-consult-compile-first-line (if first-line (1- first-line) 0)
@ -1954,20 +1948,6 @@ If COMPILEP is non-nil, compile, otherwise consult."
;;-------------------------------------------------------------------
;; Auxiliary functions
(defun prolog-make-keywords-regexp (keywords &optional protect)
"Create regexp from the list of strings KEYWORDS.
If PROTECT is non-nil, surround the result regexp by word breaks."
(let ((regexp
(if (fboundp 'regexp-opt)
;; Emacs 20
;; Avoid compile warnings under earlier versions by using eval
(eval '(regexp-opt keywords))
;; Older Emacsen
(concat (mapconcat 'regexp-quote keywords "\\|")))
))
(if protect
(concat "\\<\\(" regexp "\\)\\>")
regexp)))
(defun prolog-font-lock-object-matcher (bound)
"Find SICStus objects method name for font lock.
@ -2084,20 +2064,16 @@ Argument BOUND is a buffer position limiting searching."
(if (eq prolog-system 'mercury)
(concat
"\\<\\("
(prolog-make-keywords-regexp prolog-keywords-i)
(regexp-opt prolog-keywords-i)
"\\|"
(prolog-make-keywords-regexp
(regexp-opt
prolog-determinism-specificators-i)
"\\)\\>")
(concat
"^[?:]- *\\("
(prolog-make-keywords-regexp prolog-keywords-i)
(regexp-opt prolog-keywords-i)
"\\)\\>"))
1 prolog-builtin-face))
(quoted_atom (list prolog-quoted-atom-regexp
2 'font-lock-string-face 'append))
(string (list prolog-string-regexp
1 'font-lock-string-face 'append))
;; SICStus specific patterns
(sicstus-object-methods
(if (eq prolog-system 'sicstus)
@ -2107,17 +2083,17 @@ Argument BOUND is a buffer position limiting searching."
(types
(if (eq prolog-system 'mercury)
(list
(prolog-make-keywords-regexp prolog-types-i t)
(regexp-opt prolog-types-i 'words)
0 'font-lock-type-face)))
(modes
(if (eq prolog-system 'mercury)
(list
(prolog-make-keywords-regexp prolog-mode-specificators-i t)
(regexp-opt prolog-mode-specificators-i 'words)
0 'font-lock-constant-face)))
(directives
(if (eq prolog-system 'mercury)
(list
(prolog-make-keywords-regexp prolog-directives-i t)
(regexp-opt prolog-directives-i 'words)
0 'prolog-warning-face)))
;; Inferior mode specific patterns
(prompt
@ -2211,8 +2187,6 @@ Argument BOUND is a buffer position limiting searching."
(list
head-predicates
head-predicates-1
quoted_atom
string
variables
important-elements
important-elements-1

View file

@ -246,7 +246,7 @@ Matching is independent of case if `case-fold-search' is non-nil and
FROM-STRING has no uppercase letters. Replacement transfers the case
pattern of the old text to the new text, if `case-replace' and
`case-fold-search' are non-nil and FROM-STRING has no uppercase
letters. \(Transferring the case pattern means that if the old text
letters. (Transferring the case pattern means that if the old text
matched is all caps, or capitalized, then its replacement is upcased
or capitalized.)
@ -1175,8 +1175,8 @@ is called only during interactive use.
For example, to check for occurrence of symbol at point use
\(setq occur-read-regexp-defaults-function
'find-tag-default-as-regexp\).")
(setq occur-read-regexp-defaults-function
'find-tag-default-as-regexp).")
(defun occur-read-regexp-defaults ()
"Return the latest regexp from `regexp-history'.
@ -1874,7 +1874,7 @@ It is called with three arguments, as if it were
(defun replace-search (search-string limit regexp-flag delimited-flag
case-fold-search)
"Search for the next occurence of SEARCH-STRING to replace."
"Search for the next occurrence of SEARCH-STRING to replace."
;; Let-bind global isearch-* variables to values used
;; to search the next replacement. These let-bindings
;; should be effective both at the time of calling

View file

@ -41,11 +41,11 @@ Each element of this list holds the arguments to one call to `defcustom'.")
(defmacro declare-function (_fn _file &optional _arglist _fileonly)
"Tell the byte-compiler that function FN is defined, in FILE.
Optional ARGLIST is the argument list used by the function. The
FILE argument is not used by the byte-compiler, but by the
Optional ARGLIST is the argument list used by the function.
The FILE argument is not used by the byte-compiler, but by the
`check-declare' package, which checks that FILE contains a
definition for FN. ARGLIST is used by both the byte-compiler and
`check-declare' to check for consistency.
definition for FN. ARGLIST is used by both the byte-compiler
and `check-declare' to check for consistency.
FILE can be either a Lisp file (in which case the \".el\"
extension is optional), or a C file. C files are expanded
@ -396,9 +396,9 @@ non-nil."
(defun number-sequence (from &optional to inc)
"Return a sequence of numbers from FROM to TO (both inclusive) as a list.
INC is the increment used between numbers in the sequence and defaults to 1.
So, the Nth element of the list is \(+ FROM \(* N INC)) where N counts from
So, the Nth element of the list is (+ FROM (* N INC)) where N counts from
zero. TO is only included if there is an N for which TO = FROM + N * INC.
If TO is nil or numerically equal to FROM, return \(FROM).
If TO is nil or numerically equal to FROM, return (FROM).
If INC is positive and TO is less than FROM, or INC is negative
and TO is larger than FROM, return nil.
If INC is zero and TO is neither nil nor numerically equal to
@ -408,11 +408,11 @@ This function is primarily designed for integer arguments.
Nevertheless, FROM, TO and INC can be integer or float. However,
floating point arithmetic is inexact. For instance, depending on
the machine, it may quite well happen that
\(number-sequence 0.4 0.6 0.2) returns the one element list \(0.4),
whereas \(number-sequence 0.4 0.8 0.2) returns a list with three
\(number-sequence 0.4 0.6 0.2) returns the one element list (0.4),
whereas (number-sequence 0.4 0.8 0.2) returns a list with three
elements. Thus, if some of the arguments are floats and one wants
to make sure that TO is included, one may have to explicitly write
TO as \(+ FROM \(* N INC)) or use a variable whose value was
TO as (+ FROM (* N INC)) or use a variable whose value was
computed with this exact expression. Alternatively, you can,
of course, also replace TO with a slightly larger value
\(or a slightly more negative value if INC is negative)."
@ -784,8 +784,8 @@ KEY is a key sequence; noninteractively, it is a string or vector
of characters or event types, and non-ASCII characters with codes
above 127 (such as ISO Latin-1) can be included if you use a vector.
The binding goes in the current buffer's local map,
which in most cases is shared with all other buffers in the same major mode."
The binding goes in the current buffer's local map, which in most
cases is shared with all other buffers in the same major mode."
(interactive "KSet key locally: \nCSet key %s locally to command: ")
(let ((map (current-local-map)))
(or map
@ -821,7 +821,7 @@ in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
If you don't specify OLDMAP, you can usually get the same results
in a cleaner way with command remapping, like this:
\(define-key KEYMAP [remap OLDDEF] NEWDEF)
(define-key KEYMAP [remap OLDDEF] NEWDEF)
\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)"
;; Don't document PREFIX in the doc string because we don't want to
;; advertise it. It's meant for recursive calls only. Here's its
@ -2540,7 +2540,7 @@ Set this to nil at your own risk..."
(defun locate-user-emacs-file (new-name &optional old-name)
"Return an absolute per-user Emacs-specific file name.
If NEW-NAME exists in `user-emacs-directory', return it.
Else If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
Else if OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
Else return NEW-NAME in `user-emacs-directory', creating the
directory if it does not exist."
(convert-standard-filename
@ -3231,7 +3231,7 @@ than cosmetic ones, undo data may become corrupted.
This macro will run BODY normally, but doesn't count its buffer
modifications as being buffer modifications. This affects things
like buffer-modified-p, checking whether the file is locked by
like `buffer-modified-p', checking whether the file is locked by
someone else, running buffer modification hooks, and other things
of that nature.
@ -3536,7 +3536,7 @@ which separates, but is not part of, the substrings. If nil it defaults to
`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
OMIT-NULLS is forced to t.
If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so
If OMIT-NULLS is t, zero-length substrings are omitted from the list (so
that for the default value of SEPARATORS leading and trailing whitespace
are effectively trimmed). If nil, all zero-length substrings are retained,
which correctly parses CSV format, for example.
@ -3733,18 +3733,18 @@ If FILE is already loaded, evaluate FORM right now.
If a matching file is loaded again, FORM will be evaluated again.
If FILE is a string, it may be either an absolute or a relative file
name, and may have an extension \(e.g. \".el\") or may lack one, and
name, and may have an extension (e.g. \".el\") or may lack one, and
additionally may or may not have an extension denoting a compressed
format \(e.g. \".gz\").
format (e.g. \".gz\").
When FILE is absolute, this first converts it to a true name by chasing
symbolic links. Only a file of this name \(see next paragraph regarding
symbolic links. Only a file of this name (see next paragraph regarding
extensions) will trigger the evaluation of FORM. When FILE is relative,
a file whose absolute true name ends in FILE will trigger evaluation.
When FILE lacks an extension, a file name with any extension will trigger
evaluation. Otherwise, its extension must match FILE's. A further
extension for a compressed format \(e.g. \".gz\") on FILE will not affect
extension for a compressed format (e.g. \".gz\") on FILE will not affect
this name matching.
Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
@ -4234,32 +4234,6 @@ use `called-interactively-p'."
(declare (obsolete called-interactively-p "23.2"))
(called-interactively-p 'interactive))
(defun function-arity (f &optional num)
"Return the (MIN . MAX) arity of F.
If the maximum arity is infinite, MAX is `many'.
F can be a function or a macro.
If NUM is non-nil, return non-nil iff F can be called with NUM args."
(if (symbolp f) (setq f (indirect-function f)))
(if (eq (car-safe f) 'macro) (setq f (cdr f)))
(let ((res
(if (subrp f)
(let ((x (subr-arity f)))
(if (eq (cdr x) 'unevalled) (cons (car x) 'many)))
(let* ((args (if (consp f) (cadr f) (aref f 0)))
(max (length args))
(opt (memq '&optional args))
(rest (memq '&rest args))
(min (- max (length opt))))
(if opt
(cons min (if rest 'many (1- max)))
(if rest
(cons (- max (length rest)) 'many)
(cons min max)))))))
(if (not num)
res
(and (>= num (car res))
(or (eq 'many (cdr res)) (<= num (cdr res)))))))
(defun set-temporary-overlay-map (map &optional keep-pred)
"Set MAP as a temporary keymap taking precedence over most other keymaps.
Note that this does NOT take precedence over the \"overriding\" maps

View file

@ -123,8 +123,6 @@
(easy-mmode-defmap log-view-mode-map
'(
;; FIXME: (copy-keymap special-mode-map) instead
(" " . scroll-up-command)
("-" . negative-argument)
("0" . digit-argument)
("1" . digit-argument)
@ -136,14 +134,6 @@
("7" . digit-argument)
("8" . digit-argument)
("9" . digit-argument)
("<" . beginning-of-buffer)
(">" . end-of-buffer)
("?" . describe-mode)
("h" . describe-mode)
("" . scroll-down-command)
(33554464 . scroll-down-command)
("q" . quit-window)
("g" . revert-buffer)
("\C-m" . log-view-toggle-entry-display)
("m" . log-view-toggle-mark-entry)
@ -162,6 +152,7 @@
("\M-n" . log-view-file-next)
("\M-p" . log-view-file-prev))
"Log-View's keymap."
:inherit special-mode-map
:group 'log-view)
(easy-menu-define log-view-mode-menu log-view-mode-map

View file

@ -115,10 +115,10 @@
;; Return non-nil if FILE is registered in this backend. Both this
;; function as well as `state' should be careful to fail gracefully
;; in the event that the backend executable is absent. It is
;; preferable that this function's body is autoloaded, that way only
;; preferable that this function's *body* is autoloaded, that way only
;; calling vc-registered does not cause the backend to be loaded
;; (all the vc-FOO-registered functions are called to try to find
;; the controlling backend for FILE.
;; the controlling backend for FILE).
;;
;; * state (file)
;;
@ -233,6 +233,7 @@
;; The implementation should pass the value of vc-register-switches
;; to the backend command. (Note: in older versions of VC, this
;; command took a single file argument and not a list.)
;; The REV argument is a historical leftover and is never used.
;;
;; - init-revision (file)
;;
@ -999,7 +1000,7 @@ current buffer."
nil)
(list (vc-backend-for-registration (buffer-file-name))
(list buffer-file-name))))
(t (error "No fileset is available here")))))
(t (error "File is not under version control")))))
(defun vc-dired-deduce-fileset ()
(let ((backend (vc-responsible-backend default-directory)))
@ -1041,6 +1042,11 @@ current buffer."
(eq p q)
(and (member p '(edited added removed)) (member q '(edited added removed)))))
(defun vc-read-backend (prompt)
(intern
(completing-read prompt (mapcar 'symbol-name vc-handled-backends)
nil 'require-match)))
;; Here's the major entry point.
;;;###autoload
@ -1099,8 +1105,9 @@ For old-style locking-based version control systems, like RCS:
((or (eq state 'up-to-date) (and verbose (eq state 'needs-update)))
(cond
(verbose
;; go to a different revision
;; Go to a different revision.
(let* ((revision
;; FIXME: Provide completion.
(read-string "Branch, revision, or backend to move to: "))
(revision-downcase (downcase revision)))
(if (member
@ -1161,15 +1168,10 @@ For old-style locking-based version control systems, like RCS:
(message "No files remain to be committed")
(if (not verbose)
(vc-checkin ready-for-commit backend)
(let* ((revision (read-string "New revision or backend: "))
(revision-downcase (downcase revision)))
(if (member
revision-downcase
(mapcar (lambda (arg) (downcase (symbol-name arg)))
vc-handled-backends))
(let ((vsym (intern revision-downcase)))
(dolist (file files) (vc-transfer-file file vsym)))
(vc-checkin ready-for-commit backend revision)))))))
(let ((new-backend (vc-read-backend "New backend: ")))
(if new-backend
(dolist (file files)
(vc-transfer-file file new-backend))))))))
;; locked by somebody else (locking VCSes only)
((stringp state)
;; In the old days, we computed the revision once and used it on

View file

@ -108,7 +108,7 @@
2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
* config.nt (HAVE_ACL_SET_FILE): Rename from HAVE_POSIX_ACL.
* inc/ms-w32.h (EOPNOTSUPP): New macro.
@ -636,7 +636,7 @@
2012-09-01 Daniel Colascione <dancol@dancol.org>
* inc/ms-w32.h (TERM_HEADER): Add for refactoring
* inc/ms-w32.h (TERM_HEADER): Add for refactoring.
2012-08-22 Juanma Barranquero <lekktu@gmail.com>
@ -934,8 +934,8 @@
(install-other-dirs-nmake, install-other-dirs-gmake): Depend on `all'.
(install-shortcuts): Depend on $(INSTALL_DIR)/bin. Copy addpm.exe
here.
(maybe-copy-distfiles-CMD, maybe-copy-distfiles-SH, dist): Depend
on create-tmp-dist-dir.
(maybe-copy-distfiles-CMD, maybe-copy-distfiles-SH, dist):
Depend on create-tmp-dist-dir.
* nmake.defs (DIRNAME): New variable.
(IFNOTSAMEDIR): Use $(DIRNAME)_same-dir.tst instead of

View file

@ -1,3 +1,34 @@
2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
* fileio.c (expand_file_name): Doc fix.
2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
* process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
Wait for self, not for 0. This can't hurt on GNU or similar
system, and may help with Cygwin.
* keyboard.c: Don't use PROP (...) as an lvalue.
(parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
Use set_prop (A, B), not PROP (A) = B.
2013-06-10 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (get_it_property): Use it->window instead of generating
a Lisp object from it->w.
2013-06-09 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (get_it_property): If it->object is a buffer, pass to
get-char-property the window that is being rendered, instead of
the buffer, to support window-specific overlays. (Bug#14575)
(compute_display_string_pos): When W is NULL, use the current
buffer as the object to pass to get-char-property.
(Fcurrent_bidi_paragraph_direction): Assign NULL to the window
pointer member of the bidi iterator, since no window is pertinent
to this function.
2013-06-08 Eli Zaretskii <eliz@gnu.org>
* bidi.c (bidi_fetch_char): Accept additional argument, the window
@ -8,8 +39,8 @@
* xdisp.c (init_from_display_pos, init_iterator)
(handle_single_display_spec, next_overlay_string)
(get_overlay_strings_1, reseat_1, reseat_to_string)
(push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set
bidi_it.w member from it->w.
(push_prefix_prop, Fcurrent_bidi_paragraph_direction):
Set bidi_it.w member from it->w.
(compute_display_string_pos): Accept additional argument, the
window being displayed, and pass it to Fget_char_property.
(Bug#14575)
@ -20,7 +51,7 @@
2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
* xgselect.c: Remove unneeded include xterm.h
* xgselect.c: Remove unneeded include xterm.h.
* process.c (wait_reading_process_output): Check for NS before GLIB.
GLIB may be linked in due to rsvg, but ns_select must be called.
@ -322,8 +353,8 @@
(update_frame_tool_bar): Update code for GNUStep.
(clearAll): New method.
(addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
identifierToItem setObject and activeIdentifiers addObject before
argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
Move identifierToItem setObject and activeIdentifiers addObject before
call to insertItemWithItemIdentifier.
(validateVisibleItems): Fix indentation.
(toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
@ -337,7 +368,7 @@
Use F suffix on floats.
(ns_char_width): Returns CGFloat.
(ns_ascii_average_width): w is CGFloat instead of float.
(nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
(nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
DPSxshow.
(ns_glyph_metrics): CGFloat instead of float.
@ -632,7 +663,7 @@
2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
* Makefile.in (LIB_ACL): New macro.
(LIBACL_LIBS): Remove.
(LIBES): Use LIB_ACL, not LIBACL_LIBS.
@ -3065,11 +3096,10 @@
2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
* xterm.c (scroll-bar-adjust-thumb-portion): New variable to
determine whether scroll bar thumb size should be adjusted or
not. Use variable for MOTIF.
determine whether scroll bar thumb size should be adjusted or not.
Use variable for MOTIF.
* gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
GTK.
* gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
@ -3614,7 +3644,7 @@
2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
Fix permissions bugs with setgid directories etc. (Bug#13125)
Fix permissions bugs with setgid directories etc. (Bug#13125)
* dired.c (Ffile_attributes): Return t as the 9th attribute,
to mark it as a placeholder. The old value was often wrong.
The only user of this attribute has been changed to use

View file

@ -15447,7 +15447,7 @@
* xterm.c (XTread_socket_hook): For X11, on map and unmap events
check the window manager hints for iconification status.
* xterm.c (x_make_widow_icon): For X11, just request
* xterm.c (x_make_window_icon): For X11, just request
iconification of the window manager.
1989-05-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu)

View file

@ -776,8 +776,9 @@ probably use `make-temp-file' instead, except in three circumstances:
DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
doc: /* Convert filename NAME to absolute, and canonicalize it.
Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
\(does not start with slash or tilde); if DEFAULT-DIRECTORY is nil or missing,
the current buffer's value of `default-directory' is used.
\(does not start with slash or tilde); both the directory name and
a directory's file name are accepted. If DEFAULT-DIRECTORY is nil or
missing, the current buffer's value of `default-directory' is used.
NAME should be a string that is a valid file name for the underlying
filesystem.
File name components that are `.' are removed, and

View file

@ -8150,11 +8150,12 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
#if !defined (USE_GTK) && !defined (HAVE_NS)
/* If we use build_desired_tool_bar_string to render the
tool bar, the separator is rendered as an image. */
PROP (TOOL_BAR_ITEM_IMAGES)
= menu_item_eval_property (Vtool_bar_separator_image_expression);
PROP (TOOL_BAR_ITEM_ENABLED_P) = Qnil;
PROP (TOOL_BAR_ITEM_SELECTED_P) = Qnil;
PROP (TOOL_BAR_ITEM_CAPTION) = Qnil;
set_prop (TOOL_BAR_ITEM_IMAGES,
(menu_item_eval_property
(Vtool_bar_separator_image_expression)));
set_prop (TOOL_BAR_ITEM_ENABLED_P, Qnil);
set_prop (TOOL_BAR_ITEM_SELECTED_P, Qnil);
set_prop (TOOL_BAR_ITEM_CAPTION, Qnil);
#endif
return 1;
}

View file

@ -7068,9 +7068,10 @@ init_process_emacs (void)
#endif
{
#if defined HAVE_GLIB && !defined WINDOWSNT
/* Tickle glib's child-handling code so that it initializes its
/* Tickle glib's child-handling code. Ask glib to wait for Emacs itself;
this should always fail, but is enough to initialize glib's
private SIGCHLD handler. */
g_source_unref (g_child_watch_source_new (0));
g_source_unref (g_child_watch_source_new (getpid ()));
#endif
catch_child_signal ();
}

View file

@ -3509,9 +3509,8 @@ compute_display_string_pos (struct text_pos *position,
if (string && STRINGP (string->lstring))
object1 = object = string->lstring;
else if (!string_p)
else if (w && !string_p)
{
eassert (w != NULL);
XSETWINDOW (object, w);
object1 = Qnil;
}
@ -18971,16 +18970,19 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
static Lisp_Object
get_it_property (struct it *it, Lisp_Object prop)
{
Lisp_Object position;
Lisp_Object position, object = it->object;
if (STRINGP (it->object))
if (STRINGP (object))
position = make_number (IT_STRING_CHARPOS (*it));
else if (BUFFERP (it->object))
position = make_number (IT_CHARPOS (*it));
else if (BUFFERP (object))
{
position = make_number (IT_CHARPOS (*it));
object = it->window;
}
else
return Qnil;
return Fget_char_property (position, prop, it->object);
return Fget_char_property (position, prop, object);
}
/* See if there's a line- or wrap-prefix, and if so, push it on IT. */
@ -20010,7 +20012,10 @@ See also `bidi-paragraph-direction'. */)
itb.string.lstring = Qnil;
itb.string.bufpos = 0;
itb.string.unibyte = 0;
itb.w = XWINDOW (selected_window);
/* We have no window to use here for ignoring window-specific
overlays. Using NULL for window pointer will cause
compute_display_string_pos to use the current buffer. */
itb.w = NULL;
bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
bidi_unshelve_cache (itb_data, 0);
set_buffer_temp (old);