Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

This commit is contained in:
K. Handa 2014-12-28 22:18:39 +09:00
commit c2f9c07aa0
133 changed files with 6347 additions and 3752 deletions

1
.gitignore vendored
View file

@ -48,6 +48,7 @@ makefile
/confdefs.h
/config.status
/configure.lineno
/conftest*
src/config.h
src/epaths.h

View file

@ -1,196 +1,15 @@
Copyright (C) 2006-2014 Free Software Foundation, Inc.
See end for license conditions.
This file contains information on Emacs developer processes.
For information on contributing to Emacs as a non-developer, see
(info "(emacs)Contributing") or
http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html
Contributing to Emacs
Emacs is a collaborative project and we encourage contributions from
anyone and everyone. If you want to contribute in the way that will
help us most, we recommend (1) fixing reported bugs and (2)
implementing the feature ideas in etc/TODO. However, if you think of
new features to add, please suggest them too -- we might like your
idea. Porting to new platforms is also useful, when there is a new
platform, but that is not common nowadays.
For documentation on Emacs (to understand how to implement your
desired change), refer to:
- the Emacs Manual
http://www.gnu.org/software/emacs/manual/emacs.html
(info "(Emacs)Top")
- the Emacs Lisp Reference Manual
http://www.gnu.org/software/emacs/manual/elisp.html
(info "(elisp)Top")
- http://www.gnu.org/software/emacs
- http://www.emacswiki.org/
There are many ways to contribute to Emacs:
- implement a new feature, and submit a patch (see "Submitting
Patches" below).
- answer questions on the Emacs user mailing list
https://lists.gnu.org/mailman/listinfo/help-gnu-emacs
- write documentation, either on the wiki, or in the Emacs source
repository (see "Submitting Patches" below)
- find and report bugs; use M-x report-emacs-bug
- check if existing bug reports are fixed in newer versions of Emacs
http://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=emacs
- develop a package that works with Emacs, and publish it on your own
or in Gnu ELPA (see admin/notes/elpa).
Here are some style and legal conventions for contributors to Emacs:
* Coding Standards
Contributed code should follow the GNU Coding Standards
(http://www.gnu.org/prep/standards/ - may also be available in info on
your system).
If it doesn't, we'll need to find someone to fix the code before we
can use it.
Emacs has additional style and coding conventions:
- the "Tips" Appendix in the Emacs Lisp Reference
http://www.gnu.org/software/emacs/manual/html_node/elisp/Tips.html
(info "(elisp)Tips").
- Avoid using `defadvice' or `eval-after-load' for Lisp code to be
included in Emacs.
- Remove all trailing whitespace in all source and text files.
- Emacs has no convention on whether to use tabs in source code;
please don't change whitespace in the files you edit.
- Use ?\s instead of ? in Lisp code for a space character.
* Copyright Assignment
The FSF (Free Software Foundation) is the copyright holder for GNU Emacs.
The FSF is a nonprofit with a worldwide mission to promote computer
user freedom and to defend the rights of all free software users.
For general information, see the website http://www.fsf.org/ .
Generally speaking, for non-trivial contributions to GNU Emacs we
require that the copyright be assigned to the FSF. For the reasons
behind this, see: http://www.gnu.org/licenses/why-assign.html .
Copyright assignment is a simple process. Residents of some countries
can do it entirely electronically. We can help you get started, and
answer any questions you may have (or point you to the people with the
answers), at the emacs-devel@gnu.org mailing list.
(Please note: general discussion about why some GNU projects ask
for a copyright assignment is off-topic for emacs-devel.
See gnu-misc-discuss instead.)
A copyright disclaimer is also a possibility, but we prefer an assignment.
Note that the disclaimer, like an assignment, involves you sending
signed paperwork to the FSF (simply saying "this is in the public domain"
is not enough). Also, a disclaimer cannot be applied to future work, it
has to be repeated each time you want to send something new.
We can accept small changes (roughly, fewer than 15 lines) without
an assignment. This is a cumulative limit (e.g. three separate 5 line
patches) over all your contributions.
* Getting the Source Code
The current working version of the Emacs source code is stored in a
git repository on the Savannah web site
(http://savannah.gnu.org/projects/emacs). It is important to write
your patch based on the current working version. If you start from an
older version, your patch may be outdated (so that maintainers will
have a hard time applying it), or changes in Emacs may have made your
patch unnecessary.
After you have downloaded the repository source, you should read the file
INSTALL.REPO for build instructions (they differ to some extent from a
normal build).
* Submitting Patches
Every patch must have several pieces of information before we
can properly evaluate it.
When you have all these pieces, bundle them up in a mail message and
send it to the developers. Sending it to bug-gnu-emacs@gnu.org
(which is the bug/feature list) is recommended, because that list
is coupled to a tracking system that makes it easier to locate patches.
If your patch is not complete and you think it needs more discussion,
you might want to send it to emacs-devel@gnu.org instead. If you
revise your patch, send it as a followup to the initial topic.
** Description
For bug fixes, a description of the bug and how your patch fixes it.
For new features, a description of the feature and your implementation.
** ChangeLog
A ChangeLog entry as plaintext (separate from the patch).
See the existing ChangeLog files for format and content. Note that,
unlike some other projects, we do require ChangeLogs for
documentation, i.e. Texinfo files.
Ref: "Change Log Concepts" node of the GNU Coding Standards Info
Manual, for how to write good log entries.
http://www.gnu.org/prep/standards/html_node/Change-Log-Concepts.html
When using git, commit messages should use ChangeLog format, with a
single short line explaining the change, then an empty line, then
unindented ChangeLog entries. (Essentially, a commit message should
be a duplicate of what the patch adds to the ChangeLog files. We are
planning to automate this better, to avoid the duplication.) You can
use the Emacs functions log-edit-add-to-changelog or
log-edit-insert-changelog to ease this process.
** The patch itself.
If you are accessing the Emacs repository, make sure your copy is
up-to-date (e.g. with 'git pull'). You can commit your changes
to a private branch and generate a patch from the master version
by using
git format-patch master
Or you can leave your changes uncommitted and use
git diff
With no repository, you can use
diff -u OLD NEW
** Mail format.
We prefer to get the patches as plain text, either inline (be careful
your mail client does not change line breaks) or as MIME attachments.
** Please reread your patch before submitting it.
** Do not mix changes.
If you send several unrelated changes together, we will ask you to
separate them so we can consider each of the changes by itself.
** Do not make formatting changes.
Making cosmetic formatting changes (indentation, etc) makes it harder
to see what you have really changed.
* Supplemental information for Emacs Developers.
* Information for Emacs Developers.
An "Emacs Developer" is someone who contributes a lot of code or
documentation to the Emacs repository.
documentation to the Emacs repository. Generally, they have write
access to the Emacs git repository on Savannah
https://savannah.gnu.org/git/?group=emacs.
** Write access to the Emacs repository.
@ -213,6 +32,31 @@ entry in their name, not yours. git distinguishes between the author
and the committer; use the --author option on the commit command to
specify the actual author; the committer defaults to you.
** commit messages
When using git, commit messages should use ChangeLog format, with the
following modifications:
- Add a single short line explaining the change, then an empty line,
then unindented ChangeLog entries.
You can use various Emacs functions to ease this process; see (info
"(emacs)Change Log Commands") or
http://www.gnu.org/software/emacs/manual/html_node/emacs/Change-Log-Commands.html.
- The summary line is limited to 72 characters (enforced by a commit
hook). If you have trouble making that a good summary, add a
paragraph below it, before the individual file descriptions.
- If only a single file is changed, the summary line can be the normal
file first line (starting with the asterisk). Then there is no
individual files section.
- Explaining the rationale for a design choice is best done in comments
in the source code. However, sometimes it is useful to describe just
the rationale for a change; that can be done in the commit message
between the summary line and the file entries.
** Changelog notes
- Emacs generally follows the GNU coding standards when it comes to
@ -222,11 +66,25 @@ specify the actual author; the committer defaults to you.
standards used to recommend) rather than 'like-this' (as they do
now), because `...' is so widely used elsewhere in Emacs.
- Some of the rules in the GNU coding standards section 5.2
"Commenting Your Work" also apply to Changelog entries: they must be
in English, and be complete sentences starting with a capital and
ending with a period (except the summary line should not end in a
period).
It is tempting to relax this rule for commit messages, since they
are somewhat transient. However, they are preserved indefinitely,
and have a reasonable chance of being read in the future, so it's
better that they have good presentation.
- There are multiple ChangeLogs in the emacs source; roughly one per
high-level directory. The ChangeLog entry for a commit belongs in the
lowest ChangeLog that is higher than or at the same level as any file
changed by the commit.
- Use the present tense; describe "what the change does", not "what
the change did".
- Preferred form for several entries with the same content:
* help.el (view-lossage):
@ -235,7 +93,13 @@ specify the actual author; the committer defaults to you.
(Rather than anything involving "ditto" and suchlike.)
- In ChangeLog files, there is no standard or recommended way to
- If the commit fixes a bug, add a separate line
Fixes: bug#NNNN
where NNNN is the bug number.
- In ChangeLog entries, there is no standard or recommended way to
identify revisions.
One way to identify revisions is by quoting their summary line.
@ -244,7 +108,7 @@ specify the actual author; the committer defaults to you.
"2014-01-16T05:43:35Z!esr@thyrsus.com". Often, "my previous commit"
will suffice.
- There is no need to make separate change log entries for files such
- There is no need to make separate ChangeLog entries for files such
as NEWS, MAINTAINERS, and FOR-RELEASE, or to indicate regeneration
of files such as 'configure'. "There is no need" means you don't
have to, but you can if you want to.
@ -260,16 +124,13 @@ Development is discussed on the emacs-devel mailing list.
Sometime before the release of a new major version of Emacs a "feature
freeze" is imposed on the trunk, to prepare for creating a release
branch. No new features may be added to the trunk after this point,
until the release branch is created. This freeze is announced on the
emacs-devel mailing list, and not anywhere else.
until the release branch is created. Announcements about the freeze
(and other important events) are made on the info-gnu-emacs mailing
list, and not anywhere else.
The trunk branch is named "master" in git; release branches are named
"emacs-nn" where "nn" is the major version.
You must follow emacs-devel to know exactly what kinds of changes are
allowed on what branch at any time. Announcements about the freeze
(and other important events) will contain "ANNOUNCE" in the subject.
If you are fixing a bug that exists in the current release, be sure to
commit it to the release branch; it will be merged to the master
branch later.
@ -287,6 +148,23 @@ then exclude that commit from the merge to trunk.
See all the files in admin/notes/* . In particular, see
admin/notes/newfile, see admin/notes/repo.
*** git vs rename
git does not explicitly represent a file renaming; it uses a percent
changed heuristic to deduce that a file was renamed. So if you are
planning to make extensive changes to a file after renaming it (or
moving it to another directory), you should:
- create a feature branch
- commit the rename without any changes
- make other changes
- merge the feature branch to trunk, _not_ squashing the commits into
one. The commit message on this merge should summarize the renames
and all the changes.
** Emacs Mailing lists.
Discussion about Emacs development takes place on emacs-devel@gnu.org.

View file

@ -1,3 +1,52 @@
2014-12-27 Paul Eggert <eggert@cs.ucla.edu>
* .gitignore: Ignore /conftest*.
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* build-aux/git-hooks/commit-msg (at_sign): Bump up line-length limit
to 78.
2014-12-25 Paul Eggert <eggert@cs.ucla.edu>
Prefer stpcpy to strcat
* admin/merge-gnulib (GNULIB_MODULES): Add stpcpy.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/stpcpy.c, m4/stpcpy.m4: New files, from gnulib.
* lib-src/ebrowse.c (sym_scope_1, operator_name, open_file):
* lib-src/emacsclient.c (get_server_config, set_local_socket)
(start_daemon_and_retry_set_socket):
* lib-src/etags.c (main, C_entries, relative_filename):
* lib-src/pop.c (sendline):
* lib-src/update-game-score.c (main):
* lwlib/xlwmenu.c (resource_widget_value):
* src/callproc.c (child_setup):
* src/dbusbind.c (xd_signature_cat):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/editfns.c (Fuser_full_name):
* src/frame.c (xrdb_get_resource):
* src/gtkutil.c (xg_get_file_with_chooser):
* src/tparam.c (tparam1):
* src/xfns.c (xic_create_fontsetname):
* src/xrdb.c (gethomedir, get_user_db, get_environ_db):
* src/xsmfns.c (smc_save_yourself_CB):
Rewrite to avoid the need for strcat, typically by using stpcpy
and/or lispstpcpy. strcat tends to be part of O(N**2) algorithms.
* src/doc.c (sibling_etc):
* src/xrdb.c (xdefaults):
Now a top-level static constant.
2014-12-24 Stephen Leake <stephen_leake@stephe-leake.org>
* CONTRIBUTE: Move user-level information to doc/emacs/trouble.texi.
Add Savannah url, cleanup announcing freeze.
(commit messages): New, gathered from comments on emacs-devel.
(Changelog notes): Add reference to GNU coding standards section 5.2;
doc 'present tense', bug fix format.
(branches): Freeze announcements are made on info-gnu-emacs mailing
list.
(git vs rename): New.
2014-12-23 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib
@ -8,16 +57,7 @@
2014-12-14 Paul Eggert <eggert@cs.ucla.edu>
Spelling fixes
All uses changed.
* lib-src/etags.c (analyze_regex): Rename from analyse_regex.
* lisp/cedet/semantic/lex-spp.el:
(semantic-lex-spp-analyzer-do-replace):
Rename from semantic-lex-spp-anlyzer-do-replace.
* lisp/emacs-lisp/cconv.el (cconv--analyze-use):
Rename from cconv--analyse-use.
(cconv--analyze-function): Rename from cconv--analyse-function.
(cconv-analyze-form): Rename from cconv-analyse-form.
Spelling fixes. All uses changed.
* src/regex.c (analyze_first): Rename from analyze_first.
2014-12-14 Glenn Morris <rgm@gnu.org>
@ -277,7 +317,8 @@
2014-11-11 Eric S. Raymond <esr@thyrsus.com>
* Makefile.in: git transition - set VCWITNESS appropriately for git.
Git transition.
* Makefile.in (src): Set VCSWITNESS appropriately for git.
All bzr revision IDS, and all CVS revision IDs for which a commit
could be identified, were changed to time-date!committer version

View file

@ -1,8 +1,14 @@
2014-12-24 Glenn Morris <rgm@gnu.org>
* authors.el (authors-obsolete-files-regexps)
(authors-ignored-files, authors-valid-file-names)
(authors-renamed-files-alist, authors-renamed-files-regexps):
Additions.
2014-12-14 Paul Eggert <eggert@cs.ucla.edu>
* notes/unicode: Track leim/quail file renames.
Correct coding system
of lisp/international/titdic-cnv.el.
Correct coding system of lisp/international/titdic-cnv.el.
2014-12-14 Glenn Morris <rgm@gnu.org>

View file

@ -240,7 +240,7 @@ If REALNAME is nil, ignore that author.")
(defvar authors-obsolete-files-regexps
'(".*loaddefs.el$" ; not obsolete, but auto-generated
"\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting
"\\.\\(bzr\\|cvs\\|git\\)ignore$" ; obsolete or uninteresting
"\\.arch-inventory$"
"automated/data/" ; not interesting
;; TODO lib/? Matches other things?
@ -314,6 +314,7 @@ Changes to files matching one of the regexps in this list are not listed.")
"CODINGS" "CHARSETS"
"calc/INSTALL" "calc/Makefile" "calc/README.prev"
"vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/
"notes/BRANCH" "notes/exit-value"
"emacsver.texi.in"
"vpath.sed"
"Cocoa/Emacs.base/Contents/Info.plist"
@ -634,6 +635,7 @@ Changes to files in this list are not listed.")
"images/page-down.xpm" "images/widen.pbm" "images/widen.xpm"
"images/gnus/bar.xbm" "images/gnus/bar.xpm"
"images/gnus/reverse-smile.xpm"
"notes/commits" "notes/changelogs"
"revdiff" ; admin/
"vcdiff" "rcs-checkin" "tindex.pl"
"mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
@ -661,6 +663,7 @@ Changes to files in this list are not listed.")
"org-lparse.el"
"org-special-blocks.el" "org-taskjuggler.el"
"progmodes/cap-words.el"
"w32-common-fns.el"
;; gnus
"nnwfm.el" "nnlistserv.el" "nnkiboze.el" "nndb.el" "nnsoup.el"
"netrc.el" "password.el" "sasl-cram.el" "sasl-digest.el" "sasl-ntlm.el"
@ -691,7 +694,7 @@ Changes to files in this list are not listed.")
"etags-vmslib.c" "fakemail.c" "getdate.c" "getopt.h" "getopt1.c"
"getopt_.h" "getopt_int.h" "gettext.h" "leditcfns.c" "loadst.c"
"make-path.c" "qsort.c" "sorted-doc.c" "tcp.c" "timer.c" "wakeup.c"
"yow.c" "grep-changelog"
"yow.c" "grep-changelog" "grep-changelog.1"
;; etc/
"emacsclient.c" "etags.c" "hexl.c" "make-docfile.c" "movemail.c"
"test-distrib.c" "testfile"
@ -801,6 +804,7 @@ in the repository.")
;; The one in lisp is eshell/eshell.el.
("eshell.el" . "automated/eshell.el")
("eshell/esh-test.el" . "automated/eshell.el")
("automated/cl-lib.el" . "automated/cl-lib-tests.el")
("automated/package-x-test.el" . "automated/package-test.el")
;; INSTALL-CVS -> .CVS -> .BZR -> .REPO
("INSTALL-CVS" . "INSTALL.REPO")
@ -867,6 +871,8 @@ in the repository.")
("grammars/wisent-grammar.el" . "wisent/grammar.el")
;; Moved from admin/nt/ to nt/.
("nt/README.W32" . "README.W32")
("notes/BRANCH" . "notes/repo")
("notes/bzr" . "notes/repo")
)
"Alist of files which have been renamed during their lifetime.
Elements are (OLDNAME . NEWNAME).")
@ -939,6 +945,8 @@ ediff\\|emerge\\|log-edit\\|log-view\\|pcvs\\|smerge-mode\\|vc\\)\\.el\\'"
("comint-testsuite.el" "automated/\\&")
("\\`\\(bytecomp\\|font-parse\\|icalendar\\|occur\\|newsticker\\)\
-testsuite\\.el" "automated/\\1-tests.el")
("automated/flymake/warnpred/\\(Makefile\\|test\\.\\(?:c\\|pl\\)\\)\\'"
"automated/data/flymake/\\1")
;; NB lax rules should come last.
("^m/m-\\(.*\\.h\\)$" "m/\\1" t)
("^m-\\(.*\\.h\\)$" "\\1" t)

View file

@ -36,7 +36,7 @@ GNULIB_MODULES='
manywarnings memrchr mkostemp mktime
pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat
sig2str socklen stat-time stdalign stddef stdio
strftime strtoimax strtoumax symlink sys_stat
stpcpy strftime strtoimax strtoumax symlink sys_stat
sys_time time time_r timer-time timespec-add timespec-sub
unsetenv update-copyright utimens
vla warnings

View file

@ -87,8 +87,8 @@ exec $awk '
status = 1
}
72 < length && $0 ~ space {
print "Line longer than 72 characters in commit message"
78 < length && $0 ~ space {
print "Line longer than 78 characters in commit message"
status = 1
}

View file

@ -1,3 +1,11 @@
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* buffers.texi (Kill Buffer): Improve indexing.
2014-12-24 Stephen Leake <stephen_leake@stephe-leake.org>
* trouble.texi: Move user-level information from CONTRIBUTE here.
2014-12-14 Alan Mackenzie <acm@muc.de>
* display.texi (Scrolling): fast-but-imprecise-scrolling.

View file

@ -269,11 +269,16 @@ can also be used to copy text from one buffer to another.
@section Killing Buffers
@cindex killing buffers
@cindex close buffer
@cindex close file
If you continue an Emacs session for a while, you may accumulate a
large number of buffers. You may then find it convenient to @dfn{kill}
the buffers you no longer need. On most operating systems, killing a
buffer releases its space back to the operating system so that other
programs can use it. Here are some commands for killing buffers:
the buffers you no longer need. (Some other editors call this
operation @dfn{close}, and talk about ``closing the buffer'' or
``closing the file'' visited in the buffer.) On most operating
systems, killing a buffer releases its space back to the operating
system so that other programs can use it. Here are some commands for
killing buffers:
@table @kbd
@item C-x k @var{bufname} @key{RET}

View file

@ -1358,7 +1358,7 @@ searches through each directory in the Emacs Lisp load path, trying to
find a file matching that library name. If the library name is
@samp{@var{foo}}, it tries looking for files named
@file{@var{foo}.elc}, @file{@var{foo}.el}, and @file{@var{foo}}. The
default behaviour is to load the first file found. This command
default behavior is to load the first file found. This command
prefers @file{.elc} files over @file{.el} files because compiled files
load and run faster. If it finds that @file{@var{lib}.el} is newer
than @file{@var{lib}.elc}, it issues a warning, in case someone made

View file

@ -1060,19 +1060,44 @@ but using it will take extra work. Maintaining GNU Emacs is a lot of
work in the best of circumstances, and we can't keep up unless you do
your best to help.
Every patch must have several pieces of information before we
can properly evaluate it.
When you have all these pieces, bundle them up in a mail message and
send it to the developers. Sending it to
@email{bug-gnu-emacs@@gnu.org} (which is the bug/feature list) is
recommended, because that list is coupled to a tracking system that
makes it easier to locate patches. If your patch is not complete and
you think it needs more discussion, you might want to send it to
@email{emacs-devel@@gnu@@gnu.org} instead. If you revise your patch,
send it as a followup to the initial topic.
We prefer to get the patches as plain text, either inline (be careful
your mail client does not change line breaks) or as MIME attachments.
@itemize @bullet
@item
Send an explanation with your changes of what problem they fix or what
improvement they bring about. For a fix for an existing bug, it is
Include an explanation with your changes of what problem they fix or what
improvement they bring about.
@itemize
@item
For a fix for an existing bug, it is
best to reply to the relevant discussion on the @samp{bug-gnu-emacs}
list, or the bug entry in the GNU Bug Tracker at
@url{http://debbugs.gnu.org}. Explain why your change fixes the bug.
@item
Always include a proper bug report for the problem you think you have
fixed. We need to convince ourselves that the change is right before
installing it. Even if it is correct, we might have trouble
understanding it if we don't have a way to reproduce the problem.
For a new feature, include a description of the feature and your
implementation.
@item
For a new bug, include a proper bug report for the problem you think
you have fixed. We need to convince ourselves that the change is
right before installing it. Even if it is correct, we might have
trouble understanding it if we don't have a way to reproduce the
problem.
@end itemize
@item
Include all the comments that are appropriate to help people reading the
@ -1104,6 +1129,8 @@ right away. That gives us the option of installing it immediately if it
is important.
@item
The patch itself.
Use @samp{diff -c} to make your diffs. Diffs without context are hard
to install reliably. More than that, they are hard to study; we must
always study a patch to decide whether we want to install it. Unidiff
@ -1114,6 +1141,12 @@ If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when
making diffs of C code. This shows the name of the function that each
change occurs in.
If you are using the Emacs repository, make sure your copy is
up-to-date (e.g. with @code{git pull}). You can commit your changes
to a private branch and generate a patch from the master version by
using @code{git format-patch master}. Or you can leave your changes
uncommitted and use @code{git diff}.
@item
Avoid any ambiguity as to which is the old version and which is the new.
Please make the old version the first argument to diff, and the new
@ -1138,8 +1171,16 @@ feel that the purpose needs explaining, it probably does---but put the
explanation in comments in the code. It will be more useful there.
Please look at the change log entries of recent commits to see what
sorts of information to put in, and to learn the style that we use.
@xref{Change Log}.
sorts of information to put in, and to learn the style that we use. Note that,
unlike some other projects, we do require change logs for
documentation, i.e. Texinfo files.
@xref{Change Log},
@ifset WWW_GNU_ORG
see
@url{http://www.gnu.org/prep/standards/html_node/Change-Log-Concepts.html},
@end ifset
@xref{Change Log Concepts, Change Log Concepts,
Change Log Concepts, gnu-coding-standards, GNU Coding Standards}.
@item
When you write the fix, keep in mind that we can't install a change that
@ -1160,11 +1201,52 @@ Please help us keep up with the workload by designing the patch in a
form that is clearly safe to install.
@end itemize
@c FIXME: Include the node above?
@node Contributing
@section Contributing to Emacs Development
@cindex contributing to Emacs
Emacs is a collaborative project and we encourage contributions from
anyone and everyone.
There are many ways to contribute to Emacs:
@itemize
@item
find and report bugs; @xref{Bugs}.
@item
answer questions on the Emacs user mailing list
@url{https://lists.gnu.org/mailman/listinfo/help-gnu-emacs}.
@item
write documentation, either on the wiki, or in the Emacs source
repository (@pxref{Sending Patches}).
@item
check if existing bug reports are fixed in newer versions of Emacs
@url{http://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=emacs}.
@item
fix existing bug reports
@url{http://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=emacs}.
@item
@c etc/TODO not in WWW_GNU_ORG
implement a feature listed in the @file{etc/TODO} file in the Emacs
distribution, and submit a patch.
@item
implement a new feature, and submit a patch.
@item
develop a package that works with Emacs, and publish it on your own
or in Gnu ELPA (@url{https://elpa.gnu.org/}).
@item
port Emacs to a new platform, but that is not common nowadays.
@end itemize
If you would like to work on improving Emacs, please contact the maintainers at
@ifnothtml
@email{emacs-devel@@gnu.org}.
@ -1186,24 +1268,148 @@ you have not yet started work, it is useful to contact
before you start; it might be possible to suggest ways to make your
extension fit in better with the rest of Emacs.
When implementing a feature, please follow the Emacs coding standards;
@xref{Coding Standards}. In addition, non-trivial contributions
require a copyright assignment to the FSF; @xref{Copyright Assignment}.
The development version of Emacs can be downloaded from the
repository where it is actively maintained by a group of developers.
See the Emacs project page
@url{http://savannah.gnu.org/projects/emacs/} for details.
@url{http://savannah.gnu.org/projects/emacs/} for access details.
For more information on how to contribute, see the
It is important to write your patch based on the current working
version. If you start from an older version, your patch may be
outdated (so that maintainers will have a hard time applying it), or
changes in Emacs may have made your patch unnecessary. After you have
downloaded the repository source, you should read the file
@file{INSTALL.REPO} for build instructions (they differ to some extent
from a normal build).
If you would like to make more extensive contributions, see the
@file{./CONTRIBUTE} file in the Emacs distribution for information on
how to be an Emacs developer.
For documentation on Emacs (to understand how to implement your
desired change), refer to:
@itemize
@item
@ifset WWW_GNU_ORG
@ifhtml
@url{http://gnu.org/software/emacs/CONTRIBUTE, etc/CONTRIBUTE}
the Emacs Manual
@url{http://www.gnu.org/software/emacs/manual/emacs.html}.
@end ifhtml
@ifnothtml
@file{etc/CONTRIBUTE}
@xref{Top, Emacs Manual,,emacs}.
@end ifnothtml
@end ifset
@ifclear WWW_GNU_ORG
@file{etc/CONTRIBUTE}
@xref{Top, Emacs Manual,,emacs}.
@end ifclear
file in the Emacs distribution.
@item
@ifset WWW_GNU_ORG
@ifhtml
the Emacs Lisp Reference Manual
@url{http://www.gnu.org/software/emacs/manual/elisp.html}.
@end ifhtml
@ifnothtml
@xref{Top, Emacs Lisp Reference Manual,,elisp}.
@end ifnothtml
@end ifset
@ifclear WWW_GNU_ORG
@xref{Top, Emacs Lisp Reference Manual,,elisp}.
@end ifclear
@item
@url{http://www.gnu.org/software/emacs}
@item
@url{http://www.emacswiki.org/}
@end itemize
@menu
* Coding Standards:: Gnu Emacs coding standards
* Copyright Assignment:: assigning copyright to the FSF
@end menu
@node Coding Standards
@subsection Coding Standards
@cindex coding standards
Contributed code should follow the GNU Coding Standards
@url{http://www.gnu.org/prep/standards/}. This may also be available
in info on your system.
If it doesn't, we'll need to find someone to fix the code before we
can use it.
Emacs has additional style and coding conventions:
@itemize
@item
@ifset WWW_GNU_ORG
@ifhtml
the "Tips" Appendix in the Emacs Lisp Reference
@url{http://www.gnu.org/software/emacs/manual/html_node/elisp/Tips.html}.
@end ifhtml
@ifnothtml
@xref{Tips, "Tips" Appendix in the Emacs Lisp Reference, Tips
Appendix, elisp, Emacs Lisp Reference}.
@end ifnothtml
@end ifset
@ifclear WWW_GNU_ORG
@xref{Tips, "Tips" Appendix in the Emacs Lisp Reference, Tips
Appendix, elisp, Emacs Lisp Reference}.
@end ifclear
@item
Avoid using @code{defadvice} or @code{eval-after-load} for Lisp code
to be included in Emacs.
@item
Remove all trailing whitespace in all source and text files.
@item
Emacs has no convention on whether to use tabs in source code; please
don't change whitespace in the files you edit.
@item
Use @code{?\s} instead of @code{? } in Lisp code for a space character.
@end itemize
@node Copyright Assignment
@subsection Copyright Assignment
@cindex copyright assignment
The FSF (Free Software Foundation) is the copyright holder for GNU Emacs.
The FSF is a nonprofit with a worldwide mission to promote computer
user freedom and to defend the rights of all free software users.
For general information, see the website @url{http://www.fsf.org/}.
Generally speaking, for non-trivial contributions to GNU Emacs we
require that the copyright be assigned to the FSF. For the reasons
behind this, see @url{http://www.gnu.org/licenses/why-assign.html}.
Copyright assignment is a simple process. Residents of some countries
can do it entirely electronically. We can help you get started, and
answer any questions you may have (or point you to the people with the
answers), at the @email{emacs-devel@@gnu.org} mailing list.
(Please note: general discussion about why some GNU projects ask
for a copyright assignment is off-topic for emacs-devel.
See gnu-misc-discuss instead.)
A copyright disclaimer is also a possibility, but we prefer an assignment.
Note that the disclaimer, like an assignment, involves you sending
signed paperwork to the FSF (simply saying "this is in the public domain"
is not enough). Also, a disclaimer cannot be applied to future work, it
has to be repeated each time you want to send something new.
We can accept small changes (roughly, fewer than 15 lines) without
an assignment. This is a cumulative limit (e.g. three separate 5 line
patches) over all your contributions.
@node Service
@section How To Get Help with GNU Emacs
@ -1211,8 +1417,8 @@ file in the Emacs distribution.
@cindex help-gnu-emacs mailing list
@cindex gnu.emacs.help newsgroup
If you need help installing, using or changing GNU Emacs, there are two
ways to find it:
If you need help installing, using or changing GNU Emacs, there are
two ways to find it:
@itemize @bullet
@item

View file

@ -1,3 +1,129 @@
2014-12-27 Glenn Morris <rgm@gnu.org>
* control.texi (Pattern matching case statement):
* os.texi (Desktop Notifications):
* modes.texi (Defining Minor Modes, SMIE Lexer): Markup fixes.
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* windows.texi (Recombining Windows): Index subject of sections.
* variables.texi (Variables with Restricted Values)
(Generalized Variables): Index subject of sections.
* text.texi (Buffer Contents, Examining Properties)
(Changing Properties, Property Search, Substitution): Index
subject of sections.
* syntax.texi (Motion and Syntax, Parsing Expressions)
(Motion via Parsing, Position Parse, Control Parsing): Index
subject of sections.
* strings.texi (Predicates for Strings, Creating Strings)
(Modifying Strings, Text Comparison): Index subject of sections.
* searching.texi (Syntax of Regexps, Regexp Special)
(Regexp Functions, Regexp Functions): Index subject of sections.
* processes.texi (Subprocess Creation, Process Information): Index
subject of sections.
* positions.texi (Screen Lines): Index subject of sections.
* nonascii.texi (Scanning Charsets, Specifying Coding Systems):
Index subject of sections.
* minibuf.texi (Text from Minibuffer, Object from Minibuffer)
(Multiple Queries, Minibuffer Contents): Index subject of
sections.
* markers.texi (Predicates on Markers, Creating Markers)
(Information from Markers, Moving Markers): Index subject of
sections.
* macros.texi (Defining Macros, Problems with Macros): Index
subject of sections.
* loading.texi (Loading Non-ASCII, Where Defined): Index subject
of sections.
* lists.texi (List-related Predicates, List Variables, Setcar)
(Setcdr, Plist Access): Index subject of sections.
* keymaps.texi (Controlling Active Maps, Scanning Keymaps)
(Modifying Menus): Index subject of sections.
* help.texi (Accessing Documentation, Help Functions): Index
subject of sections.
* hash.texi (Hash Access): Index subject of sections.
* functions.texi (Core Advising Primitives)
(Advising Named Functions, Porting old advices): Index subject of
sections.
* frames.texi (Creating Frames, Initial Parameters)
(Position Parameters, Buffer Parameters, Minibuffers and Frames)
(Pop-Up Menus, Drag and Drop): Index subject of sections.
* files.texi (Visiting Functions, Kinds of Files)
(Unique File Names): Index subject of sections.
* display.texi (Refresh Screen, Echo Area Customization)
(Warning Variables, Warning Options, Delayed Warnings)
(Temporary Displays, Managing Overlays, Overlay Properties)
(Finding Overlays, Size of Displayed Text, Defining Faces)
(Attribute Functions, Displaying Faces, Face Remapping)
(Basic Faces, Font Lookup, Fontsets, Replacing Specs)
(Defining Images, Showing Images): Index subject of sections.
* debugging.texi (Debugging, Explicit Debug)
(Invoking the Debugger, Excess Open, Excess Close): Index subject
of sections.
* customize.texi (Defining New Types, Applying Customizations)
(Custom Themes): Index subject of sections.
* control.texi (Sequencing, Combining Conditions)
(Processing of Errors, Cleanups): Index subject of sections.
* compile.texi (Eval During Compile): Index subject of sections.
* commands.texi (Using Interactive, Distinguish Interactive)
(Command Loop Info, Classifying Events, Event Mod)
(Invoking the Input Method): Index subject of sections.
* buffers.texi (Buffer List, Buffer Gap): Index subject of sections.
* backups.texi (Making Backups, Numbered Backups, Backup Names)
(Reverting): Index subject of sections.
* abbrevs.texi (Abbrev Tables, Defining Abbrevs, Abbrev Files)
(Abbrev Expansion, Standard Abbrev Tables, Abbrev Properties)
(Abbrev Table Properties): Index subject of sections.
* os.texi (Time of Day, Time Conversion, Time Parsing)
(Time Calculations, Idle Timers): Index subject of sections.
2014-12-25 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Windows): Resync @menu order with @node order.
* minibuf.texi (Minibuffer Windows): Add descriptions of
`resize-mini-windows' and `max-mini-window-height'.
2014-12-25 Glenn Morris <rgm@gnu.org>
* windows.texi (Windows): Sync @menu order with @node order.
* sequences.texi (Sequence Functions): Copyedits.
* control.texi (Pattern matching case statement):
* positions.texi (List Motion):
* streams.texi (Output Functions):
* strings.texi (Text Comparison):
* text.texi (Document Object Model): Markup fixes.
2014-12-22 Paul Eggert <eggert@cs.ucla.edu>
Remove obsolete references to pre-C99 builds
@ -18,6 +144,12 @@
* display.texi (Low-Level Font): Document font-info and query-font.
2014-12-18 Stefan Monnier <monnier@iro.umontreal.ca>
* display.texi (Forcing Redisplay): Remove references to
redisplay-dont-pause and redisplay-preemption-period (which doesn't
even exist).
2014-12-16 Nicolas Petton <petton.nicolas@gmail.com>
* sequences.texi (Seq Library): Add documentation for seq.el.

View file

@ -59,6 +59,7 @@ expanded in the buffer. For the user-level commands for abbrevs, see
@node Abbrev Tables
@section Abbrev Tables
@cindex abbrev tables
This section describes how to create and manipulate abbrev tables.
@ -126,6 +127,7 @@ to add these to @var{name} separately.)
@node Defining Abbrevs
@section Defining Abbrevs
@cindex defining abbrevs
@code{define-abbrev} is the low-level basic function for defining an
abbrev in an abbrev table.
@ -181,6 +183,7 @@ callers.
@node Abbrev Files
@section Saving Abbrevs in Files
@cindex save abbrevs in files
A file of saved abbrev definitions is actually a file of Lisp code.
The abbrevs are saved in the form of a Lisp program to define the same
@ -232,6 +235,9 @@ define the same abbrevs. If @var{filename} is @code{nil} or omitted,
@node Abbrev Expansion
@section Looking Up and Expanding Abbreviations
@cindex looking up abbrevs
@cindex expanding abbrevs
@cindex abbrevs, looking up and expanding
Abbrevs are usually expanded by certain interactive commands,
including @code{self-insert-command}. This section describes the
@ -367,6 +373,7 @@ definitions of @code{local-abbrev-table} and @code{text-mode-abbrev-table}.
@node Standard Abbrev Tables
@section Standard Abbrev Tables
@cindex standard abbrev tables
Here we list the variables that hold the abbrev tables for the
preloaded major modes of Emacs.
@ -409,6 +416,7 @@ Properties}.
@node Abbrev Properties
@section Abbrev Properties
@cindex abbrev properties
Abbrevs have properties, some of which influence the way they work.
You can provide them as arguments to @code{define-abbrev}, and
@ -449,6 +457,7 @@ modifies the capitalization of the expansion.
@node Abbrev Table Properties
@section Abbrev Table Properties
@cindex abbrev table properties
Like abbrevs, abbrev tables have properties, some of which influence
the way they work. You can provide them as arguments to

View file

@ -50,6 +50,7 @@ don't want them any more, or Emacs can delete them automatically.
@node Making Backups
@subsection Making Backup Files
@cindex making backup files
@defun backup-buffer
This function makes a backup of the file visited by the current
@ -238,6 +239,7 @@ The default is 200.
@node Numbered Backups
@subsection Making and Deleting Numbered Backup Files
@cindex numbered backups
If a file's name is @file{foo}, the names of its numbered backup
versions are @file{foo.~@var{v}~}, for various integers @var{v}, like
@ -299,6 +301,7 @@ file. The default is@tie{}2.
@node Backup Names
@subsection Naming Backup Files
@cindex naming backup files
The functions in this section are documented mainly because you can
customize the naming conventions for backup files by redefining them.
@ -668,6 +671,7 @@ not initialize @code{auto-save-list-file-name}.
@node Reverting
@section Reverting
@cindex reverting buffers
If you have made extensive changes to a file and then change your mind
about them, you can get rid of them by reading in the previous version

View file

@ -762,6 +762,7 @@ signal an error if the current buffer is read-only.
@node Buffer List
@section The Buffer List
@cindex buffer list
@cindex listing all buffers
The @dfn{buffer list} is a list of all live buffers. The order of the
buffers in this list is based primarily on how recently each buffer has
@ -1215,6 +1216,7 @@ in the text it is swapped with will not interfere with auto-saving.
@node Buffer Gap
@section The Buffer Gap
@cindex buffer gap
Emacs buffers are implemented using an invisible @dfn{gap} to make
insertion and deletion faster. Insertion works by filling in part of

View file

@ -147,6 +147,7 @@ code.
@node Using Interactive
@subsection Using @code{interactive}
@cindex arguments, interactive entry
@cindex interactive spec, using
This section describes how to write the @code{interactive} form that
makes a Lisp function an interactively-callable command, and how to
@ -747,6 +748,8 @@ part of the prompt.
@node Distinguish Interactive
@section Distinguish Interactive Calls
@cindex distinguish interactive calls
@cindex is this call interactive
Sometimes a command should display additional visual feedback (such
as an informative message in the echo area) for interactive calls
@ -835,6 +838,7 @@ Here is another example that contrasts direct and indirect calls to
@node Command Loop Info
@section Information from the Command Loop
@cindex command loop variables
The editor command loop sets several Lisp variables to keep status
records for itself and for commands that are run. With the exception of
@ -1859,6 +1863,7 @@ bind it to the @code{signal usr1} event sequence:
@node Classifying Events
@subsection Classifying Events
@cindex event type
@cindex classifying events
Every event has an @dfn{event type}, which classifies the event for
key binding purposes. For a keyboard event, the event type equals the
@ -2584,6 +2589,9 @@ then continues to wait for a valid input character, or keyboard-quit.
@node Event Mod
@subsection Modifying and Translating Input Events
@cindex modifiers of events
@cindex translating input events
@cindex event translation
Emacs modifies every event it reads according to
@code{extra-keyboard-modifiers}, then translates it through
@ -2665,6 +2673,7 @@ at the level of @code{read-key-sequence}.
@node Invoking the Input Method
@subsection Invoking the Input Method
@cindex invoking input method
The event-reading functions invoke the current input method, if any
(@pxref{Input Methods}). If the value of @code{input-method-function}

View file

@ -347,6 +347,7 @@ it does nothing. It always returns @var{function}.
@node Eval During Compile
@section Evaluation During Compilation
@cindex eval during compilation
These features permit you to write code to be evaluated during
compilation of a program.

View file

@ -44,6 +44,8 @@ structure constructs (@pxref{Macros}).
@node Sequencing
@section Sequencing
@cindex sequencing
@cindex sequential execution
Evaluating forms in the order they appear is the most common way
control passes from one form to another. In some contexts, such as in a
@ -368,11 +370,11 @@ that location.
More specifically, a Q-pattern can take the following forms:
@table @code
@item (@var{qpattern1} . @var{qpattern2})
This pattern matches any cons cell whose @code{car} matches @var{QPATTERN1} and
whose @code{cdr} matches @var{PATTERN2}.
@item [@var{qpattern1 qpattern2..qpatternm}]
This pattern matches a vector of length @code{M} whose 0..(M-1)th
elements match @var{QPATTERN1}, @var{QPATTERN2}..@var{QPATTERNm},
This pattern matches any cons cell whose @code{car} matches @var{qpattern1} and
whose @code{cdr} matches @var{pattern2}.
@item [@var{qpattern1} @var{qpattern2} @dots{} @var{qpatternm}]
This pattern matches a vector of length @var{M} whose 0..(@var{M}-1)th
elements match @var{qpattern1}, @var{qpattern2} @dots{} @var{qpatternm},
respectively.
@item @var{atom}
This pattern matches any atom @code{equal} to @var{atom}.
@ -405,6 +407,7 @@ the variable @code{x}.
@node Combining Conditions
@section Constructs for Combining Conditions
@cindex combining conditions
This section describes three constructs that are often used together
with @code{if} and @code{cond} to express complicated conditions. The
@ -962,6 +965,7 @@ concept of continuable errors.
@node Processing of Errors
@subsubsection How Emacs Processes Errors
@cindex processing of errors
When an error is signaled, @code{signal} searches for an active
@dfn{handler} for the error. A handler is a sequence of Lisp
@ -1367,6 +1371,7 @@ and their conditions.
@node Cleanups
@subsection Cleaning Up from Nonlocal Exits
@cindex nonlocal exits, cleaning up
The @code{unwind-protect} construct is essential whenever you
temporarily put a data structure in an inconsistent state; it permits

View file

@ -1227,6 +1227,8 @@ arguments, which will be used when creating the @code{radio-button} or
@node Defining New Types
@subsection Defining New Types
@cindex customization types, define new
@cindex define new customization types
In the previous sections we have described how to construct elaborate
type specifications for @code{defcustom}. In some cases you may want
@ -1296,6 +1298,7 @@ its @code{:type} argument only when needed.
@node Applying Customizations
@section Applying Customizations
@cindex applying customizations
The following functions are responsible for installing the user's
customization settings for variables and faces, respectively. When
@ -1353,6 +1356,7 @@ evaluated. @var{comment} is a string describing the customization.
@node Custom Themes
@section Custom Themes
@cindex custom themes
@dfn{Custom themes} are collections of settings that can be enabled
or disabled as a unit. @xref{Custom Themes,,, emacs, The GNU Emacs
Manual}. Each Custom theme is defined by an Emacs Lisp source file,

View file

@ -5,6 +5,7 @@
@c See the file elisp.texi for copying conditions.
@node Debugging
@chapter Debugging Lisp Programs
@cindex debugging lisp programs
There are several ways to find and investigate problems in an Emacs
Lisp program.
@ -284,6 +285,8 @@ not currently set up to break on entry.
@node Explicit Debug
@subsection Explicit Entry to the Debugger
@cindex debugger, explicit entry
@cindex force entry to debugger
You can cause the debugger to be called at a certain point in your
program by writing the expression @code{(debug)} at that point. To do
@ -456,6 +459,7 @@ Toggle the display of local variables of the current stack frame.
@node Invoking the Debugger
@subsection Invoking the Debugger
@cindex invoking lisp debugger
Here we describe in full detail the function @code{debug} that is used
to invoke the debugger.
@ -707,6 +711,7 @@ find the mismatch.)
@node Excess Open
@subsection Excess Open Parentheses
@cindex excess open parentheses
The first step is to find the defun that is unbalanced. If there is
an excess open parenthesis, the way to do this is to go to the end of
@ -741,6 +746,7 @@ anything.
@node Excess Close
@subsection Excess Close Parentheses
@cindex excess close parentheses
To deal with an excess close parenthesis, first go to the beginning
of the file, then type @kbd{C-u -1 C-M-u} to find the end of the first

View file

@ -39,6 +39,8 @@ that Emacs presents to the user.
@node Refresh Screen
@section Refreshing the Screen
@cindex refresh the screen
@cindex screen refresh
The function @code{redraw-frame} clears and redisplays the entire
contents of a given frame (@pxref{Frames}). This is useful if the
@ -534,6 +536,7 @@ are logged that share a common prefix ending in @samp{...}.
@node Echo Area Customization
@subsection Echo Area Customization
@cindex echo area customization
These variables control details of how the echo area works.
@ -661,6 +664,7 @@ specify a specific warning type.
@node Warning Variables
@subsection Warning Variables
@cindex warning variables
Programs can customize how their warnings appear by binding
the variables described in this section.
@ -738,6 +742,7 @@ all.
@node Warning Options
@subsection Warning Options
@cindex warning options
These variables are used by users to control what happens
when a Lisp program reports a warning.
@ -771,6 +776,7 @@ that warning is not logged.
@node Delayed Warnings
@subsection Delayed Warnings
@cindex delayed warnings
Sometimes, you may wish to avoid showing a warning while a command is
running, and only show it only after the end of the command. You can
@ -1094,6 +1100,8 @@ You can use a display table to substitute other text for the ellipsis
@node Temporary Displays
@section Temporary Displays
@cindex temporary display
@cindex temporary buffer display
Temporary displays are used by Lisp programs to put output into a
buffer and then present it to the user for perusal rather than for
@ -1305,6 +1313,8 @@ inside the overlay or outside, and likewise for the end of the overlay.
@node Managing Overlays
@subsection Managing Overlays
@cindex managing overlays
@cindex overlays, managing
This section describes the functions to create, delete and move
overlays, and to examine their contents. Overlay changes are not
@ -1465,6 +1475,7 @@ faster if you do @code{(overlay-recenter (point-max))} first.
@node Overlay Properties
@subsection Overlay Properties
@cindex overlay properties
Overlay properties are like text properties in that the properties that
alter how a character is displayed can come from either source. But in
@ -1717,6 +1728,8 @@ Properties}.
@node Finding Overlays
@subsection Searching for Overlays
@cindex searching for overlays
@cindex overlays, searching for
@defun overlays-at pos &optional sorted
This function returns a list of all the overlays that cover the character at
@ -1784,6 +1797,8 @@ changes.
@node Size of Displayed Text
@section Size of Displayed Text
@cindex size of text on display
@cindex character width on display
Since not all characters have the same width, these functions let you
check the width of a character. @xref{Primitive Indent}, and
@ -2274,6 +2289,7 @@ suitable for use with @code{:stipple} (see above). It returns
@node Defining Faces
@subsection Defining Faces
@cindex defining faces
@cindex face spec
The usual way to define a face is through the @code{defface} macro.
@ -2448,6 +2464,7 @@ Any other value of @var{spec-type} is reserved for internal use.
@node Attribute Functions
@subsection Face Attribute Functions
@cindex face attributes, access and modification
This section describes functions for directly accessing and
modifying the attributes of a named face.
@ -2649,6 +2666,8 @@ a non-@code{nil} @code{:inverse-video} attribute.
@node Displaying Faces
@subsection Displaying Faces
@cindex displaying faces
@cindex face merging
When Emacs displays a given piece of text, the visual appearance of
the text may be determined by faces drawn from different sources. If
@ -2704,6 +2723,7 @@ at the next level of face merging.
@node Face Remapping
@subsection Face Remapping
@cindex face remapping
The variable @code{face-remapping-alist} is used for buffer-local or
global changes in the appearance of a face. For instance, it is used
@ -2901,6 +2921,7 @@ usually assign faces to around 400 to 600 characters at each call.
@node Basic Faces
@subsection Basic Faces
@cindex basic faces
If your Emacs Lisp program needs to assign some faces to text, it is
often a good idea to use certain existing faces or inherit from them,
@ -3067,6 +3088,8 @@ nominal heights and widths would suggest.
@node Font Lookup
@subsection Looking Up Fonts
@cindex font lookup
@cindex looking up fonts
@defun x-list-fonts name &optional reference-face frame maximum width
This function returns a list of available font names that match
@ -3124,6 +3147,7 @@ encoding of the font.
@node Fontsets
@subsection Fontsets
@cindex fontset
A @dfn{fontset} is a list of fonts, each assigned to a range of
character codes. An individual font cannot display the whole range of
@ -4237,6 +4261,7 @@ display specifications and what they mean.
@node Replacing Specs
@subsection Display Specs That Replace The Text
@cindex replacing display specs
Some kinds of display specifications specify something to display
instead of the text that has the property. These are called
@ -5113,6 +5138,7 @@ Supports the @code{:index} property. @xref{Multi-Frame Images}.
@node Defining Images
@subsection Defining Images
@cindex define image
The functions @code{create-image}, @code{defimage} and
@code{find-image} provide convenient ways to create image descriptors.
@ -5240,6 +5266,7 @@ Here is an example of using @code{image-load-path-for-library}:
@node Showing Images
@subsection Showing Images
@cindex show image
You can use an image descriptor by setting up the @code{display}
property yourself, but it is easier to use the functions in this

View file

@ -81,6 +81,8 @@ computer program, however, it is good to keep the distinction in mind.
@node Visiting Functions
@subsection Functions for Visiting Files
@cindex visiting files, functions for
@cindex how to visit files
This section describes the functions normally used to visit files.
For historical reasons, these functions have names starting with
@ -948,6 +950,8 @@ Unix. These conventions are also followed by @code{file-attributes}
@node Kinds of Files
@subsection Distinguishing Kinds of Files
@cindex file classification
@cindex classification of file types
This section describes how to distinguish various kinds of files, such
as directories, symbolic links, and ordinary files.
@ -2300,6 +2304,8 @@ through the immediately preceding @samp{/}).
@node Unique File Names
@subsection Generating Unique File Names
@cindex unique file names
@cindex temporary files
Some programs need to write temporary files. Here is the usual way to
construct a name for such a file:

View file

@ -106,6 +106,7 @@ for @code{framep} above.
@node Creating Frames
@section Creating Frames
@cindex frame creation
To create a new frame, call the function @code{make-frame}.
@ -484,6 +485,7 @@ parameter values to frames that will be created henceforth.
@node Initial Parameters
@subsection Initial Frame Parameters
@cindex parameters of initial frame
You can specify the parameters for the initial startup frame by
setting @code{initial-frame-alist} in your init file (@pxref{Init
@ -623,6 +625,7 @@ named, this parameter will be @code{nil}.
@node Position Parameters
@subsubsection Position Parameters
@cindex window position on display
@cindex frame position
Position parameters' values are normally measured in pixels, but on
text terminals they count characters or lines instead.
@ -833,6 +836,8 @@ integer). @xref{Line Height}, for more information.
@node Buffer Parameters
@subsubsection Buffer Parameters
@cindex frame, which buffers to display
@cindex buffers to display on frame
These frame parameters, meaningful on all kinds of terminals, deal
with which buffers have been, or should, be displayed in the frame.
@ -1663,6 +1668,7 @@ is used whenever that frame is selected. If the frame has a minibuffer,
you can get it with @code{minibuffer-window} (@pxref{Definition of
minibuffer-window}).
@cindex frame without a minibuffer
However, you can also create a frame with no minibuffer. Such a frame
must use the minibuffer window of some other frame. When you create the
frame, you can explicitly specify the minibuffer window to use (in some
@ -2070,6 +2076,7 @@ allows to know if the pointer has been hidden.
@node Pop-Up Menus
@section Pop-Up Menus
@cindex menus, popup
A Lisp program can pop up a menu so that the user can choose an
alternative with the mouse. On a text terminal, if the mouse is not
@ -2334,6 +2341,7 @@ clipboard as empty.
@node Drag and Drop
@section Drag and Drop
@cindex drag and drop
@vindex x-dnd-test-function
@vindex x-dnd-known-types

View file

@ -1214,7 +1214,8 @@ ways to do it. The added function is also called a piece of @emph{advice}.
@end menu
@node Core Advising Primitives
@subsection Primitives to manipulate advice
@subsection Primitives to manipulate advices
@cindex advice, add and remove
@defmac add-function where place function &optional props
This macro is the handy way to add the advice @var{function} to the function
@ -1316,6 +1317,7 @@ the current prefix argument.
@node Advising Named Functions
@subsection Advising Named Functions
@cindex advising named functions
A common use of advice is for named functions and macros.
You could just use @code{add-function} as in:
@ -1508,6 +1510,7 @@ More specifically, the composition of the two functions behaves like:
@node Porting old advice
@subsection Adapting code using the old defadvice
@cindex old advices, porting
A lot of code uses the old @code{defadvice} mechanism, which is largely made
obsolete by the new @code{advice-add}, whose implementation and semantics is

View file

@ -188,6 +188,8 @@ Such objects may be added to the hash table after it is created.
@node Hash Access
@section Hash Table Access
@cindex accessing hash tables
@cindex hash table access
This section describes the functions for accessing and storing
associations in a hash table. In general, any Lisp object can be used

View file

@ -90,6 +90,7 @@ hyperlinks in the @file{*Help*} buffer.)
@node Accessing Documentation
@section Access to Documentation Strings
@cindex accessing documentation strings
@defun documentation-property symbol property &optional verbatim
This function returns the documentation string recorded in
@ -507,6 +508,7 @@ non-@code{nil}, the return value is always a vector.
@node Help Functions
@section Help Functions
@cindex help functions
Emacs provides a variety of built-in help functions, all accessible to
the user as subcommands of the prefix @kbd{C-h}. For more information

View file

@ -782,6 +782,7 @@ Lookup}.
@node Controlling Active Maps
@section Controlling the Active Keymaps
@cindex active keymap, controlling
@defvar global-map
This variable contains the default global keymap that maps Emacs
@ -1806,6 +1807,8 @@ local map.
@node Scanning Keymaps
@section Scanning Keymaps
@cindex scanning keymaps
@cindex keymaps, scanning
This section describes functions used to scan all the current keymaps
for the sake of printing help information.
@ -2775,6 +2778,7 @@ function keys.
@node Modifying Menus
@subsection Modifying Menus
@cindex menu modification
When you insert a new item in an existing menu, you probably want to
put it in a particular place among the menu's existing items. If you

View file

@ -84,6 +84,8 @@ structure made out of cons cells as a @dfn{list structure}.
@node List-related Predicates
@section Predicates on Lists
@cindex predicates for lists
@cindex list predicates
The following predicates test whether a Lisp object is an atom,
whether it is a cons cell or is a list, or whether it is the
@ -662,6 +664,8 @@ Some examples:
@node List Variables
@section Modifying List Variables
@cindex modify a list
@cindex list modification
These functions, and one macro, provide convenient ways
to modify a list which is stored in a variable.
@ -818,6 +822,8 @@ new @sc{car} or @sc{cdr}.
@node Setcar
@subsection Altering List Elements with @code{setcar}
@cindex replace list element
@cindex list, replace element
Changing the @sc{car} of a cons cell is done with @code{setcar}. When
used on a list, @code{setcar} replaces one element of a list with a
@ -923,6 +929,7 @@ x2: |
@node Setcdr
@subsection Altering the CDR of a List
@cindex replace part of list
The lowest-level primitive for modifying a @sc{cdr} is @code{setcdr}:
@ -1759,6 +1766,8 @@ and later discarded; this is not possible with a property list.
@node Plist Access
@subsection Property Lists Outside Symbols
@cindex plist access
@cindex accessing plist properties
The following functions can be used to manipulate property lists.
They all compare property names using @code{eq}.

View file

@ -419,6 +419,8 @@ the shadowed files as a string.
@node Loading Non-ASCII
@section Loading Non-@acronym{ASCII} Characters
@cindex loading, and non-ASCII characters
@cindex non-ASCII characters in loaded files
When Emacs Lisp programs contain string constants with non-@acronym{ASCII}
characters, these can be represented within Emacs either as unibyte
@ -907,6 +909,8 @@ with a call to @code{provide}. The order of the elements in the
@node Where Defined
@section Which File Defined a Certain Symbol
@cindex symbol, where defined
@cindex where was a symbol defined
@defun symbol-file symbol &optional type
This function returns the name of the file that defined @var{symbol}.

View file

@ -194,6 +194,8 @@ During Compile}).
@node Defining Macros
@section Defining Macros
@cindex defining macros
@cindex macro, how to define
A Lisp macro object is a list whose @sc{car} is @code{macro}, and
whose @sc{cdr} is a function. Expansion of the macro works
@ -253,6 +255,7 @@ Form}.
@node Problems with Macros
@section Common Problems Using Macros
@cindex macro caveats
Macro expansion can have counterintuitive consequences. This
section describes some important consequences that can lead to

View file

@ -118,6 +118,8 @@ m1
@node Predicates on Markers
@section Predicates on Markers
@cindex predicates for markers
@cindex markers, predicates for
You can test an object to see whether it is a marker, or whether it is
either an integer or a marker. The latter test is useful in connection
@ -141,6 +143,8 @@ integer or floating point) or a marker, @code{nil} otherwise.
@node Creating Markers
@section Functions that Create Markers
@cindex creating markers
@cindex marker creation
When you create a new marker, you can make it point nowhere, or point
to the present position of point, or to the beginning or end of the
@ -269,6 +273,7 @@ if they both point nowhere.
@node Information from Markers
@section Information from Markers
@cindex marker information
This section describes the functions for accessing the components of a
marker object.
@ -342,6 +347,8 @@ specify the insertion type, create them with insertion type
@node Moving Markers
@section Moving Marker Positions
@cindex moving markers
@cindex marker, how to move position
This section describes how to change the position of an existing
marker. When you do this, be sure you know whether the marker is used

View file

@ -107,6 +107,7 @@ are available in batch mode.
@node Text from Minibuffer
@section Reading Text Strings with the Minibuffer
@cindex minibuffer input, reading text strings
The most basic primitive for minibuffer input is
@code{read-from-minibuffer}, which can be used to read either a string
@ -390,6 +391,7 @@ following bindings, in addition to those of @code{minibuffer-local-map}:
@node Object from Minibuffer
@section Reading Lisp Objects with the Minibuffer
@cindex minibuffer input, reading lisp objects
This section describes functions for reading Lisp objects with the
minibuffer.
@ -2044,6 +2046,7 @@ Do you really want to remove everything? (yes or no)
@node Multiple Queries
@section Asking Multiple Y-or-N Questions
@cindex multiple yes-or-no questions
When you have a series of similar questions to ask, such as ``Do you
want to save this buffer'' for each buffer in turn, you should use
@ -2218,8 +2221,8 @@ contents of the minibuffer before the point.
@section Minibuffer Windows
@cindex minibuffer windows
These functions access and select minibuffer windows
and test whether they are active.
These functions access and select minibuffer windows, test whether they
are active and control how they get resized.
@defun active-minibuffer-window
This function returns the currently active minibuffer window, or
@ -2260,8 +2263,33 @@ This function returns non-@code{nil} if @var{window} is the currently
active minibuffer window.
@end defun
The following two options control whether minibuffer windows are resized
automatically and how large they can get in the process.
@defopt resize-mini-windows
This option specifies whether minibuffer windows are resized
automatically. The default value is @code{grow-only}, which means that
a minibuffer window by default expands automatically to accommodate the
text it displays and shrinks back to one line as soon as the minibuffer
gets empty. If the value is @code{t}, Emacs will always try to fit the
height of a minibuffer window to the text it displays (with a minimum of
one line). If the value is @code{nil}, a minibuffer window never
changes size automatically. In that case the window resizing commands
(@pxref{Resizing Windows}) can be used to adjust its height.
@end defopt
@defopt max-mini-window-height
This option provides a maximum height for resizing minibuffer windows
automatically. A floating-point number specifies a fraction of the
frame's height; an integer specifies the maximum number of lines. The
default value is 0.25.
@end defopt
@node Minibuffer Contents
@section Minibuffer Contents
@cindex access minibuffer contents
@cindex minibuffer contents, accessing
These functions access the minibuffer prompt and contents.

View file

@ -1490,7 +1490,7 @@ A positive prefix argument enables the mode, any other prefix argument
disables it. From Lisp, an argument of @code{toggle} toggles the mode,
whereas an omitted or @code{nil} argument enables the mode.
This makes it easy to enable the minor mode in a major mode hook, for example.
If @var{doc} is nil, the macro supplies a default documentation string
If @var{doc} is @code{nil}, the macro supplies a default documentation string
explaining the above.
By default, it also defines a variable named @var{mode}, which is set to
@ -3659,7 +3659,7 @@ For example:
Notice how those lexers return the empty string when in front of
parentheses. This is because SMIE automatically takes care of the
parentheses defined in the syntax table. More specifically if the lexer
returns nil or an empty string, SMIE tries to handle the corresponding
returns @code{nil} or an empty string, SMIE tries to handle the corresponding
text as a sexp according to syntax tables.
@node SMIE Tricks

View file

@ -783,6 +783,8 @@ of them is @code{nil}, it defaults to the first or last codepoint of
@node Scanning Charsets
@section Scanning for Character Sets
@cindex scanning for character sets
@cindex character set, searching
Sometimes it is useful to find out which character set a particular
character belongs to. One use for this is in determining which coding
@ -1620,6 +1622,9 @@ contents (as it usually does), it should examine the contents of
@node Specifying Coding Systems
@subsection Specifying a Coding System for One Operation
@cindex specify coding system
@cindex force coding system for operation
@cindex coding system for operation
You can specify the coding system for a specific operation by binding
the variables @code{coding-system-for-read} and/or

View file

@ -1208,6 +1208,7 @@ return value is @code{nil}.
@node Time of Day
@section Time of Day
@cindex time of day
This section explains how to determine the current time and time
zone.
@ -1320,6 +1321,7 @@ time zone.
@node Time Conversion
@section Time Conversion
@cindex calendrical information
@cindex time conversion
These functions convert time values (@pxref{Time of Day}) into
calendrical information and vice versa.
@ -1415,6 +1417,9 @@ on others, years as early as 1901 do work.
@node Time Parsing
@section Parsing and Formatting Times
@cindex time parsing
@cindex time formatting
@cindex formatting time values
These functions convert time values to text in a string, and vice versa.
Time values are lists of two to four integers (@pxref{Time of Day}).
@ -1643,6 +1648,9 @@ interactively, it prints the duration in the echo area.
@node Time Calculations
@section Time Calculations
@cindex time calculations
@cindex comparing time values
@cindex calendrical computations
These functions perform calendrical computations using time values
(@pxref{Time of Day}).
@ -1823,6 +1831,7 @@ cause anything special to happen.
@node Idle Timers
@section Idle Timers
@cindex idle timers
Here is how to set up a timer that runs when Emacs is idle for a
certain length of time. Aside from how to set them up, idle timers
@ -2529,7 +2538,7 @@ The server's version number.
The specification version the server is compliant with.
@end table
If @var{SPEC_VERSION} is @code{nil}, the server supports a
If @var{spec_version} is @code{nil}, the server supports a
specification prior to @samp{"1.0"}.
@end defun

View file

@ -465,6 +465,7 @@ beginning or end of a line.
@node Screen Lines
@subsection Motion by Screen Lines
@cindex screen lines, moving by
The line functions in the previous section count text lines, delimited
only by newline characters. By contrast, these functions count screen
@ -654,9 +655,9 @@ quotes are ignored.)
@deffn Command up-list &optional arg escape-strings no-syntax-crossing
This function moves forward out of @var{arg} (default 1) levels of
parentheses. A negative argument means move backward but still to a
less deep spot. If @var{escape-strings} is non-nil (as it is
less deep spot. If @var{escape-strings} is non-@code{nil} (as it is
interactively), move out of enclosing strings as well. If
@var{no-syntax-crossing} is non-nil (as it is interactively), prefer
@var{no-syntax-crossing} is non-@code{nil} (as it is interactively), prefer
to break out of any enclosing string instead of moving to the start of
a list broken across multiple strings. On error, location of point is
unspecified.

View file

@ -63,6 +63,8 @@ Processes}.
@node Subprocess Creation
@section Functions that Create Subprocesses
@cindex create subprocess
@cindex process creation
There are three primitives that create a new subprocess in which to run
a program. One of them, @code{start-process}, creates an asynchronous
@ -734,6 +736,7 @@ happen sooner or later).
@node Process Information
@section Process Information
@cindex process information
Several functions return information about processes.

View file

@ -257,6 +257,8 @@ it easier to verify even very complex regexps.
@node Syntax of Regexps
@subsection Syntax of Regular Expressions
@cindex regexp syntax
@cindex syntax of regular expressions
Regular expressions have a syntax in which a few characters are
special constructs and the rest are @dfn{ordinary}. An ordinary
@ -294,6 +296,7 @@ need to use one of the special regular expression constructs.
@node Regexp Special
@subsubsection Special Characters in Regular Expressions
@cindex regexp, special characters in
Here is a list of the characters that are special in a regular
expression.
@ -894,6 +897,7 @@ beyond the minimum needed to end a sentence.
These functions operate on regular expressions.
@cindex quote special characters in regexp
@defun regexp-quote string
This function returns a regular expression whose only exact match is
@var{string}. Using this regular expression in @code{looking-at} will
@ -924,6 +928,7 @@ whitespace:
@end example
@end defun
@cindex optimize regexp
@defun regexp-opt strings &optional paren
This function returns an efficient regular expression that will match
any of the strings in the list @var{strings}. This is useful when you

View file

@ -217,14 +217,14 @@ y @result{} [foo (69 2)]
@end example
@end defun
@defun reverse seq
@defun reverse sequence
@cindex string reverse
@cindex list reverse
@cindex vector reverse
@cindex sequence reverse
This function creates a new sequence whose elements are the elements
of @var{seq}, but in reverse order. The original argument @var{seq}
is @emph{not} altered. Note that char-table cannot be reversed.
of @var{sequence}, but in reverse order. The original argument @var{sequence}
is @emph{not} altered. Note that char-tables cannot be reversed.
@example
@group
@ -260,12 +260,12 @@ x
@end example
@end defun
@defun nreverse seq
@defun nreverse sequence
@cindex reversing a string
@cindex reversing a list
@cindex reversing a vector
This function reverses the order of the elements of @var{seq}.
Unlike @code{reverse} the original @var{seq} may be modified.
This function reverses the order of the elements of @var{sequence}.
Unlike @code{reverse} the original @var{sequence} may be modified.
For example:
@ -421,22 +421,20 @@ useful example of @code{sort}.
@cindex sequence functions in seq
@cindex seq library
The @file{seq} library provides the following additional sequence
The @file{seq.el} library provides the following additional sequence
manipulation macros and functions, prefixed with @code{seq-}. To use
them, you need to load the @file{seq} library first.
them, you must first load the @file{seq} library.
All functions defined in the @code{seq} library are free of
side-effects, meaning that sequence(s) passed as argument(s) to
functions defined in @code{seq} are not modified.
All functions defined in this library are free of side-effects;
i.e., they do not modify any sequence (list, vector, or string) that
you pass as an argument. Unless otherwise stated, the result is a
sequence of the same type as the input. For those functions that take
a predicate, this should be a function of one argument.
@defun seq-drop seq n
This function returns a sequence of all but the first @var{n}
elements of the sequence @var{seq}.
@var{seq} may be a list, vector or string and @var{n} must be an
integer. The result is the same type of sequence as @var{seq}.
If @var{n} is a negative integer or zero, @var{seq} is returned.
@defun seq-drop sequence n
This function returns all but the first @var{n} (an integer)
elements of @var{sequence}. If @var{n} is negative or zero,
the result is @var{sequence}.
@example
@group
@ -450,14 +448,10 @@ If @var{n} is a negative integer or zero, @var{seq} is returned.
@end example
@end defun
@defun seq-take seq n
This function returns a sequence of the first @var{n} elements of
@var{seq}.
@var{seq} may be a list, vector or string and @var{n} must be an
integer. The result is the same type of sequence as @var{seq}.
If @var{n} is a negative integer or zero, an empty sequence is returned.
@defun seq-take sequence n
This function returns the first @var{n} (an integer) elements of
@var{sequence}. If @var{n} is negative or zero, the result
is @code{nil}.
@example
@group
@ -471,17 +465,9 @@ If @var{n} is a negative integer or zero, an empty sequence is returned.
@end example
@end defun
@defun seq-take-while pred seq
This function returns a sub-sequence of the successive elements of
@var{seq} for which calling @code{pred} with that element returns
non-nil.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string. The result is the same type of sequence as
@var{seq}.
If evaluating @var{pred} with the first element of @var{seq} as argument
returns @code{nil}, an empty sequence is returned.
@defun seq-take-while predicate sequence
This function returns the members of @var{sequence} in order,
stopping before the first one for which @var{predicate} returns @code{nil}.
@example
@group
@ -495,17 +481,9 @@ returns @code{nil}, an empty sequence is returned.
@end example
@end defun
@defun seq-drop-while pred seq
This function returns a sub-sequence of @var{seq} from the first
element for which calling @var{pred} with that element returns
@code{nil}.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string. The result is the same type of sequence as
@var{seq}.
If evaluating @var{pred} with every element of @var{seq} returns
@code{nil}, @var{seq} is returned.
@defun seq-drop-while predicate sequence
This function returns the members of @var{sequence} in order,
starting from the first one for which @var{predicate} returns @code{nil}.
@example
@group
@ -519,13 +497,10 @@ If evaluating @var{pred} with every element of @var{seq} returns
@end example
@end defun
@defun seq-filter pred seq
@defun seq-filter predicate sequence
@cindex filtering sequences
This function returns a list of all the elements in @var{seq} for
which calling @var{pred} with that element returns non-nil.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string.
This function returns a list of all the elements in @var{sequence}
for which @var{predicate} returns non-@code{nil}.
@example
@group
@ -539,13 +514,10 @@ list, vector or string.
@end example
@end defun
@defun seq-remove pred seq
@defun seq-remove predicate sequence
@cindex removing from sequences
This function returns a list of all the elements in @var{seq} for
which calling @var{pred} with that element returns @code{nil}.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string.
This function returns a list of all the elements in @var{sequence}
for which @var{predicate} returns @code{nil}.
@example
@group
@ -559,18 +531,15 @@ list, vector or string.
@end example
@end defun
@defun seq-reduce function seq initial-value
@defun seq-reduce function sequence initial-value
@cindex reducing sequences
This function returns the result of calling @var{function} with
@var{initial-value} and the first element of @var{seq}, then calling
@var{function} with that result and the second element of @var{seq},
then with that result and the third element of @var{seq}, etc.
@var{function} must be a two-arguments function and @var{seq} may be a
list, vector or string.
If @var{seq} is empty, @var{initial-value} is returned and
@var{function} is not called.
@var{initial-value} and the first element of @var{sequence}, then calling
@var{function} with that result and the second element of @var{sequence},
then with that result and the third element of @var{sequence}, etc.
@var{function} should be a function of two arguments. If
@var{sequence} is empty, this returns @var{initial-value} without
calling @var{function}.
@example
@group
@ -588,14 +557,9 @@ If @var{seq} is empty, @var{initial-value} is returned and
@end example
@end defun
@defun seq-some-p pred seq
This function returns any element in @var{seq} for which calling
@var{pred} with that element returns non-nil. If successively calling
@var{pred} with each element of @var{seq} always returns @code{nil},
@code{nil} is returned.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string.
@defun seq-some-p predicate sequence
This function returns the first member of sequence for which @var{predicate}
returns non-@code{nil}.
@example
@group
@ -609,12 +573,9 @@ list, vector or string.
@end example
@end defun
@defun seq-every-p pred seq
This function returns non-nil if successively calling @var{pred} with
each element of @var{seq} always returns non-nil, @code{nil} otherwise.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string.
@defun seq-every-p predicate sequence
This function returns non-@code{nil} if applying @var{predicate}
to every element of @var{sequence} returns non-@code{nil}.
@example
@group
@ -628,11 +589,8 @@ list, vector or string.
@end example
@end defun
@defun seq-empty-p seq
This function returns non-nil if the sequence @var{seq} is empty,
@code{nil} otherwise.
@var{seq} may be a list, vector or string.
@defun seq-empty-p sequence
This function returns non-@code{nil} if @var{sequence} is empty.
@example
@group
@ -646,12 +604,9 @@ list, vector or string.
@end example
@end defun
@defun seq-count pred seq
This function returns the number of elements in @var{seq} for which
calling @var{pred} with that element returns non-nil.
@var{pred} must be a one-argument function and @var{seq} may be a
list, vector or string.
@defun seq-count predicate sequence
This function returns the number of elements in @var{sequence} for which
@var{predicate} returns non-@code{nil}.
@example
(seq-count (lambda (elt) (> elt 0)) [-1 2 0 3 -2])
@ -659,27 +614,17 @@ list, vector or string.
@end example
@end defun
@defun seq-sort pred seq
This function returns a sorted sequence of the elements of
@var{seq}, comparing its elements with @var{pred}. Called with two
elements of @var{seq}, @var{pred} should return non-nil if the first
element should sort before the second.
@var{pred} must be a two-arguments function, @var{seq} may be a list,
vector or string.
The result is a sequence of the same type as SEQ.
@cindex sorting sequences
@defun seq-sort function sequence
This function returns a copy of @var{sequence} that is sorted
according to @var{function}, a function of two arguments that returns
non-@code{nil} if the first argument should sort before the second.
@end defun
@defun seq-contains-p seq elt testfn
This function returns the first element in @var{seq} that equals to
@var{elt}.
Equality is defined by @var{testfn} if non-nil or by @code{equal} if
@code{nil}.
@var{seq} may be a list, vector or string.
@defun seq-contains-p sequence elt &optional function
This function returns the first element in @var{sequence} that is equal to
@var{elt}. If the optional argument @var{function} is non-@code{nil},
it is a function of two arguments to use instead of the default @code{equal}.
@example
@group
@ -694,13 +639,10 @@ Equality is defined by @var{testfn} if non-nil or by @code{equal} if
@end defun
@defun seq-uniq seq testfn
This function returns a list of the elements of @var{seq} with
duplicates removed. @var{testfn} is used to compare elements, or
@code{equal} if @var{testfn} is @code{nil}.
@var{testfn} must be a two-argument function or @code{nil} and
@var{seq} may be a list, vector or string.
@defun seq-uniq sequence &optional function
This function returns a list of the elements of @var{sequence} with
duplicates removed. If the optional argument @var{function} is non-@code{nil},
it is a function of two arguments to use instead of the default @code{equal}.
@example
@group
@ -714,14 +656,11 @@ duplicates removed. @var{testfn} is used to compare elements, or
@end example
@end defun
@defun seq-subseq seq start &optional end
This function returns a sub-sequence of @var{seq} from @var{start}
to @var{end}. If @var{end} is omitted, it default to the length of
@var{seq}. If @var{start} or @var{end} is negative, it counts from
the end of @var{seq}.
@var{seq} may be a list, vector or string.
The result is the same type of sequence as @var{seq}.
@defun seq-subseq sequence start &optional end
This function returns a subset of @var{sequence} from @var{start}
to @var{end}, both integers (@var{end} defaults to the last element).
If @var{start} or @var{end} is negative, it counts from the end of
@var{sequence}.
@example
@group
@ -739,11 +678,10 @@ The result is the same type of sequence as @var{seq}.
@end example
@end defun
@defun seq-concatenate type &rest seqs
This function returns a sequence made of the concatenation of
@var{seqs}. The result is a sequence of type @var{type}. @var{type}
may be one of the following symbols: @code{vector}, @code{list} or
@code{string}.
@defun seq-concatenate type &rest sequences
This function returns a sequence of type @var{type} made of the
concatenation of @var{sequences}. @var{type} may be: @code{vector},
@code{list} or @code{string}.
@example
@group
@ -757,26 +695,11 @@ may be one of the following symbols: @code{vector}, @code{list} or
@end example
@end defun
@defmac seq-doseq (var seq [result]) body@dots{}
@defmac seq-doseq (var sequence [result]) body@dots{}
@cindex sequence iteration
This macro is like @code{dolist}, except that @var{seq} can be a list,
This macro is like @code{dolist}, except that @var{sequence} can be a list,
vector or string (@pxref{Iteration} for more information about the
@code{dolist} macro).
@var{seq-doseq} is primarily useful for side-effects.
@example
(seq-doseq (elt [1 2 3])
(print (* 2 elt)))
@print{}
@print{} 2
@print{}
@print{} 4
@print{}
@print{} 6
@result{} nil
@end example
@code{dolist} macro). This is primarily useful for side-effects.
@end defmac
@node Arrays

View file

@ -618,7 +618,7 @@ spacing between calls.
@defun terpri &optional stream ensure
@cindex newline in print
This function outputs a newline to @var{stream}. The name stands for
``terminate print''. If @var{ensure} is non-nil no newline is printed
``terminate print''. If @var{ensure} is non-@code{nil} no newline is printed
if @var{stream} is already at the beginning of a line. Note in this
case @var{stream} can not be a function and an error is signalled if
it is. This function returns @code{t} if a newline is printed.

View file

@ -92,6 +92,8 @@ representations and to encode and decode character codes.
@node Predicates for Strings
@section Predicates for Strings
@cindex predicates for strings
@cindex string predicates
For more information about general sequence and array predicates,
see @ref{Sequences Arrays Vectors}, and @ref{Arrays}.
@ -113,6 +115,8 @@ character (i.e., an integer), @code{nil} otherwise.
@node Creating Strings
@section Creating Strings
@cindex creating strings
@cindex string creation
The following functions create strings, either from scratch, or by
putting strings together, or by taking them apart.
@ -367,6 +371,8 @@ usual value is @w{@code{"[ \f\t\n\r\v]+"}}.
@node Modifying Strings
@section Modifying Strings
@cindex modifying strings
@cindex string modification
The most basic way to alter the contents of an existing string is with
@code{aset} (@pxref{Array Functions}). @code{(aset @var{string}
@ -400,6 +406,7 @@ zeros. It may also change @var{string}'s length.
@node Text Comparison
@section Comparison of Characters and Strings
@cindex string equality
@cindex text comparison
@defun char-equal character1 character2
This function returns @code{t} if the arguments represent the same
@ -483,17 +490,17 @@ dependent; a @var{locale} "en_US.UTF-8" is applicable on POSIX
systems, while it would be, e.g., "enu_USA.1252" on MS-Windows
systems.
If @var{IGNORE-CASE} is non-nil, characters are converted to lower-case
If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case
before comparing them.
To emulate Unicode-compliant collation on MS-Windows systems,
bind @code{w32-collate-ignore-punctuation} to a non-nil value, since
bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since
the codeset part of the locale cannot be "UTF-8" on MS-Windows.
If your system does not support a locale environment, this function
behaves like @code{string-equal}.
Do NOT use this function to compare file names for equality, only
Do @emph{not} use this function to compare file names for equality, only
for sorting them.
@end defun
@ -602,11 +609,11 @@ behave like @code{string-lessp}:
@end group
@end example
If @var{IGNORE-CASE} is non-nil, characters are converted to lower-case
If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case
before comparing them.
To emulate Unicode-compliant collation on MS-Windows systems,
bind @code{w32-collate-ignore-punctuation} to a non-nil value, since
bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since
the codeset part of the locale cannot be "UTF-8" on MS-Windows.
If your system does not support a locale environment, this function

View file

@ -592,6 +592,8 @@ in turn, repeatedly, until they all return @code{nil}.
@node Motion and Syntax
@section Motion and Syntax
@cindex moving across syntax classes
@cindex skipping characters of certain syntax
This section describes functions for moving across characters that
have certain syntax classes.
@ -631,6 +633,8 @@ expression prefix syntax class, and characters with the @samp{p} flag.
@node Parsing Expressions
@section Parsing Expressions
@cindex parsing expressions
@cindex scanning expressions
This section describes functions for parsing and scanning balanced
expressions. We will refer to such expressions as @dfn{sexps},
@ -673,6 +677,7 @@ result, Emacs treats them as four consecutive empty string constants.
@node Motion via Parsing
@subsection Motion Commands Based on Parsing
@cindex motion based on parsing
This section describes simple point-motion functions that operate
based on parsing expressions.
@ -738,6 +743,7 @@ cannot exceed that many.
@node Position Parse
@subsection Finding the Parse State for a Position
@cindex parse state for a position
For syntactic analysis, such as in indentation, often the useful
thing is to compute the syntactic state corresponding to a given buffer
@ -919,6 +925,7 @@ nicely.
@node Control Parsing
@subsection Parameters to Control Parsing
@cindex parsing, control parameters
@defvar multibyte-syntax-as-symbol
If this variable is non-@code{nil}, @code{scan-sexps} treats all

View file

@ -162,6 +162,7 @@ the end of a line.
@node Buffer Contents
@section Examining Buffer Contents
@cindex buffer portion as string
This section describes functions that allow a Lisp program to
convert any portion of the text in the buffer into a string.
@ -2679,6 +2680,8 @@ along with the characters; this includes such diverse functions as
@node Examining Properties
@subsection Examining Text Properties
@cindex examining text properties
@cindex text properties, examining
The simplest way to examine text properties is to ask for the value of
a particular property of a particular character. For that, use
@ -2770,6 +2773,8 @@ used instead. Here is an example:
@node Changing Properties
@subsection Changing Text Properties
@cindex changing text properties
@cindex text properties, changing
The primitives for changing properties apply to a specified range of
text in a buffer or string. The function @code{set-text-properties}
@ -2933,6 +2938,8 @@ buffer but does not copy its properties.
@node Property Search
@subsection Text Property Search Functions
@cindex searching text properties
@cindex text properties, searching
In typical use of text properties, most of the time several or many
consecutive characters have the same value for a property. Rather than
@ -3991,6 +3998,8 @@ coalesced whenever possible. @xref{Property Search}.
@node Substitution
@section Substituting for a Character Code
@cindex replace characters in region
@cindex substitute characters
The following functions replace characters within a specified region
based on their character codes.
@ -4467,7 +4476,7 @@ Append @var{child} as the last child of @var{node}.
@item dom-add-child-before @var{node} @var{child} @var{before}
Add @var{child} to @var{node}'s child list before the @var{before}
node. If @var{before} is nil, make @var{child} the first child.
node. If @var{before} is @code{nil}, make @var{child} the first child.
@item dom-set-attributes @var{node} @var{attributes}
Replace all the attributes of the node with a new key/value list.

View file

@ -1951,6 +1951,7 @@ foo
@node Variables with Restricted Values
@section Variables with Restricted Values
@cindex lisp variables defined in C, restrictions
Ordinary Lisp variables can be assigned any value that is a valid
Lisp object. However, certain Lisp variables are not defined in Lisp,
@ -1987,6 +1988,8 @@ Attempting to assign them any other value will result in an error:
@node Generalized Variables
@section Generalized Variables
@cindex generalized variable
@cindex place form
A @dfn{generalized variable} or @dfn{place form} is one of the many places
in Lisp memory where values can be stored. The simplest place form is
a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of lists, elements

View file

@ -907,6 +907,98 @@ window.
@end deffn
@node Preserving Window Sizes
@section Preserving Window Sizes
@cindex preserving window sizes
A window can get resized explicitly by using one of the functions from
the preceding section or implicitly, for example, when resizing an
adjacent window, when splitting or deleting a window (@pxref{Splitting
Windows}, @pxref{Deleting Windows}) or when resizing the window's frame
(@pxref{Size and Position}).
It is possible to avoid implicit resizing of a specific window when
there are one or more other resizable windows on the same frame. For
this purpose, Emacs must be advised to @dfn{preserve} the size of that
window. There are two basic ways to do that.
@defvar window-size-fixed
If this buffer-local variable is non-@code{nil}, the size of any window
displaying the buffer cannot normally be changed. Deleting a window or
changing the frame's size may still change the window's size, if there
is no choice.
If the value is @code{height}, then only the window's height is fixed;
if the value is @code{width}, then only the window's width is fixed.
Any other non-@code{nil} value fixes both the width and the height.
If this variable is @code{nil}, this does not necessarily mean that any
window showing the buffer can be resized in the desired direction. To
determine that, use the function @code{window-resizable}.
@xref{Resizing Windows}.
@end defvar
Often @code{window-size-fixed} is overly aggressive because it inhibits
any attempt to explicitly resize or split an affected window as well.
This may even happen after the window has been resized implicitly, for
example, when deleting an adjacent window or resizing the window's
frame. The following function tries hard to never disallow resizing
such a window explicitly:
@defun window-preserve-size &optional window horizontal preserve
This function (un-)marks the height of window @var{window} as preserved
for future resize operations. @var{window} must be a live window and
defaults to the selected one. If the optional argument @var{horizontal}
is non-@code{nil}, it (un-)marks the width of @var{window} as preserved.
If the optional argument @var{preserve} is @code{t}, this means to
preserve the current height/width of @var{window}'s body. The
height/width of @var{window} will change only if Emacs has no better
choice. Resizing a window whose height/width is preserved by this
function never throws an error.
If @var{preserve} is @code{nil}, this means to stop preserving the
height/width of @var{window}, lifting any respective restraint induced
by a previous call of this function for @var{window}. Calling
@code{enlarge-window}, @code{shrink-window} or
@code{fit-window-to-buffer} with @var{window} as argument may also
remove the respective restraint.
@end defun
@code{window-preserve-size} is currently invoked by the following
functions:
@table @code
@item fit-window-to-buffer
If the optional argument @var{preserve-size} of that function
(@pxref{Resizing Windows}) is non-@code{nil}, the size established by
that function is preserved.
@item display-buffer
If the @var{alist} argument of that function (@pxref{Choosing Window})
contains a @code{preserve-size} entry, the size of the window produced
by that function is preserved.
@end table
@code{window-preserve-size} installs a window parameter (@pxref{Window
Parameters}) called @code{preserved-size} which is consulted by the
window resizing functions. This parameter will not prevent resizing the
window when the window shows another buffer than the one when
@code{window-preserve-size} was invoked or if its size has changed since
then.
The following function can be used to check whether the height of a
particular window is preserved:
@defun window-preserved-size &optional window horizontal
This function returns the preserved height of window @var{window} in
pixels. @var{window} must be a live window and defaults to the selected
one. If the optional argument @var{horizontal} is non-@code{nil}, it
returns the preserved width of @var{window}. It returns @code{nil} if
the size of @var{window} is not preserved.
@end defun
@node Splitting Windows
@section Splitting Windows
@cindex splitting windows
@ -1068,98 +1160,6 @@ function.
@end defopt
@node Preserving Window Sizes
@section Preserving Window Sizes
@cindex preserving window sizes
A window can get resized explicitly by using one of the functions from
the preceding section or implicitly, for example, when resizing an
adjacent window, when splitting or deleting a window (@pxref{Splitting
Windows}, @pxref{Deleting Windows}) or when resizing the window's frame
(@pxref{Size and Position}).
It is possible to avoid implicit resizing of a specific window when
there are one or more other resizable windows on the same frame. For
this purpose, Emacs must be advised to @dfn{preserve} the size of that
window. There are two basic ways to do that.
@defvar window-size-fixed
If this buffer-local variable is non-@code{nil}, the size of any window
displaying the buffer cannot normally be changed. Deleting a window or
changing the frame's size may still change the window's size, if there
is no choice.
If the value is @code{height}, then only the window's height is fixed;
if the value is @code{width}, then only the window's width is fixed.
Any other non-@code{nil} value fixes both the width and the height.
If this variable is @code{nil}, this does not necessarily mean that any
window showing the buffer can be resized in the desired direction. To
determine that, use the function @code{window-resizable}.
@xref{Resizing Windows}.
@end defvar
Often @code{window-size-fixed} is overly aggressive because it inhibits
any attempt to explicitly resize or split an affected window as well.
This may even happen after the window has been resized implicitly, for
example, when deleting an adjacent window or resizing the window's
frame. The following function tries hard to never disallow resizing
such a window explicitly:
@defun window-preserve-size &optional window horizontal preserve
This function (un-)marks the height of window @var{window} as preserved
for future resize operations. @var{window} must be a live window and
defaults to the selected one. If the optional argument @var{horizontal}
is non-@code{nil}, it (un-)marks the width of @var{window} as preserved.
If the optional argument @var{preserve} is @code{t}, this means to
preserve the current height/width of @var{window}'s body. The
height/width of @var{window} will change only if Emacs has no better
choice. Resizing a window whose height/width is preserved by this
function never throws an error.
If @var{preserve} is @code{nil}, this means to stop preserving the
height/width of @var{window}, lifting any respective restraint induced
by a previous call of this function for @var{window}. Calling
@code{enlarge-window}, @code{shrink-window} or
@code{fit-window-to-buffer} with @var{window} as argument may also
remove the respective restraint.
@end defun
@code{window-preserve-size} is currently invoked by the following
functions:
@table @code
@item fit-window-to-buffer
If the optional argument @var{preserve-size} of that function
(@pxref{Resizing Windows}) is non-@code{nil}, the size established by
that function is preserved.
@item display-buffer
If the @var{alist} argument of that function (@pxref{Choosing Window})
contains a @code{preserve-size} entry, the size of the window produced
by that function is preserved.
@end table
@code{window-preserve-size} installs a window parameter (@pxref{Window
Parameters}) called @code{preserved-size} which is consulted by the
window resizing functions. This parameter will not prevent resizing the
window when the window shows another buffer than the one when
@code{window-preserve-size} was invoked or if its size has changed since
then.
The following function can be used to check whether the height of a
particular window is preserved:
@defun window-preserved-size &optional window horizontal
This function returns the preserved height of window @var{window} in
pixels. @var{window} must be a live window and defaults to the selected
one. If the optional argument @var{horizontal} is non-@code{nil}, it
returns the preserved width of @var{window}. It returns @code{nil} if
the size of @var{window} is not preserved.
@end defun
@node Deleting Windows
@section Deleting Windows
@cindex deleting windows
@ -1252,6 +1252,8 @@ are the opposite of what they are in those other functions.
@node Recombining Windows
@section Recombining Windows
@cindex recombining windows
@cindex windows, recombining
When deleting the last sibling of a window @var{W}, its parent window
is deleted too, with @var{W} replacing it in the window tree. This

View file

@ -107,11 +107,11 @@
2014-10-26 Eric S. Raymond <esr@thyrsus.com>
* efaq-w32.texi: Neutralized language specific to a repository type.
* efaq-w32.texi: Neutralize language specific to a repository type.
2014-10-25 Eric S. Raymond <esr@thyrsus.com>
* gnus-coding.txt: Neutralized language specific to a repository type.
* gnus-coding.texi: Neutralize language specific to a repository type.
2014-10-20 Glenn Morris <rgm@gnu.org>

View file

@ -1,3 +1,13 @@
2014-12-27 Álvar Ibeas <ibeas@gmx.com> (tiny change)
* tutorials/TUTORIAL.es: Improve style consistency. Spelling fixes.
2014-12-25 Karl Fogel <kfogel@red-bean.com>
* NEWS: Mention new buffer display behavior for `shell'.
This follows up to Sam Steingold's change of 2014-12-23
in ../lisp/shell.el, in git commit e55a467ec0f758c311d3.
2014-12-15 Artur Malabarba <bruce.connor.am@gmail.com>
* NEWS: Mention `let-alist.

View file

@ -187,6 +187,14 @@ Unicode standards.
* Changes in Specialized Modes and Packages in Emacs 25.1
** Shell
When you invoke `shell' interactively, the *shell* buffer will now
display in a new window. However, you can customize this behavior via
the new `shell-display-buffer-actions' variable. For example, to get
the old behavior -- *shell* buffer displays in current window -- use
(setq shell-display-buffer-actions '(display-buffer-same-window)).
** ido
*** New command `ido-bury-buffer-at-head' bound to C-S-b
Bury the buffer at the head of `ido-matches', analogous to how C-k
@ -393,10 +401,13 @@ and comments.
the color range from `vc-annotate-color-map' is applied to the
background or to the foreground.
*** compare-windows now compares text with the most recently used window
*** `compare-windows' now compares text with the most recently used window
instead of the next window. The new option `compare-windows-get-window-function'
allows to customize this.
*** Two new faces `compare-windows-removed' and `compare-windows-added'
replace the obsolete face `compare-windows'.
** Calculator: decimal display mode uses "," groups, so it's more
fitting for use in money calculations; factorial works with
non-integer inputs.
@ -426,6 +437,25 @@ By default, 32 spaces and four TABs are considered to be too much but
`tildify-ignored-environments-alist' variables (as well as a few
helper functions) obsolete.
** xref
The new package provides generic framework and new commands to find
and move to definitions, as well as pop back to the original location.
*** New key bindings
`xref-find-definitions' replaces `find-tag' and provides an interface
to pick one destination among several. Hence, `tags-loop-continue' is
unbound. `xref-pop-marker-stack' replaces `pop-tag-mark', but uses an
easier binding, which is now unoccupied (`M-,').
`xref-find-definitions-other-window' replaces `find-tag-other-window'.
`xref-find-definitions-other-frame' replaces `find-tag-other-frame'.
`xref-find-apropos' replaces `find-tag-regexp'.
*** New variables
`find-tag-marker-ring-length' is now an obsolete alias for
`xref-marker-ring-length'. `find-tag-marker-ring' is now an obsolete
alias for a private variable. `xref-push-marker-stack' and
`xref-pop-marker-stack' should be used to mutate it instead.
** Obsolete packages
---

View file

@ -16,7 +16,7 @@ ocasión, usaremos las siguientes abreviaturas.
Nota importante: para terminar la sesión de Emacs teclee C-x C-c (dos
caracteres). Para cancelar un comando parcialmente introducido,
teclee C-g.
Los caracteres ">>" en el margen izquierdo indican instrucciones para
Los caracteres «>>» en el margen izquierdo indican instrucciones para
que usted trate de usar un comando. Por ejemplo:
<<Blank lines inserted around following line by help-with-tutorial>>
[Mitad de página en blanco para propósitos didácticos. El texto continúa abajo]
@ -67,11 +67,11 @@ Es útil moverse de una pantalla completa a otra pero, ¿cómo moverse a
un lugar específico dentro del texto en la pantalla?
Puede hacerlo de diversas formas. Puede usar las teclas de flechas,
pero es mas eficiente mantener las manos en la posición estándar y
pero es más eficiente mantener las manos en la posición estándar y
usar los comandos C-p, C-b, C-f, y C-n. Estos caracteres son
equivalentes a las cuatro teclas de flechas, de esta manera:
Línea anterior, C-P
Línea anterior, C-p
:
:
Atrás, C-b.... Posición actual del cursor .... Adelante, C-f
@ -111,7 +111,7 @@ C-f puede moverse a través de una nueva línea igual que C-b.
Cuando pase el tope o el final de la pantalla, se mostrará el texto
más allá del borde de la pantalla. Esto recibe el nombre de
"desplazamiento". Esto le permite a Emacs mover el cursor al lugar
«desplazamiento». Esto le permite a Emacs mover el cursor al lugar
especificado en el texto sin moverlo fuera de la pantalla.
>> Intente mover el cursor fuera del borde de la pantalla con C-n, y
@ -133,10 +133,10 @@ dirección opuesta.
Note el paralelo entre C-f y C-b de un lado y M-f y M-b del otro. Muy
frecuentemente los caracteres Meta se usan para operaciones
relacionadas, con las unidades definidas por el lenguaje (palabras,
relacionadas con las unidades definidas por el lenguaje (palabras,
oraciones y párrafos), mientras los caracteres Control operan sobre
unidades básicas que son independientes de lo que está editando
(caracteres, líneas, etc).
(caracteres, líneas, etc.).
Este paralelo se aplica entre líneas y oraciones: C-a y C-e para
moverse al comienzo o al final de la línea; y M-a y M-e para mover al
@ -149,7 +149,7 @@ Vea cómo la repetición de C-a no hace nada, pero la repetición de M-a
sigue moviendo una oración más. Aunque no son muy análogas, cada una
parece natural.
La ubicación del cursor en el texto se llama también "punto". En
La ubicación del cursor en el texto se llama también «punto». En
otras palabras, el cursor muestra sobre la pantalla donde está
situado el punto dentro del texto.
@ -178,7 +178,7 @@ Otros dos comandos importantes de movimiento del cursor son M-< (META
Menor que), el cual se mueve al comienzo del texto entero, y M-> (META
Mayor que), el cual se mueve al final del texto entero.
En la mayoría de las terminales, el "<" está sobre la coma, por lo
En la mayoría de las terminales, el «<» está sobre la coma, por lo
tanto tiene que usar la tecla shift para teclearlo. En estas
terminales tendrá que usar la tecla shift también al teclear M-<; sin
la tecla shift, usted estaría escribiendo M-coma.
@ -207,7 +207,7 @@ una tecla META (o EDIT o ALT), hay una manera alternativa para
ingresar un argumento numérico: teclear los dígitos mientras presiona
la tecla META. Recomendamos aprender el método C-u porque éste
funciona en cualquier terminal. El argumento numérico es también
llamado un "argumento prefijo", porque usted teclea el argumento antes
llamado un «argumento prefijo», porque usted teclea el argumento antes
del comando al que se aplica.
Por ejemplo, C-u 8 C-f mueve hacia adelante ocho caracteres.
@ -253,7 +253,7 @@ comienzo de un comando que no quiere finalizar.
>> Escriba C-u 100 para hacer un argumento numérico de 100, y luego
pruebe C-g.
Ahora pruebe C-f. Esto deberá mover sólo un carácter, ya que
Ahora pruebe C-f. Esto deberá mover solo un carácter, ya que
canceló el argumento con C-g.
Si ha tecleado <ESC> por error, puede desecharlo con un C-g.
@ -262,7 +262,7 @@ Si ha tecleado <ESC> por error, puede desecharlo con un C-g.
* COMANDOS DESACTIVADOS
-----------------------
Algunos comandos de Emacs están "desactivados" de manera que los
Algunos comandos de Emacs están «desactivados» de manera que los
usuarios principiantes no puedan usarlos accidentalmente.
Si teclea uno de los comandos desactivados, Emacs muestra un mensaje
@ -271,7 +271,7 @@ continuar y ejecutar el comando.
Si realmente quiere intentar el comando, teclee Espacio como repuesta
a la pregunta. Normalmente, si no quiere ejecutar el comando
desactivado, conteste la pregunta con "n".
desactivado, conteste la pregunta con «n».
>> Escriba C-x C-l (que es un comando desactivado), a continuación
escriba n para responder la pregunta.
@ -280,7 +280,7 @@ desactivado, conteste la pregunta con "n".
* VENTANAS
----------
Emacs puede tener varias "ventanas", cada una mostrando su propio texto.
Emacs puede tener varias «ventanas», cada una mostrando su propio texto.
Explicaremos después cómo usar múltiples ventanas. Ahora mismo
queremos explicar cómo deshacerse de ventanas adicionales y volver a
la edición básica en una ventana. Es sencillo:
@ -310,15 +310,15 @@ cuatro caracteres.
Si quiere insertar un texto, basta con que lo teclee. Los caracteres
normales, como A, 7, *, etc. se insertan nada más teclearlos. Teclee
<Return> (la tecla "Enter" o "Intro") para insertar un carácter de
<Return> (la tecla «Enter» o «Intro») para insertar un carácter de
nueva línea.
Para borrar el carácter que precede al cursor, oprima <DEL>. Es una
tecla alargada, normalmente etiquetada como "Backspace" o "Del", o con
tecla alargada, normalmente etiquetada como «Backspace» o «Del», o con
una flecha apuntando a la izquierda; la misma que suele utilizar fuera
de Emacs para borrar el último carácter introducido.
Puede haber otra tecla llamada "Del" o "Supr" en otra parte, pero ésa
Puede haber otra tecla llamada «Del» o «Supr» en otra parte, pero ésa
no es <DEL>.
>> Haga esto ahora: teclee unos pocos caracteres, después bórrelos
@ -327,9 +327,9 @@ no es <DEL>.
personal de él.
Cuando una línea de texto se hace muy grande para una sola línea de la
pantalla, la línea de texto "continúa" en una segunda línea en la
pantalla, la línea de texto «continúa» en una segunda línea en la
pantalla. Si está usando un entorno gráfico, se mostrarán pequeñas
flechas curvas en las estrechas franjas vacías (los "márgenes" derecho
flechas curvas en las estrechas franjas vacías (los «márgenes» derecho
e izquierdo) a cada lado del área de texto, para indicar que la línea
continúa. Si está utilizando una terminal, la continuación se señala
mediante una barra invertida («\») en la última columna de la derecha.
@ -357,13 +357,13 @@ circundante, puede además insertar espacio en blanco tras el carácter
de fin de línea, de forma que, al seguir tecleando en la línea recién
creada, el texto que tecleamos quede alineado con el de la línea
anterior. Este comportamiento (que la pulsación de una tecla no solo
inserte el carácter correspondiente) se denomina "eléctrico".
inserte el carácter correspondiente) se denomina «eléctrico».
>> Veamos un ejemplo de comportamiento "eléctrico" de <Return>
>> Veamos un ejemplo de comportamiento «eléctrico» de <Return>
Teclee <Return> al final de esta línea.
Fíjese que, tras insertar el carácter de nueva línea, Emacs inserta
también espacios para que el cursor se sitúe bajo la "T" de "Teclee".
también espacios para que el cursor se sitúe bajo la «T» de «Teclee».
Recuerde que a la mayoría de los comandos de Emacs se les puede dar un
factor de repetición; esto incluye los caracteres de texto. Repetir
@ -375,7 +375,7 @@ Ya ha aprendido la manera más básica de teclear algo en Emacs y
corregir errores. Puede borrar por palabras o por líneas. He aquí un
resumen de las operaciones de borrado:
<DEL> borra el carácter justo antes que el cursor
<DEL> borra el carácter justo antes del cursor
C-d borra el siguiente carácter después del cursor
M-<DEL> Elimina la palabra inmediatamente antes del
@ -389,29 +389,29 @@ Note que <DEL> y C-d, comparados con M-<DEL> y M-d, extienden el
paralelismo iniciado por C-f y M-f (bien, <DEL> no es realmente una
tecla de control, pero no nos preocuparemos de eso ahora). C-k y M-k,
en cierta forma, son como C-e y M-e, en que las líneas de unos
corresponden a sentencias en los otros.
corresponden a oraciones en los otros.
También puede eliminar un segmento contiguo de texto con un método
uniforme. Muévase a un extremo de ese segmento de texto, y teclee C-@
o C-SPC (cualquiera de los dos). (SPC es la barra espaciadora.)
o C-<SPC> (cualquiera de los dos). (<SPC> es la barra espaciadora.)
Luego, mueva el cursor al otro extremo del texto que desea eliminar.
Al hacerlo, Emacs resaltará el texto situado entre el cursor y la
posición en la que tecleó C-SPC. Finalmente, teclee C-w. Eso elimina
posición en la que tecleó C-<SPC>. Finalmente, teclee C-w. Eso elimina
todo el texto entre las dos posiciones.
>> Mueva el cursor a la letra T del inicio del párrafo anterior.
>> Teclee C-SPC. Emacs debe mostrar el mensaje "Mark set" en la parte
>> Teclee C-<SPC>. Emacs debe mostrar el mensaje «Mark set» en la parte
de abajo de la pantalla.
>> Mueva el cursor a la x en "extremo", en la segunda línea del
>> Mueva el cursor a la x en «extremo», en la segunda línea del
párrafo.
>> Teclee C-w. Esto eliminará el texto que comienza desde la T, y
termina justo antes de la x.
La diferencia entre "eliminar" y "borrar" es que el texto "eliminado"
La diferencia entre «eliminar» y «borrar» es que el texto «eliminado»
puede ser reinsertado (en cualquier posición), mientras que las cosas
"borradas" no pueden ser reinsertadas (sin embargo, es posible
«borradas» no pueden ser reinsertadas (sin embargo, es posible
deshacer el borrado; ver más abajo). La reinserción de texto
eliminado se llama "yanking" o "pegar". Generalmente, los comandos
eliminado se llama «yanking» o «pegar». Generalmente, los comandos
que pueden quitar mucho texto lo eliminan (para que pueda pegarlo de
nuevo) mientras que los comandos que quitan solo un carácter, o solo
líneas en blanco y espacios, borran (y por tanto no se puede pegar lo
@ -426,17 +426,17 @@ borran. Con un argumento, eliminan.
Note que al teclear C-k una sola vez elimina el contenido de la línea,
y un segundo C-k elimina la línea misma, y hace que todas las otras
líneas se muevan hacia arriba. C-k trata un argumento numérico
especialmente: Elimina ese número de líneas y TAMBIÉN sus
especialmente: elimina ese número de líneas y TAMBIÉN sus
contenidos. Esto no es una simple repetición. C-u 2 C-k elimina dos
líneas y sus nuevas líneas, tecleando C-k dos veces no hace esto.
Reinsertar texto eliminado se denomina "yanking" o "pegar". (Piense
Reinsertar texto eliminado se denomina «yanking» o «pegar». (Piense
en ello como pegar de nuevo, o traer de vuelta, algún texto que le fue
quitado.) Puede pegar el texto eliminado, ya sea el lugar en que fue
eliminado, o en otra parte del buffer, o hasta en un archivo
diferente. Puede pegar el texto varias veces, lo que hace varias
copias de él. Algunos editores se refieren a eliminar y reinsertar
como "cortar" y "pegar" (consulte el Glosario en el manual de Emacs).
como «cortar» y «pegar» (consulte el Glosario en el manual de Emacs).
El comando para pegar es C-y. Reinserta el último texto eliminado, en
la posición actual del cursor.
@ -460,7 +460,7 @@ Después de haber tecleado C-y para conseguir la eliminación más
reciente, tecleando M-y reemplaza el texto pegado con la eliminación
previa. Tecleando M-y una y otra vez traerá las eliminaciones
anteriores. Cuando haya encontrado el texto que buscaba, no tiene que
hacer nada para conservarlo. Sólo siga con su edición, dejando el
hacer nada para conservarlo. Solo siga con su edición, dejando el
texto pegado en donde está.
Si teclea M-y suficientes veces, regresa al punto inicial (la
@ -513,29 +513,29 @@ si puede pegarlo con C-y; no hay diferencia alguna para deshacer.
Para que pueda hacer permanente el texto que edite, lo debe colocar en
un archivo. De otra manera, éste se perderá cuando cierre Emacs.
Para poder poner su texto en un archivo, debe "encontrar" el archivo
antes de ingresar el texto. (Esto se llama también "visitar" el
Para poder poner su texto en un archivo, debe «encontrar» el archivo
antes de ingresar el texto. (Esto se llama también «visitar» el
archivo.)
Encontrar un archivo significa que puede ver su contenido dentro de
Emacs. En cierta forma, es como si estuviera editando el archivo
mismo. Sin embargo los cambios que haga mediante Emacs no serán
permanentes hasta que "guarde" el archivo. Esto es para evitar dejar
permanentes hasta que «guarde» el archivo. Esto es para evitar dejar
un archivo a medio cambiar en el sistema cuando no quiera. Incluso
cuando guarde, Emacs dejará el archivo original bajo un nombre
cambiado en caso de que luego decida que sus cambios fueron un error.
Si mira cerca del final de la pantalla podrá ver una línea que
comienza con guiones, y empieza con " -:--- TUTORIAL.es" o algo así.
comienza con guiones, y empieza con « U:--- TUTORIAL.es» o algo así.
Esta parte de la pantalla normalmente muestra el nombre del archivo
que está visitando. En este momento está visitando su propia copia
del tutorial de Emacs, que se llama "TUTORIAL.es". Cuando encuentre
del tutorial de Emacs, que se llama «TUTORIAL.es». Cuando encuentre
un archivo con Emacs, el nombre de ese archivo aparecerá en ese mismo
punto.
Una cosa especial acerca del comando para encontrar un archivo, es que
Una cosa especial acerca del comando para encontrar un archivo es que
tendrá que decir qué nombre de archivo desea. Decimos que el comando
"lee un argumento" (en este caso, el argumento es el nombre del
«lee un argumento» (en este caso, el argumento es el nombre del
archivo). Después de teclear el comando:
C-x C-f Encontrar un archivo
@ -565,19 +565,19 @@ comando
Esto copia el texto dentro de Emacs al archivo. La primera vez que
haga esto, Emacs renombrará el archivo original con un nuevo nombre
para que éste no se pierda. El nuevo nombre se hace agregando "~" al
para que éste no se pierda. El nuevo nombre se hace agregando «~» al
final del nombre del archivo original. Cuando guardar haya terminado,
Emacs mostrará el nombre del archivo escrito.
>> Teclee C-x C-s TUTORIAL.es <Return>
Esto guardará el tutorial en un archivo llamado TUTORIAL.es, y
mostrará "Wrote ...TUTORIAL.es" al final de la pantalla.
mostrará «Wrote ...TUTORIAL.es» al final de la pantalla.
Puede encontrar un archivo existente, para verlo o editarlo. También
puede hacerlo con un archivo que no exista. Ésta es la forma de crear
un archivo en Emacs: encuentre el archivo, que está inicialmente vacío,
luego comience a insertar el texto para ese archivo. Cuando invoque
"guardar" el archivo, Emacs creará realmente el archivo con el texto
«guardar» el archivo, Emacs creará realmente el archivo con el texto
que ha insertado. De ahí en adelante, puede considerar que está
editando un archivo existente.
@ -591,7 +591,7 @@ C-f. De esta forma puede mantener un gran número de archivos dentro
de Emacs.
Emacs almacena cada texto del archivo dentro de un objeto llamado
"buffer". Al encontrar un archivo se crea un nuevo buffer dentro de
«buffer». Al encontrar un archivo se crea un nuevo buffer dentro de
Emacs. Para mirar la lista de los buffers que existen actualmente,
teclee:
@ -605,14 +605,14 @@ una ventana de Emacs es siempre parte de algún buffer.
>> Teclee C-x 1 para deshacerse de la lista de buffers.
Cuando tenga varios buffers, solo uno de ellos es "actual" en algún
Cuando tenga varios buffers, solo uno de ellos es «actual» en algún
momento. Ese buffer es el que actualmente edita. Si quiere editar
otro buffer, necesita "cambiar" a él. Si quiere cambiar a un buffer
otro buffer, necesita «cambiar» a él. Si quiere cambiar a un buffer
que corresponde a un archivo, puede hacerlo visitando el archivo de
nuevo con C-x C-f. Pero existe una manera más rápida: use el comando
C-x b. En ese comando, necesita teclear el nombre de buffer.
>> Cree un archivo llamado "foo" tecleando C-x C-f foo <Return>.
>> Cree un archivo llamado «foo» tecleando C-x C-f foo <Return>.
Después teclee C-x b TUTORIAL.es <Return> para regresar a este
tutorial.
@ -622,12 +622,12 @@ esto no es así siempre. La lista de buffers que hace con C-x C-b
muestra el nombre de cada buffer y de su archivo correspondiente.
Algunos buffers no corresponden a un archivo. El buffer llamado
"*Buffer List*", que contiene la lista de buffers que ha creado con
«*Buffer List*», que contiene la lista de buffers que ha creado con
C-x C-b, no tiene archivo. Este buffer TUTORIAL.es al principio no
tenía archivo, pero ahora , porque en la sección anterior tecleó
C-x C-s y lo guardó en un archivo.
El buffer llamado "*Messages*" tampoco tiene un archivo
El buffer llamado «*Messages*» tampoco tiene un archivo
correspondiente. Este buffer contiene los mensajes que han aparecido
en la línea de abajo durante su sesión de Emacs.
@ -649,7 +649,7 @@ guardado. Le pregunta, por cada buffer, si quiere guardarlo o no.
>> Inserte una línea de texto, luego teclee C-x s.
Debería preguntarle si desea guardar el buffer llamado TUTORIAL.es.
Conteste si a la pregunta tecleando "y".
Conteste «» a la pregunta tecleando «y».
* EXTENDER EL CONJUNTO DE COMANDOS
@ -675,14 +675,14 @@ Si está utilizando una pantalla gráfica, no necesita ningún comando
especial para cambiar de Emacs a otra aplicación. Puede hacerlo con
el ratón, o mediante el gestor de ventanas. Sin embargo, si está
usando una terminal que solo puede mostrar una aplicación a la vez,
tendrá que "suspender" Emacs para poder acceder a otras aplicaciones.
tendrá que «suspender» Emacs para poder acceder a otras aplicaciones.
C-z es el comando para salir de Emacs *temporalmente*: para que pueda
regresar a la misma sesión de Emacs después. Cuando Emacs está
ejecutándose en una terminal, C-z "suspende" Emacs; esto es, se
ejecutándose en una terminal, C-z «suspende» Emacs; esto es, se
regresa al intérprete de comandos pero no se destruye Emacs. En los
intérpretes de comandos más comunes, puede reanudar Emacs con el
comando "fg" o con "%emacs".
comando «fg» o con «%emacs».
El momento para usar C-x C-c es cuando está listo para salir del
sistema. Es además el paso correcto para salir de un Emacs invocado
@ -706,7 +706,7 @@ con menos frecuencia, o únicamente en ciertos modos. Un ejemplo es el
comando replace-string, el cual substituye una cadena de caracteres
por otra en todo el buffer. Cuando teclea M-x, Emacs le pregunta al
final de la pantalla con M-x y debe escribir el nombre del comando; en
este caso "replace-string". Solo teclee "repl s<TAB>" y Emacs
este caso «replace-string». Solo teclee «repl s<TAB>» y Emacs
completará el nombre. (<TAB> es la tecla del tabulador, que
habitualmenté está situada sobre la tecla de bloquear mayúsculas o la
de shift, en el lado izquierdo del teclado.) Para aceptar el comando
@ -721,7 +721,7 @@ Debe terminar cada argumento con <Return>.
M-x repl s<Return>cambiado<Return>alterado<Return>.
Note cómo ha cambiado la línea: ha substituido la palabra
"cambiado" por "alterado" en cada ocurrencia, después de la
«cambiado» por «alterado» en cada ocurrencia, después de la
posición inicial del cursor.
@ -730,10 +730,10 @@ Debe terminar cada argumento con <Return>.
Si ha hecho cambios en un archivo, pero no los ha guardado, éstos
podrían perderse si su computadora falla. Para protegerlo de esto,
Emacs periódicamente escribe un archivo "auto guardado" para cada
Emacs escribe periódicamente un archivo «auto guardado» para cada
archivo que está editando. El nombre del archivo auto guardado tiene
un # al principio y al final; por ejemplo, si su archivo se llama
"hola.c", su archivo auto guardado es "#hola.c#". Cuando guarda por
«hola.c», su archivo auto guardado es «#hola.c#». Cuando guarda por
la vía normal, Emacs borra su archivo de auto guardado.
Si la computadora falla, puede recuperar su edición de auto guardado
@ -748,16 +748,16 @@ para seguir adelante y recuperar la información de auto guardado.
Si Emacs ve que usted está tecleando comandos de multicaracteres
lentamente, se los muestra al final de la pantalla en un área llamada
"área de eco". El área de eco contiene la línea final de la pantalla.
«área de eco». El área de eco contiene la línea final de la pantalla.
* LÍNEA DE MODO
---------------
La línea inmediatamente encima del área de eco recibe el nombre de
"línea de modo" o "mode line". La línea de modo dice algo así:
«línea de modo» o «mode line». La línea de modo dice algo así:
-:**- TUTORIAL.es 63% L749 (Fundamental)
U:**- TUTORIAL.es 63% L749 (Fundamental)
Esta línea da información útil acerca del estado de Emacs y del texto
que está editando.
@ -766,9 +766,9 @@ Ya sabe qué significa el nombre del archivo: es el archivo que usted
ha encontrado. NN% indica su posición actual en el texto; esto
significa que NN por ciento del texto está encima de la parte superior
de la pantalla. Si el principio del archivo está en la pantalla, éste
dirá "Top" en vez de " 0%". Si el final del texto está en la
pantalla, dirá "Bot". Si está mirando un texto tan pequeño que cabe
entero en la pantalla, el modo de línea dirá "All".
dirá «Top» en vez de « 0%». Si el final del texto está en la
pantalla, dirá «Bot». Si está mirando un texto tan pequeño que cabe
entero en la pantalla, el modo de línea dirá «All».
La L y los dígitos señalan la posición de otra forma: indican el
número de línea actual del punto.
@ -780,13 +780,13 @@ parte de la línea de modo no muestra asteriscos, solo guiones.
La parte de la línea de modo dentro de los paréntesis es para
indicarle en qué modo de edición está. El modo por omisión es
Fundamental, el cual está usando ahora. Éste es un ejemplo de un
"modo mayor".
«modo mayor».
Emacs tiene diferentes modos mayores. Algunos están hechos para
editar diferentes lenguajes y/o clases de texto, tales como modo de
Lisp, modo de Texto, etc. En cualquier momento uno y solo un modo
mayor está activo, y su nombre siempre se puede encontrar en la línea
de modo, justo en donde "Fundamental" está ahora.
de modo, justo en donde «Fundamental» está ahora.
Cada modo mayor hace que algunos comandos actúen diferente. Por
ejemplo, hay comandos para crear comentarios en un programa, y como
@ -808,7 +808,7 @@ modo Fundamental, M-f y M-b trataban los apóstrofes como separadores
de palabras.
Los modos mayores normalmente hacen cambios sutiles como el anterior:
la mayoría de comandos hacen "el mismo trabajo" en cada modo mayor,
la mayoría de comandos hacen «el mismo trabajo» en cada modo mayor,
pero funcionan de forma un poco diferente.
Para ver la documentación del modo mayor actual, teclee C-h m.
@ -840,11 +840,11 @@ Puede activar el modo Auto Fill al hacer M-x auto-fill-mode <Return>.
Cuando el modo esté activado, puede desactivarlo nuevamente usando M-x
auto-fill-mode <Return>. Si el modo está desactivado, este comando lo
activa, y si el modo está activado, este comando lo desactiva.
Decimos que el comando "cambia el modo".
Decimos que el comando «cambia el modo».
>> teclee M-x auto-fill-mode <Return> ahora. Luego inserte una línea
de "asdf " repetidas veces hasta que la vea dividida en dos líneas.
Debe intercalar espacios porque Auto Fill sólo rompe líneas en los
de «asdf » repetidas veces hasta que la vea dividida en dos líneas.
Debe intercalar espacios porque Auto Fill solo rompe líneas en los
espacios.
El margen está normalmente puesto en 70 caracteres, pero puede
@ -867,48 +867,48 @@ ese párrafo.
* BUSCAR
--------
Emacs puede hacer búsquedas de cadenas (una "cadena" es un grupo de
Emacs puede hacer búsquedas de cadenas (una «cadena» es un grupo de
caracteres contiguos) hacia adelante a través del texto o hacia atrás
en el mismo. La búsqueda de una cadena es un comando de movimiento de
cursor; mueve el cursor al próximo lugar donde esa cadena aparece.
El comando de búsqueda de Emacs es "incremental". Esto significa que
El comando de búsqueda de Emacs es «incremental». Esto significa que
la búsqueda ocurre mientras teclea la cadena para buscarla.
El comando para iniciar una búsqueda es C-s para búsqueda hacia
adelante, y C-r para la búsqueda hacia atrás. ¡PERO ESPERE! No los
intente aún.
Cuando teclee C-s verá que la cadena "I-search" aparece como una
Cuando teclee C-s verá que la cadena «I-search» aparece como una
petición en el área de eco. Esto le indica que Emacs está en lo que
se conoce como búsqueda incremental, esperando que teclee lo que
quiere buscar. <Return> termina una búsqueda.
>> Ahora teclee C-s para comenzar la búsqueda. LENTAMENTE, una letra
a la vez, teclee la palabra "cursor", haciendo pausa después de
a la vez, teclee la palabra «cursor», haciendo pausa después de
cada carácter para notar lo que pasa con el cursor.
Ahora ha buscado "cursor", una vez.
Ahora ha buscado «cursor», una vez.
>> Teclee C-s de nuevo, para buscar la siguiente ocurrencia de
"cursor".
«cursor».
>> Ahora teclee <DEL> cuatro veces y vea como se mueve el cursor.
>> Teclee <Return> para terminar la búsqueda.
¿Vió lo que ocurrió? Emacs, en una búsqueda incremental, trata de ir
¿Vio lo que ocurrió? Emacs, en una búsqueda incremental, trata de ir
a la ocurrencia de la cadena que ha tecleado hasta el momento. Para
ir a la próxima ocurrencia de "cursor" solo teclee C-s de nuevo. Si
ir a la próxima ocurrencia de «cursor» solo teclee C-s de nuevo. Si
tal ocurrencia no existe, Emacs pita y le dice que la búsqueda actual
está fallando ("failing"). C-g también termina la búsqueda.
está fallando («failing»). C-g también termina la búsqueda.
Si se encuentra en medio de una búsqueda incremental y teclea <DEL>,
la búsqueda "vuelve" a un punto anterior. Si teclea <DEL> justo
la búsqueda «vuelve» a un punto anterior. Si teclea <DEL> justo
después de teclear C-s para avanzar hasta la siguiente ocurrencia de
la cadena buscada, el cursor retrocede a una ocurrencia previa. Si no
hay ocurrencias previas, <DEL> borra el último carácter de la cadena
buscada. Por ejemplo, suponga que ha tecleado "c", para buscar la
primera ocurrencia de "c". Ahora, si teclea "u", el cursor se moverá
a la primera ocurrencia de "cu". Ahora teclee <DEL>. Esto borra la
"u" de la cadena buscada, y el cursor vuelve a la primera ocurrencia
de "c".
buscada. Por ejemplo, suponga que ha tecleado «c», para buscar la
primera ocurrencia de «c». Ahora, si teclea «u», el cursor se moverá
a la primera ocurrencia de «cu». Ahora teclee <DEL>. Esto borra la
«u» de la cadena buscada, y el cursor vuelve a la primera ocurrencia
de «c».
Si está en medio de una búsqueda y teclea un carácter control o meta
(con algunas pocas excepciones: los caracteres que son especiales en
@ -926,8 +926,8 @@ la búsqueda se invierte.
Una de las características agradables de Emacs es que se puede mostrar
más de una ventana en la pantalla al mismo tiempo. (Note que Emacs
usa el término "marcos", descrito en la siguiente sección, para
referirse a lo que otras aplicaciones llaman "ventanas". El manual de
usa el término «marcos», descrito en la siguiente sección, para
referirse a lo que otras aplicaciones llaman «ventanas». El manual de
Emacs contiene un Glosario de términos.)
>> Mueva el cursor a esta línea y teclee C-l C-l.
@ -939,7 +939,7 @@ Emacs contiene un Glosario de términos.)
>> Teclee C-M-v para desplazar la ventana inferior.
(Si no tiene una tecla META real, teclee ESC C-v.)
>> Teclee C-x o ("o" para "otro") para mover el cursor a la ventana
>> Teclee C-x o («o» para «otro») para mover el cursor a la ventana
inferior.
>> Use C-v y M-v en la ventana inferior para desplazarla.
Siga leyendo estas direcciones en la ventana superior.
@ -949,7 +949,7 @@ Emacs contiene un Glosario de términos.)
El cursor en la ventana superior está justo donde estaba antes.
Puede continuar usando C-x o para cambiar entre las ventanas. La
"ventana seleccionada", donde tiene lugar casi toda la edición, es la
«ventana seleccionada», donde tiene lugar casi toda la edición, es la
que tiene un cursor muy visible que parpadea cuando usted no está
tecleando. Las otras ventanas tienen su propia posición del cursor;
si está ejecutando Emacs en una pantalla gráfica, esos cursores se
@ -962,7 +962,7 @@ C-M-v.
C-M-v es un ejemplo de un carácter CONTROL-META. Si tiene una tecla
META (o Alt), puede teclear C-M-v pulsando a la vez CONTROL y META
mientras teclea v. No importa qué tecla "vaya primero", CONTROL o
mientras teclea v. No importa qué tecla «vaya primero», CONTROL o
META, porque las dos teclas actúan modificando los caracteres que
teclea.
@ -975,8 +975,8 @@ sí mismo, no es una tecla modificadora.
ventana de abajo.
(Si hubiera tecleado C-x 1 en la ventana inferior, esto eliminaría la
superior. Piense en este comando como "mantener sólo una
ventana--aquella en la cual estoy.")
superior. Piense en este comando como «mantener solo una
ventana aquella en la cual estoy».)
No tiene por qué mostrarse el mismo buffer en ambas ventanas. Si usa
C-x C-f para encontrar un archivo en una ventana, la otra ventana no
@ -997,10 +997,10 @@ diferentes:
* MÚLTIPLES MARCOS
------------------
Emacs puede crear también múltiples "marcos". Marco es como
denominamos a un grupo de ventanas, junto con sus menus, barras de
Emacs puede crear también múltiples «marcos». Marco es como
denominamos a un grupo de ventanas, junto con sus menús, barras de
desplazamiento, áreas de eco, etc. En entornos gráficos, lo que Emacs
denomina "marco" es lo que otras aplicaciones llaman "ventana". En
denomina «marco» es lo que otras aplicaciones llaman «ventana». En
entornos gráficos, es posible mostrar varios marcos al mismo tiempo.
En una terminal, solo se puede mostrar un marco a la vez.
@ -1015,7 +1015,7 @@ El primer marco no tiene nada de especial.
También puede destruir un marco mediante el método normal que ofrezca
el entorno gráfico (a menudo, pinchando con el ratón en un botón
etiquetado como "X" en alguna de las esquinas superiores del marco).
etiquetado como «X» en alguna de las esquinas superiores del marco).
Si al hacer eso destruye el último marco de Emacs, la aplicación
termina.
@ -1023,24 +1023,24 @@ termina.
* NIVELES RECURSIVOS DE EDICIÓN
--------------------------------
Algunas veces entrará a lo que es llamado un "nivel recursivo de
edición". Esto se indica en la línea de modo mediante corchetes en la
Algunas veces entrará a lo que es llamado un «nivel recursivo de
edición». Esto se indica en la línea de modo mediante corchetes en la
línea de modo, rodeando los paréntesis del nombre del modo mayor. Por
ejemplo, probablemente vea [(Fundamental)] en vez de (Fundamental).
Para salir de los niveles recursivos de edición, teclee ESC ESC ESC.
Éste es un comando de "salida" para todo propósito. También lo puede
Éste es un comando de «salida» para todo propósito. También lo puede
usar para eliminar ventanas extras, y salir del minibuffer.
>> Teclee M-x para entrar a un minibuffer; luego teclee ESC ESC ESC
para salir.
No se puede usar C-g para salir de los "niveles recursivos de
edición". Esto es porque C-g es usado para cancelar comandos y
No se puede usar C-g para salir de los «niveles recursivos de
edición». Esto es porque C-g es usado para cancelar comandos y
argumentos DENTRO del nivel recursivo de edición.
* CONSEGUIR MAS AYUDA
* CONSEGUIR MÁS AYUDA
---------------------
En este tutorial hemos tratado de ofrecer suficiente información para
@ -1048,8 +1048,8 @@ que empiece a usar Emacs. Hay tanto disponible en Emacs que sería
imposible explicar todo aquí. Sin embargo, quizá desee aprender más
sobre Emacs, ya que tiene muchas otras características útiles. Emacs
provee comandos para leer documentación acerca de los comandos de
Emacs. Todos estos comandos de "ayuda" comienzan con el carácter
Control-h, que es llamado "el carácter de Ayuda (Help)".
Emacs. Todos estos comandos de «ayuda» comienzan con el carácter
Control-h, que es llamado «el carácter de Ayuda (Help)».
Para usar las funciones de ayuda, teclee el carácter C-h, y luego un
carácter que especifica qué tipo de ayuda quiere. Si está REALMENTE
@ -1069,12 +1069,12 @@ una descripción muy breve del comando.
C-p runs the command previous-line
Esto le dice el "nombre de la función". Ya que los nombres de las
Esto le dice el «nombre de la función». Ya que los nombres de las
funciones se eligen para indicar lo que hace el comando, pueden servir
como una breve documentación: suficiente para recordarle los comandos
que ha aprendido.
Los comandos de múltiples caracteres tales como C-x C-s y (sí no tiene
Los comandos de múltiples caracteres tales como C-x C-s y (si no tiene
las teclas META o EDIT o ALT) <ESC>v también están permitidos después
de C-h c.
@ -1113,7 +1113,7 @@ pregunte por ella.
>> Teclee C-h a file <Return>.
Esto muestra en otra ventana una lista de todos los comandos M-x con
la palabra "file" en sus nombres. Verá los comandos de caracteres
la palabra «file» en sus nombres. Verá los comandos de caracteres
listados junto a los nombres de los comandos correspondientes (por
ejemplo, C-x C-f junto a find-file).
@ -1123,7 +1123,7 @@ ejemplo, C-x C-f junto a find-file).
>> Teclee C-x 1 para borrar la ventana de ayuda.
C-h i Leer los manuales incluidos (alias Info). Este comando
lo pone en un buffer especial llamado "*info*" donde
lo pone en un buffer especial llamado «*info*» donde
puede leer manuales de los paquetes instalados en su
sistema. Teclee m emacs <Return> para leer el manual
de Emacs. Si nunca ha usado Info, teclee ? y Emacs y
@ -1137,22 +1137,22 @@ ejemplo, C-x C-f junto a find-file).
---------------------
Puede aprender más acerca de Emacs leyendo su manual, ya sea como
libro o en el propio Emacs (use el menú Ayuda, "Help", o teclee C-h
libro o en el propio Emacs (use el menú Ayuda, «Help», o teclee C-h
r). Dos características que pueden gustarle son la completación, que
ahorra teclear, y dired, que simplifica el manejo de archivos.
La completación es una manera de ahorrar teclear innecesariamente.
Por ejemplo, si quiere cambiarse al buffer "*Messages*", puede teclear
Por ejemplo, si quiere cambiarse al buffer «*Messages*», puede teclear
C-x b *M<Tab> y Emacs encontrará el resto del nombre del buffer tan
lejos como pueda determinar de lo que ya haya tecleado. La
completación también funciona con nombres de comandos y de archivos.
La completación se describe en el Info del manual de Emacs en el nodo
llamado "Completion".
llamado «Completion».
Dired le permite listar los archivos en un directorio (y opcionalmente
sus subdirectorios), moverse alrededor de esa lista, visitar,
renombrar, borrar y aparte de eso operar en los archivos. Dired está
descrito en el manual de Emacs en el nodo llamado "Dired".
descrito en el manual de Emacs en el nodo llamado «Dired».
El manual también describe otras características de Emacs.
@ -1164,7 +1164,7 @@ Para salir permanentemente de Emacs use C-x C-c.
Este tutorial intenta ser comprensible para todos los usuarios nuevos,
así que si encuentra algo que no esté claro, no se quede parado
culpándose a mismo: ¡Quéjese!
culpándose a mismo: ¡quéjese!
* COPIA
@ -1200,7 +1200,7 @@ La versión en español ha sido actualizada por:
Rafael Sepúlveda <drs@gnulinux.org.mx>
Juanma Barranquero <lekktu@gmail.com>
Por favor, en caso de duda, sólo es válido el original en inglés de la
Por favor, en caso de duda, solo es válido el original en inglés de la
siguiente nota de derechos de reproducción (que puede encontrar en el
archivo TUTORIAL).
@ -1220,7 +1220,7 @@ Copyright (C) 1985, 1996, 1998, 2001-2014 Free Software Foundation, Inc.
Las condiciones para copiar Emacs mismo son más complejas, pero con el
mismo espíritu. Por favor lea el archivo COPYING y luego distribuya
copias de GNU Emacs a sus amigos. ¡Ayude a erradicar el
obstruccionismo del software ("propietariedad") usando, escribiendo, y
obstruccionismo del software («propietariedad») usando, escribiendo, y
compartiendo software libre!
--- end of TUTORIAL.es ---

View file

@ -1,3 +1,15 @@
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* Makefile.in (etags_libs, ebrowse${EXEEXT}, profile${EXEEXT})
(make-docfile${EXEEXT}, movemail${EXEEXT})
(update-game-score${EXEEXT}): Put $(NTLIB) before $(LOADLIBES),
since GCC sometimes calls stpcpy when it sees strcpy, under
optimization switches.
2014-12-14 Paul Eggert <eggert@cs.ucla.edu>
* etags.c (analyze_regex): Rename from analyse_regex.
2014-12-14 Glenn Morris <rgm@gnu.org>
* grep-changelog: Remove file.

View file

@ -321,7 +321,7 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
etags_libs = regex.o $(LOADLIBES) $(NTLIB)
etags_libs = regex.o $(NTLIB) $(LOADLIBES)
etags${EXEEXT}: ${etags_deps}
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
@ -336,18 +336,18 @@ ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps}
ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
$(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
$< $(LOADLIBES) $(NTLIB) -o $@
$< $(NTLIB) $(LOADLIBES) -o $@
profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
$(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@
$(NTLIB) $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o $@
make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LOADLIBES) $(NTLIB) -o $@
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(NTLIB) $(LOADLIBES) -o $@
movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
$(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@
$(NTLIB) $(LOADLIBES) $(LIBS_MOVE) -o $@
pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
$(AM_V_CC)$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $<
@ -378,7 +378,7 @@ hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} \
-DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
$< $(LOADLIBES) $(NTLIB) -o $@
$< $(NTLIB) $(LOADLIBES) -o $@
emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico
$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<

View file

@ -1150,19 +1150,19 @@ sym_scope_1 (struct sym *p)
if (*scope_buffer)
{
ensure_scope_buffer_room (3);
strcat (scope_buffer, "::");
strcpy (scope_buffer + scope_buffer_len, "::");
scope_buffer_len += 2;
}
len = strlen (p->name);
ensure_scope_buffer_room (len + 1);
strcat (scope_buffer, p->name);
strcpy (scope_buffer + scope_buffer_len, p->name);
scope_buffer_len += len;
if (HAS_FLAG (p->flags, F_TEMPLATE))
{
ensure_scope_buffer_room (3);
strcat (scope_buffer, "<>");
strcpy (scope_buffer + scope_buffer_len, "<>");
scope_buffer_len += 2;
}
@ -2797,24 +2797,25 @@ operator_name (int *sc)
s = token_string (LA1);
MATCH ();
len = strlen (s) + 10;
ptrdiff_t slen = strlen (s);
len = slen + 10;
if (len > id_size)
{
size_t new_size = max (len, 2 * id_size);
id = (char *) xrealloc (id, new_size);
id_size = new_size;
}
strcpy (id, s);
char *z = stpcpy (id, s);
/* Vector new or delete? */
if (LOOKING_AT ('['))
{
strcat (id, "[");
z = stpcpy (z, "[");
MATCH ();
if (LOOKING_AT (']'))
{
strcat (id, "]");
strcpy (z, "]");
MATCH ();
}
}
@ -2830,7 +2831,7 @@ operator_name (int *sc)
id = (char *) xrealloc (id, new_size);
id_size = new_size;
}
strcpy (id, "operator");
char *z = stpcpy (id, "operator");
/* Beware access declarations of the form "X::f;" Beware of
`operator () ()'. Yet another difficulty is found in
@ -2842,14 +2843,16 @@ operator_name (int *sc)
len += strlen (s) + 2;
if (len > id_size)
{
ptrdiff_t idlen = z - id;
size_t new_size = max (len, 2 * id_size);
id = (char *) xrealloc (id, new_size);
id_size = new_size;
z = id + idlen;
}
if (*s != ')' && *s != ']')
strcat (id, " ");
strcat (id, s);
*z++ = ' ';
z = stpcpy (z, s);
MATCH ();
/* If this is a simple operator like `+', stop now. */
@ -3462,9 +3465,9 @@ open_file (char *file)
buffer = (char *) xrealloc (buffer, buffer_size);
}
strcpy (buffer, path->path);
strcat (buffer, "/");
strcat (buffer, file);
char *z = stpcpy (buffer, path->path);
*z++ = '/';
strcpy (z, file);
fp = fopen (buffer, "r");
}

View file

@ -905,9 +905,9 @@ get_server_config (const char *config_file, struct sockaddr_in *server,
{
char *path = xmalloc (strlen (home) + strlen (config_file)
+ EXTRA_SPACE);
strcpy (path, home);
strcat (path, "/.emacs.d/server/");
strcat (path, config_file);
char *z = stpcpy (path, home);
z = stpcpy (z, "/.emacs.d/server/");
strcpy (z, config_file);
config = fopen (path, "rb");
free (path);
}
@ -916,9 +916,9 @@ get_server_config (const char *config_file, struct sockaddr_in *server,
{
char *path = xmalloc (strlen (home) + strlen (config_file)
+ EXTRA_SPACE);
strcpy (path, home);
strcat (path, "/.emacs.d/server/");
strcat (path, config_file);
char *z = stpcpy (path, home);
z = stpcpy (z, "/.emacs.d/server/");
strcpy (z, config_file);
config = fopen (path, "rb");
free (path);
}
@ -1193,7 +1193,6 @@ set_local_socket (const char *local_socket_name)
{
/* socket_name is a file name component. */
long uid = geteuid ();
ptrdiff_t tmpdirlen;
use_tmpdir = 1;
tmpdir = egetenv ("TMPDIR");
if (!tmpdir)
@ -1212,12 +1211,11 @@ set_local_socket (const char *local_socket_name)
#endif
tmpdir = "/tmp";
}
tmpdirlen = strlen (tmpdir);
socket_name_storage =
xmalloc (tmpdirlen + strlen (server_name) + EXTRA_SPACE);
strcpy (socket_name_storage, tmpdir);
sprintf (socket_name_storage + tmpdirlen, "/emacs%ld/", uid);
strcat (socket_name_storage + tmpdirlen, server_name);
xmalloc (strlen (tmpdir) + strlen (server_name) + EXTRA_SPACE);
char *z = stpcpy (socket_name_storage, tmpdir);
z += sprintf (z, "/emacs%ld/", uid);
strcpy (z, server_name);
local_socket_name = socket_name_storage;
}
@ -1253,12 +1251,12 @@ set_local_socket (const char *local_socket_name)
{
/* We're running under su, apparently. */
long uid = pw->pw_uid;
ptrdiff_t tmpdirlen = strlen (tmpdir);
char *user_socket_name
= xmalloc (tmpdirlen + strlen (server_name) + EXTRA_SPACE);
strcpy (user_socket_name, tmpdir);
sprintf (user_socket_name + tmpdirlen, "/emacs%ld/", uid);
strcat (user_socket_name + tmpdirlen, server_name);
= xmalloc (strlen (tmpdir) + strlen (server_name)
+ EXTRA_SPACE);
char *z = stpcpy (user_socket_name, tmpdir);
z += sprintf (z, "/emacs%ld/", uid);
strcpy (z, server_name);
if (strlen (user_socket_name) < sizeof (server.sun_path))
strcpy (server.sun_path, user_socket_name);
@ -1507,8 +1505,7 @@ start_daemon_and_retry_set_socket (void)
const char *deq = "--daemon=";
char *daemon_arg = xmalloc (strlen (deq)
+ strlen (socket_name) + 1);
strcpy (daemon_arg, deq);
strcat (daemon_arg, socket_name);
strcpy (stpcpy (daemon_arg, deq), socket_name);
d_argv[1] = daemon_arg;
}
execvp ("emacs", d_argv);

View file

@ -1277,13 +1277,13 @@ main (int argc, char **argv)
default:
continue; /* the for loop */
}
strcpy (cmd, "mv ");
strcat (cmd, tagfile);
strcat (cmd, " OTAGS;fgrep -v '\t");
strcat (cmd, argbuffer[i].what);
strcat (cmd, "\t' OTAGS >");
strcat (cmd, tagfile);
strcat (cmd, ";rm OTAGS");
char *z = stpcpy (cmd, "mv ");
z = stpcpy (z, tagfile);
z = stpcpy (z, " OTAGS;fgrep -v '\t");
z = stpcpy (z, argbuffer[i].what);
z = stpcpy (z, "\t' OTAGS >");
z = stpcpy (z, tagfile);
strcpy (z, ";rm OTAGS");
if (system (cmd) != EXIT_SUCCESS)
fatal ("failed to execute shell command", (char *)NULL);
}
@ -1307,10 +1307,10 @@ main (int argc, char **argv)
/* Maybe these should be used:
setenv ("LC_COLLATE", "C", 1);
setenv ("LC_ALL", "C", 1); */
strcpy (cmd, "sort -u -o ");
strcat (cmd, tagfile);
strcat (cmd, " ");
strcat (cmd, tagfile);
char *z = stpcpy (cmd, "sort -u -o ");
z = stpcpy (z, tagfile);
*z++ = ' ';
strcpy (z, tagfile);
exit (system (cmd));
}
return EXIT_SUCCESS;
@ -3427,8 +3427,9 @@ C_entries (int c_ext, FILE *inf)
case omethodtag:
case omethodparm:
objdef = omethodcolon;
linebuffer_setlen (&token_name, token_name.len + 1);
strcat (token_name.buffer, ":");
int toklen = token_name.len;
linebuffer_setlen (&token_name, toklen + 1);
strcpy (token_name.buffer + toklen, ":");
break;
}
if (structdef == stagseen)
@ -6362,12 +6363,12 @@ relative_filename (char *file, char *dir)
while ((dp = strchr (dp + 1, '/')) != NULL)
i += 1;
res = xnew (3*i + strlen (fp + 1) + 1, char);
res[0] = '\0';
char *z = res;
while (i-- > 0)
strcat (res, "../");
z = stpcpy (z, "../");
/* Add the file name relative to the common root of file and dir. */
strcat (res, fp + 1);
strcpy (z, fp + 1);
free (afn);
return res;

View file

@ -1397,8 +1397,7 @@ sendline (popserver server, const char *line)
over a few dozen messages, and is a big chunk of the time we
spend fetching mail from a server close by. */
buf = alloca (strlen (line) + 3);
strcpy (buf, line);
strcat (buf, "\r\n");
strcpy (stpcpy (buf, line), "\r\n");
ret = fullwrite (server->file, buf, strlen (buf));
if (ret < 0)

View file

@ -221,9 +221,9 @@ main (int argc, char **argv)
if (!scorefile)
lose_syserr ("Couldn't allocate score file");
strcpy (scorefile, prefix);
strcat (scorefile, "/");
strcat (scorefile, argv[optind]);
char *z = stpcpy (scorefile, prefix);
*z++ = '/';
strcpy (z, argv[optind]);
newscore.score = normalize_integer (argv[optind + 1]);
if (! newscore.score)
@ -430,8 +430,7 @@ write_scores (const char *filename, const struct score_entry *scores,
char *tempfile = malloc (strlen (filename) + strlen (".tempXXXXXX") + 1);
if (!tempfile)
return -1;
strcpy (tempfile, filename);
strcat (tempfile, ".tempXXXXXX");
strcpy (stpcpy (tempfile, filename), ".tempXXXXXX");
fd = mkostemp (tempfile, 0);
if (fd < 0)
return -1;
@ -462,8 +461,7 @@ lock_file (const char *filename, void **state)
char *lockpath = malloc (strlen (filename) + strlen (lockext) + 60);
if (!lockpath)
return -1;
strcpy (lockpath, filename);
strcat (lockpath, lockext);
strcpy (stpcpy (lockpath, filename), lockext);
*state = lockpath;
while ((fd = open (lockpath, O_CREAT | O_EXCL, 0600)) < 0)

View file

@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings
MOSTLYCLEANFILES += core *.stackdump
@ -1214,6 +1214,15 @@ EXTRA_DIST += stdlib.in.h
## end gnulib module stdlib
## begin gnulib module stpcpy
EXTRA_DIST += stpcpy.c
EXTRA_libgnu_a_SOURCES += stpcpy.c
## end gnulib module stpcpy
## begin gnulib module strftime
libgnu_a_SOURCES += strftime.c

49
lib/stpcpy.c Normal file
View file

@ -0,0 +1,49 @@
/* stpcpy.c -- copy a string and return pointer to end of new string
Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2014 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program 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 any
later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <string.h>
#undef __stpcpy
#ifdef _LIBC
# undef stpcpy
#endif
#ifndef weak_alias
# define __stpcpy stpcpy
#endif
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
char *
__stpcpy (char *dest, const char *src)
{
register char *d = dest;
register const char *s = src;
do
*d++ = *s;
while (*s++ != '\0');
return d - 1;
}
#ifdef weak_alias
weak_alias (__stpcpy, stpcpy)
#endif

View file

@ -1,3 +1,310 @@
2014-12-28 Juri Linkov <juri@linkov.net>
* vc/compare-w.el: Require diff-mode for diff faces.
(compare-windows-removed, compare-windows-added): New faces
inheriting from diff faces.
(compare-windows): Define obsolete face alias.
(compare-windows-highlight): Replace face `compare-windows' with
new faces `compare-windows-added' and `compare-windows-removed'
(bug#19451).
(compare-windows-get-recent-window): Signal an error when
no other window is found (bug#19170).
2014-12-27 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/elisp-mode.el (elisp--xref-identifier-file):
Skip features that have no sources.
* simple.el (execute-extended-command):
When `suggest-key-bindings' is nil, don't.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: Native readline completion.
* progmodes/python.el (python-shell-completion-native-disabled-interpreters)
(python-shell-completion-native-enable)
(python-shell-completion-native-output-timeout): New defcustoms.
(python-shell-completion-native-interpreter-disabled-p)
(python-shell-completion-native-try)
(python-shell-completion-native-setup)
(python-shell-completion-native-turn-off)
(python-shell-completion-native-turn-on)
(python-shell-completion-native-turn-on-maybe)
(python-shell-completion-native-turn-on-maybe-with-msg)
(python-shell-completion-native-toggle): New functions.
(python-shell-completion-native-get-completions): New function.
(python-shell-completion-at-point): Use it.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: Enhance shell user interaction and deprecate
python-shell-get-or-create-process.
* progmodes/python.el
(python-shell-get-process-or-error): New function.
(python-shell-with-shell-buffer): Use it.
(python-shell-send-string, python-shell-send-region)
(python-shell-send-buffer, python-shell-send-defun)
(python-shell-send-file, python-shell-switch-to-shell): Use it.
Add argument MSG to display user-friendly message when no process
is running.
(python-shell-switch-to-shell): Call pop-to-buffer with NORECORD.
(python-shell-make-comint): Rename argument SHOW from POP. Use
display-buffer instead of pop-to-buffer.
(run-python): Doc fix. Return process.
(python-shell-get-or-create-process): Make obsolete.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (python-shell-buffer-substring): Handle
cornercase when region sent starts at point-min.
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* language/misc-lang.el (composition-function-table): Add Syriac
characters and also ZWJ/ZWNJ. See
http://lists.gnu.org/archive/html/help-gnu-emacs/2014-12/msg00248.html
for the details.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: Fix message when sending region.
* progmodes/python.el (python-shell-send-region): Rename argument
send-main from nomain. Fix message.
(python-shell-send-buffer): Rename argument send-main from arg.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: Cleanup temp files even with eval errors.
* progmodes/python.el (python-shell-send-file): Make file-name
mandatory. Fix temp file removal in the majority of cases.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: Handle file encoding for shell.
* progmodes/python.el (python-rx-constituents): Add coding-cookie.
(python-shell--save-temp-file): Write file with proper encoding.
(python-shell-buffer-substring): Add coding cookie for detected
encoding to generated content. Fix blank lines when removing
if-name-main block.
(python-shell-send-file): Handle file encoding.
(python-info-encoding-from-cookie)
(python-info-encoding): New functions.
2014-12-27 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Use `tramp-rsh-end-of-line', it ought to be more robust.
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/js.el (js-syntax-propertize): "return" can't be divided
(bug#19397).
2014-12-27 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-read-passwd): Ignore errors from `auth-source-*'.
* net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use "\n"
as end-of-line delimeter for passwords, when running on MS Windows.
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/sh-script.el (sh-set-shell): Don't change the global value
of indent-line-function (bug#19433).
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
Fix line numbers on Python shell.
* progmodes/python.el (python-shell--save-temp-file): Do not
append coding cookie.
(python-shell-send-string): Generalize for
python-shell-send-region.
(python--use-fake-loc): Delete var.
(python-shell-buffer-substring): Cleanup fake-loc logic.
(python-shell-send-region): Remove fake-loc logic, simplify.
2014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (python-indent-post-self-insert-function):
Make colon to re-indent only for dedenters, handling
multiline-statements gracefully.
2014-12-27 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-handle-insert-file-contents):
Set `find-file-not-found-functions' in case of errors. (Bug#18623)
2014-12-27 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-send-command-and-read): New optional
arg MARKER.
(tramp-get-remote-path): Use it.
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* lisp/subr.el (redisplay-dont-pause): Mark as obsolete.
2014-12-27 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-error-with-buffer): Call `message' properly.
(tramp-accept-process-output): Use nil as argument for
`accept-process-output', when there is a gateway prepended.
* net/tramp-gw.el (tramp-gw-open-connection): Suppress traces in
wrong debug buffer.
(tramp-gw-open-connection): Set process coding system 'binary.
(tramp-gw-open-network-stream): Handle HTTP error 403.
* net/tramp-sh.el (tramp-compute-multi-hops): Suppress traces in
wrong debug buffer.
(tramp-maybe-open-connection): Set connection property "gateway".
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (sit-for): Tweak docstring (bug#19381).
2014-12-27 Dmitry Gutov <dgutov@yandex.ru>
* vc/vc-git.el (vc-git-after-dir-status-stage): Move `up-to-date'
stage to after `diff-index' (bug#19386).
2014-12-27 João Távora <joaotavora@gmail.com>
* textmodes/tex-mode.el (tex-insert-quote): Consider and respect
`electric-pair-mode' (bug#19356).
2014-12-27 Dmitry Gutov <dgutov@yandex.ru>
elisp-xref-find: Don't create buffers eagerly.
* progmodes/elisp-mode.el (elisp--identifier-location): Fold back
into `elisp--company-location'.
(elisp--identifier-completion-table): Rename to
`elisp--identifier-completion-table', and do not include just any
symbols with a property list.
(elisp-completion-at-point): Revert the 2014-12-25 change.
(elisp--xref-identifier-file): New function.
(elisp--xref-find-definitions): Use it.
* emacs-lisp/find-func.el (find-function-library): New function,
extracted from `find-function-noselect'.
* progmodes/xref.el (xref-elisp-location): New class.
(xref-make-elisp-location): New function.
(xref-location-marker): New implementation.
2014-12-27 Juri Linkov <juri@linkov.net>
* minibuffer.el (minibuffer-completion-help):
Use shrink-window-if-larger-than-buffer in window-height
when temp-buffer-resize-mode is nil.
* window.el (with-displayed-buffer-window): Remove window-height
from the action alist in the temp-buffer-window-show call
when window-height is handled explicitly afterwards (bug#19355).
2014-12-27 Juri Linkov <juri@linkov.net>
Support subdirectories when saving places in dired.
* saveplace.el (toggle-save-place, save-place-to-alist)
(save-places-to-alist, save-place-dired-hook):
Use dired-current-directory instead of dired-directory (bug#19436).
(save-place-dired-hook): Add check for alist to make the new
format future-proof to allow other possible formats.
2014-12-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: Generate clearer shell buffer names.
* progmodes/python.el (python-shell-get-process-name)
(python-shell-internal-get-process-name): Use `buffer-name`.
(python-shell-internal-get-or-create-process): Simplify.
2014-12-26 Dmitry Gutov <dgutov@yandex.ru>
Add basic xref apropos implementation to elisp-mode.
* progmodes/elisp-mode.el (elisp--xref-find-definitions):
Filter out nil results.
(elisp--xref-find-apropos): New function.
(elisp-xref-find): Use it.
* progmodes/xref.el (xref--show-xrefs): Use `user-error'.
2014-12-25 Filipp Gunbin <fgunbin@fastmail.fm>
* dired-aux.el (dired-maybe-insert-subdir): Make
dired-maybe-insert-subdir always skip trivial files.
2014-12-25 Helmut Eller <eller.helmut@gmail.com>
Dmitry Gutov <dgutov@yandex.ru>
Consolidate cross-referencing commands.
Move autoloaded bindings for `M-.', `M-,', `C-x 4 .' and
`C-x 5 .' from etags.el to xref.el.
* progmodes/xref.el: New file.
* progmodes/elisp-mode.el (elisp--identifier-types): New variable.
(elisp--identifier-location): New function, extracted from
`elisp--company-location'.
(elisp--company-location): Use it.
(elisp--identifier-completion-table): New variable.
(elisp-completion-at-point): Use it.
(emacs-lisp-mode): Set the local values of `xref-find-function'
and `xref-identifier-completion-table-function'.
(elisp-xref-find, elisp--xref-find-definitions)
(elisp--xref-identifier-completion-table): New functions.
* progmodes/etags.el (find-tag-marker-ring): Mark obsolete in
favor of `xref--marker-ring'.
(tags-lazy-completion-table): Autoload.
(tags-reset-tags-tables): Use `xref-clear-marker-stack'.
(find-tag-noselect): Use `xref-push-marker-stack'.
(pop-tag-mark): Make an alias for `xref-pop-marker-stack'.
(etags--xref-limit): New constant.
(etags-xref-find, etags--xref-find-definitions): New functions.
2014-12-25 Martin Rudalics <rudalics@gmx.at>
* cus-start.el (resize-mini-windows): Make it customizable.
2014-12-24 Stephen Leake <stephen_leake@stephe-leake.org>
* startup.el (fancy-about-text): Change buttons for etc/CONTRIBUTE
to (info "(emacs)Contributing"). (Bug#19299)
2014-12-24 Martin Rudalics <rudalics@gmx.at>
* window.el (mouse-autoselect-window-position-1): New variable.
(mouse-autoselect-window-cancel)
(mouse-autoselect-window-select, handle-select-window): With
delayed autoselection select window only if mouse moves after
selecting its frame.
2014-12-24 Michael Albinus <michael.albinus@gmx.de>
* eshell/esh-ext.el (eshell-find-interpreter): Expand relative
remote file names. (Bug#18782)
2014-12-23 Sam Steingold <sds@gnu.org>
* shell.el (shell-display-buffer-actions): New user option.
(shell): Pass it to `pop-to-buffer' instead of hard-coding
`pop-to-buffer-same-window'.
2014-12-23 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/js.el (js--syntax-propertize-regexp-syntax-table): New var.
(js-syntax-propertize-regexp): Use it to recognize "slash in
a character class" (bug#19397).
2014-12-22 Stefan Monnier <monnier@iro.umontreal.ca>
* completion.el: Use post-self-insert-hook (bug#19400).
@ -35,24 +342,21 @@
2014-12-19 Alan Mackenzie <acm@muc.de>
Make C++11 uniform init syntax work. New keywords "final" and "override"
Make C++11 uniform init syntax work.
New keywords "final" and "override"
* progmodes/cc-engine.el (c-back-over-member-initializer-braces):
New function.
(c-guess-basic-syntax): Set `containing-sex' and `lim' using the
new function.
* progmodes/cc-fonts.el (c-font-lock-declarations): Check more
carefully for "are we at a declarator?" using
c-back-over-member-initializers.
* progmodes/cc-langs.el (c-type-modifier-kwds): include "final"
* progmodes/cc-langs.el (c-type-modifier-kwds): Include "final"
and "override" in the C++ value.
2014-12-19 Martin Rudalics <rudalics@gmx.at>
* textmodes/ispell.el (ispell-command-loop): Don't use
`next-window'.
* textmodes/ispell.el (ispell-command-loop): Don't use `next-window'.
2014-12-21 Lars Ingebrigtsen <larsi@gnus.org>
@ -132,7 +436,7 @@
do the window handling.
(ispell-adjusted-window-height, ispell-overlay-window): Remove.
(ispell-display-buffer): New function to reuse, create and fit
window to ispell's buffers. (Bug#3413)
window to ispell's buffers. (Bug#3413)
2014-12-18 Dmitry Gutov <dgutov@yandex.ru>
@ -256,6 +560,13 @@
* vc/vc-bzr.el (vc-bzr-diff):
* obsolete/vc-arch.el (vc-arch-diff): Move ASYNC argument to the end.
2014-12-14 Paul Eggert <eggert@cs.ucla.edu>
* emacs-lisp/cconv.el (cconv--analyze-use):
Rename from cconv--analyse-use.
(cconv--analyze-function): Rename from cconv--analyse-function.
(cconv-analyze-form): Rename from cconv-analyse-form.
2014-12-13 Andreas Schwab <schwab@linux-m68k.org>
* net/shr.el (shr-next-link): Don't error out at eob.
@ -322,12 +633,12 @@
2014-12-12 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc-dav.el, vc/vc-git.el, vc/vc-hg.el, vc/vc-src.el,
vc/vc.el: latest-on-branch-p is no longer a public method.
* vc/vc-dav.el, vc/vc-git.el, vc/vc-hg.el, vc/vc-src.el:
* vc/vc.el: latest-on-branch-p is no longer a public method.
* vc/vc.el, vc/vc-hg.el, vc/vc-git.el, vc/vc-hooks.el,
vc/vc-mtn.el, vc/vc-rcs.el, vc/vc-sccs.el, vc/vc-src.el: Remove `rollback'
method, to be replaced in the future by uncommit.
* vc/vc.el, vc/vc-hg.el, vc/vc-git.el, vc/vc-hooks.el:
* vc/vc-mtn.el, vc/vc-rcs.el, vc/vc-sccs.el, vc/vc-src.el:
Remove `rollback' method, to be replaced in the future by uncommit.
2014-12-11 Michael Albinus <michael.albinus@gmx.de>
@ -345,10 +656,9 @@
2014-12-10 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc-dispatcher.el, vc/vc-hooks.el, vc/vc-rcs.el,
vc/vc-sccs.el, vc/vc.el: Righteous featurectomy of
vc-keep-workfiles, it's a shoot-self-in-foot archaism.
Workfiles are always kept.
* vc/vc-dispatcher.el, vc/vc-hooks.el, vc/vc-rcs.el:
* vc/vc-sccs.el, vc/vc.el: Righteous featurectomy of vc-keep-workfiles,
it's a shoot-self-in-foot archaism. Workfiles are always kept.
2014-12-10 Rasmus Pank Roulund <emacs@pank.eu>
@ -379,7 +689,7 @@
2014-12-09 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc-src.el (vc-src-do-comand): Prepend -- to file argument
list, avoids problems witth names containing hyphens.
list, avoids problems witt names containing hyphens.
2014-12-09 Wilson Snyder <wsnyder@wsnyder.org>
@ -499,7 +809,7 @@
2014-12-08 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc-arch.el: Moved to obsolete directory so a test framework
* vc/vc-arch.el: Move to obsolete directory so a test framework
won't trip over bit-rot in it. There has been no Arch snapshot
for nine years.
@ -706,13 +1016,13 @@
2014-12-02 Eric S. Raymond <esr@snark.thyrsus.com>
* subr.el (filter): New macro. Because it's just silly for a Lisp
* subr.el (filter): New macro. Because it's just silly for a Lisp
not to have this in 2014. And VC needs it.
* vc.el, all backends: API simplification: Abolish dir-status.
* vc.el: All backends: API simplification: Abolish dir-status.
It's replaced by dir-status-files.
* vc.el, all backends: API simplification: Remove 4th
* vc.el: All backends: API simplification: Remove 4th
'default-state' argument from vc-dir-status files and its backend
methods - no backend method ever set it. It was used only in the
fallback method to to set a default of 'up-to-date, though a
@ -723,17 +1033,17 @@
* vc.el (vc-expand-dirs): Now takes a second BACKEND argument,
improving behavior on directories using multiple file-oriented VCSes.
* vc/vc.el and all backends: API simplification; clear-headers
* vc/vc.el: All backends: API simplification; clear-headers
is no longer a public method. It is now local to the one place
it's used, in the RCS steal-lock method.
2014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc.el and all backends: API simplification; could-register
* vc/vc.el: In all backends: API simplification; could-register
is no longer a public method. (vc-cvs.el still has a private
implementation.)
* vc/vc.el and all backends: API cleanup; the backend diff method
* vc/vc.el: In all backends: API cleanup; the backend diff method
takes an explicit async flag. This eliminates a particularly ugly
global.
@ -848,11 +1158,11 @@
the back ends; this fixes a layering violation that caused bad
behavior with SVN.
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
* vc/vc.el, vc-hooks.el: All backends: API simplification;
vc-stay-local-p and repository-hostname are no longer public
methods. Only the CVS and SVN backends used these, and the SVN
support was conditioned out because svn status -v is too slow.
The CVS back end retains this machibery and the vc-stay-local
The CVS back end retains this machinery and the vc-stay-local
configuration variable now only affects it.
2014-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
@ -861,26 +1171,26 @@
2014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
* vc/vc.el, vc-hooks.el: All backends: API simplification;
vc-state-heuristic is no longer a public method, having been
removed where it is redundant, unnecessary, or known buggy.
This eliminated all backends except CVS. Eliminates bug#7850.
* vc/vc-cvs.el, vc/vc-hooks.el, vc/vc-rcs.el, vc/vc-sccs.el:
Eliminate vc-mistrust-permissions. It was only relevant to the
RCS and SCCS back ends and defaulted to t. Code now always
RCS and SCCS back ends and defaulted to t. Code now always
mistrusts permissions - by actual measurement the effect on
performance is negligible. As a side effect bug#11490 is now
performance is negligible. As a side effect bug#11490 is now
irrelevant.
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
* vc/vc.el, vc-hooks.el: All backends: API simplification;
vc-workfile-unchanged-p is no longer a public method (but the RCS
and SCCS back ends retain it as a private method used in state
computation). This method was redundant with vc-state and usually
implemented as a trivial call to same. Fixes the failure mode
computation). This method was redundant with vc-state and usually
implemented as a trivial call to same. Fixes the failure mode
described in bug#694.
* vc/vc.el and all backends: API simplification; init-revision is
* vc/vc.el: All backends: API simplification; init-revision is
gone, and vc-registered functions no longer take an
initial-revision argument.
@ -1040,7 +1350,7 @@
string.
(newsticker--treeview-load): Change wording of the questions the
user is asked when `newsticker-groups-filename' is found to be
used and we offer to read and remove the groups file. (bug#19165)
used and we offer to read and remove the groups file. (Bug#19165)
2014-11-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
@ -1245,7 +1555,7 @@
2014-11-22 Ulf Jasper <ulf.jasper@web.de>
* net/newst-backend.el (newsticker--sentinel-work):
Tell `libxml-parse-xml-region' to discard comments. Fixes bug#18787.
Tell `libxml-parse-xml-region' to discard comments. Fixes bug#18787.
2014-11-22 Michael Albinus <michael.albinus@gmx.de>
@ -1262,7 +1572,7 @@
live in vc.el and certainly not in vc-hooks.el.
* vc/vc-hooks.el, vc-rcs.el, vc-sccs.el: vc-name -> vc-master-name.
This is preaparatory to isolating all the 'master' functions
This is preparatory to isolating all the 'master' functions
used only by the file-oriented back ends. With this done first,
the substantive diffs will be easier to read.
@ -1611,7 +1921,7 @@
2014-11-16 Oscar Fuentes <ofv@wanadoo.es>
Add faces for the VC modeline state indicator.
* lisp/vc/vc-hooks.el:
* vc/vc-hooks.el:
(vc-state-faces, vc-state-base-face)
(vc-up-to-date-state, vc-needs-update-state)
(vc-locked-state, vc-locally-added-state)
@ -2305,9 +2615,9 @@
* ses.el (macroexp): Add require for this package, so that function
`ses--cell gets macroexp-quote.
(ses--cell): Makes formula a macroexp-quote of value when formula
is nil. The rationale of this changr is to allow in the future
is nil. The rationale of this changr is to allow in the future
shorter SES files, e.g. we could have only `(ses-cell A1 1.0)'
instead of `(ses-cell A1 1.0 1.0 nil REFLIST)'. In such a case
instead of `(ses-cell A1 1.0 1.0 nil REFLIST)'. In such a case
reference list REFLIST would be re-computed after load --- thus
trading off load time against file size.
@ -3312,7 +3622,7 @@
HTML code has become part of the xml parse tree.
(newsticker--parse-rss-1.0, newsticker--parse-rss-2.0): Take care
of possibly missing namespace prefixes.
(newsticker--parse-generic-items): Code formatting. Typo.
(newsticker--parse-generic-items): Code formatting. Typo.
(newsticker--images-dir): Add trailing slash.
(newsticker--image-get): Fix error message.
@ -3477,7 +3787,7 @@
* vc/add-log.el (change-log-next-buffer): Don't create an empty
buffer "ChangeLog" when the current buffer doesn't match ChangeLog.[0-9].
Return the current buffer if no files match the default pattern
ChangeLog.[0-9]. Signal "end of multi" when file is nil. (Bug#18547)
ChangeLog.[0-9]. Signal "end of multi" when file is nil. (Bug#18547)
2014-09-25 Stefan Monnier <monnier@iro.umontreal.ca>
@ -3615,7 +3925,7 @@
* textmodes/reftex-sel.el (reftex-select-label-mode)
(reftex-select-bib-mode, reftex-insert-docstruct): Derive modes
from special-mode (instead of fundamental-mode) and propertize
with font-lock-face instead of just face. (Bug#18496)
with font-lock-face instead of just face. (Bug#18496)
* textmodes/reftex-toc.el (reftex-toc-mode, reftex-toc): Ditto.
@ -4009,7 +4319,7 @@
of local overrides.
(ibuffer): Don't store previous windows configuration.
Let `quit-window' handle restoring.
(ibuffer-quit): Remove function. Use `quit-window' instead.
(ibuffer-quit): Remove function. Use `quit-window' instead.
(ibuffer-restore-window-config-on-quit): Remove variable.
(ibuffer-prev-window-config): Remove variable.
@ -4263,10 +4573,10 @@
2014-08-11 Ulf Jasper <ulf.jasper@web.de>
Newsticker: introduce `newsticker-treeview-date-format'. (Bug#17227)
Newsticker: introduce `newsticker-treeview-date-format'. (Bug#17227)
* net/newst-treeview.el (newsticker-treeview-date-format): New.
(newsticker--treeview-list-add-item): Use `newsticker-treeview-date-format'.
(newsticker--treeview-list-add-item):
Use `newsticker-treeview-date-format'.
2014-08-11 Glenn Morris <rgm@gnu.org>
@ -4475,7 +4785,7 @@
2014-07-30 Christophe Deleuze <christophe.deleuze@free.fr> (tiny change)
* calendar/icalendar.el (icalendar--decode-isodatetime):
Use actual current-time-zone when converting to local time. (Bug#15408)
Use actual current-time-zone when converting to local time. (Bug#15408)
2014-07-29 Martin Rudalics <rudalics@gmx.at>
@ -4565,12 +4875,6 @@
string delimiter.
(python-mode): Use it.
2014-07-28 Fabián Ezequiel Gallina <fgallina@gnu.org>
Prevent Python process shell buffer to pop twice.
* progmodes/python.el (python-shell-switch-to-shell): Do not call
pop-to-buffer.
2014-07-28 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el
@ -4864,7 +5168,7 @@
2014-07-12 Fabián Ezequiel Gallina <fgallina@gnu.org>
Fix dedenters and electric colon handling. (Bug#15163)
Fix dedenters and electric colon handling. (Bug#15163)
* progmodes/python.el
(python-rx-constituents): Add dedenter and block-ender.
(python-indent-dedenters, python-indent-block-enders): Delete.
@ -5112,7 +5416,7 @@
* progmodes/python.el (python-indent-post-self-insert-function):
Enhancements to electric indentation behavior inside
parens. (Bug#17658)
parens. (Bug#17658)
2014-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
@ -5903,7 +6207,7 @@
* help.el (help--key-binding-keymap): New function.
(help--binding-locus): New function.
(describe-key): Mention the keymap in which the binding was
found. (bug#13948)
found. (bug#13948)
2014-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
@ -6584,7 +6888,7 @@
2014-05-24 Daniel Colascione <dancol@dancol.org>
* progmodes/subword.el (subword-find-word-boundary): Move point to
correct spot before search. (Bug#17580)
correct spot before search. (Bug#17580)
* emacs-lisp/nadvice.el (defun): Write in eval-and-compile to avoid
breaking the build.
@ -6613,7 +6917,7 @@
mksh. Improve custom spec; allow regular expressions.
(sh-shell): Delegate name splitting to `sh-canonicalize-shell'.
(sh-after-hack-local-variables): New function.
(sh-mode): Use it; respect file-local `sh-shell' variable. (bug#17333)
(sh-mode): Use it; respect file-local `sh-shell' variable. (Bug#17333)
(sh-set-shell): Use `sh-canonicalize-shell' instead of open-coding
the normalization.
(sh-canonicalize-shell): Rewrite to support regexes.
@ -7601,7 +7905,7 @@
2014-04-07 João Távora <joaotavora@gmail.com>
Fix `electric-pair-delete-adjacent-pairs' in modes binding
backspace. (bug#16981)
backspace. (Bug#16981)
* elec-pair.el (electric-pair-backward-delete-char): Delete.
(electric-pair-backward-delete-char-untabify): Delete.
(electric-pair-mode-map): Bind backspace to a menu item filtering

View file

@ -17,6 +17,11 @@
(semantic-analyze-nolongprefix-completion-at-point-function):
Do nothing if the current buffer is not using Semantic (bug#19077).
2014-12-14 Paul Eggert <eggert@cs.ucla.edu>
* semantic/lex-spp.el (semantic-lex-spp-analyzer-do-replace):
Rename from semantic-lex-spp-anlyzer-do-replace.
2014-12-08 Matt Curtis <matt.r.curtis@gmail.com> (tiny change)
* pulse.el (pulse-momentary-highlight-one-line): Respect the POINT
@ -215,7 +220,7 @@
(ede-project-autoload): Remove dirmatch entry - it is no longer
needed.
* lisp/cedet/ede/proj.el (project-rescan): Replace direct
* ede/proj.el (project-rescan): Replace direct
manipulation of `ede-projects' with equivalent and better
functions.
(ede-proj-load): Replace call to test if dir has project to
@ -267,11 +272,10 @@
2014-11-09 David Engster <dengste@eml.cc>
* lisp/cedet/ede/proj-elisp.el
(ede-proj-target-elisp::ede-proj-tweak-autoconf): Kill buffer
after saving modified elisp-comp script, as to avoid "file has
changed on disk; really edit the buffer" questions when script
gets rewritten.
* ede/proj-elisp.el (ede-proj-target-elisp::ede-proj-tweak-autoconf):
Kill buffer after saving modified elisp-comp script, so as to avoid
"file has changed on disk; really edit the buffer" questions when
script gets rewritten.
2014-10-29 Paul Eggert <eggert@cs.ucla.edu>

View file

@ -520,7 +520,12 @@ since it could result in memory overflow and make Emacs crash."
(const :tag "Hourglass" :value hourglass)))
(display-hourglass cursor boolean)
(hourglass-delay cursor number)
(resize-mini-windows
windows (choice
(const :tag "Off (nil)" :value nil)
(const :tag "Fit (t)" :value t)
(const :tag "Grow only" :value grow-only))
"25.1")
;; xfaces.c
(scalable-fonts-allowed display boolean "22.1")
;; xfns.c

View file

@ -2062,7 +2062,10 @@ See Info node `(emacs)Subdir switches' for more details."
;; inserted *after* opoint.
(setq dirname (file-name-as-directory dirname))
(or (and (not switches)
(dired-goto-subdir dirname))
(when (dired-goto-subdir dirname)
(unless (dired-subdir-hidden-p dirname)
(dired-initial-position dirname))
t))
(dired-insert-subdir dirname switches no-error-if-not-dir-p))
;; Push mark so that it's easy to find back. Do this after the
;; insert message so that the user sees the `Mark set' message.

View file

@ -3884,7 +3884,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;; Start of automatically extracted autoloads.
;;;### (autoloads nil "dired-aux" "dired-aux.el" "1448837b5f3e2b9ad63f723361f1e32e")
;;;### (autoloads nil "dired-aux" "dired-aux.el" "73269f48e7fe2fd0ac580fd69252b33a")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\

View file

@ -311,6 +311,39 @@ The search is done in the source for library LIBRARY."
(cons (current-buffer) (point)))
(cons (current-buffer) nil))))))))
(defun find-function-library (function &optional lisp-only verbose)
"Return the library FUNCTION is defined in.
If FUNCTION is a built-in function and LISP-ONLY is non-nil,
signal an error.
If VERBOSE is non-nil, and FUNCTION is an alias, display a
message about the whole chain of aliases."
(let ((def (symbol-function (find-function-advised-original function)))
aliases)
;; FIXME for completeness, it might be nice to print something like:
;; foo (which is advised), which is an alias for bar (which is advised).
(while (symbolp def)
(or (eq def function)
(not verbose)
(if aliases
(setq aliases (concat aliases
(format ", which is an alias for `%s'"
(symbol-name def))))
(setq aliases (format "`%s' is an alias for `%s'"
function (symbol-name def)))))
(setq function (symbol-function (find-function-advised-original function))
def (symbol-function (find-function-advised-original function))))
(if aliases
(message "%s" aliases))
(cond
((autoloadp def) (nth 1 def))
((subrp def)
(if lisp-only
(error "%s is a built-in function" function))
(help-C-file-name def 'subr))
((symbol-file function 'defun)))))
;;;###autoload
(defun find-function-noselect (function &optional lisp-only)
"Return a pair (BUFFER . POINT) pointing to the definition of FUNCTION.
@ -329,30 +362,8 @@ searched for in `find-function-source-path' if non-nil, otherwise
in `load-path'."
(if (not function)
(error "You didn't specify a function"))
(let ((def (symbol-function (find-function-advised-original function)))
aliases)
;; FIXME for completeness, it might be nice to print something like:
;; foo (which is advised), which is an alias for bar (which is advised).
(while (symbolp def)
(or (eq def function)
(if aliases
(setq aliases (concat aliases
(format ", which is an alias for `%s'"
(symbol-name def))))
(setq aliases (format "`%s' is an alias for `%s'"
function (symbol-name def)))))
(setq function (symbol-function (find-function-advised-original function))
def (symbol-function (find-function-advised-original function))))
(if aliases
(message "%s" aliases))
(let ((library
(cond ((autoloadp def) (nth 1 def))
((subrp def)
(if lisp-only
(error "%s is a built-in function" function))
(help-C-file-name def 'subr))
((symbol-file function 'defun)))))
(find-function-search-for-symbol function nil library))))
(let ((library (find-function-library function lisp-only t)))
(find-function-search-for-symbol function nil library)))
(defun find-function-read (&optional type)
"Read and return an interned symbol, defaulting to the one near point.

View file

@ -296,6 +296,11 @@ line of the form #!<interp>."
(let ((fullname (if (file-name-directory file) file
(eshell-search-path file)))
(suffixes eshell-binary-suffixes))
(if (and fullname
(not (file-remote-p fullname))
(file-remote-p default-directory))
(setq fullname (expand-file-name
(concat "./" fullname) default-directory)))
(if (and fullname (not (or eshell-force-execution
(file-executable-p fullname))))
(while suffixes

View file

@ -78,7 +78,8 @@ and Italian.")))
(set-char-table-range
composition-function-table
'(#x600 . #x6FF)
(list ["[\u0600-\u06FF]+" 0 font-shape-gstring]))
(list ["\u200D?[\u0600-\u074F]+[\u200D\u200C]*[\u0600-\u074F]+\u200D?"
0 font-shape-gstring]))
(provide 'misc-lang)

File diff suppressed because it is too large Load diff

View file

@ -77,7 +77,7 @@ symbol, and each cdr is the same symbol without the `.'."
(mapcar #'let-alist--deep-dot-search data)))))
(defun let-alist--access-sexp (symbol variable)
"Return a sexp used to acess SYMBOL inside VARIABLE."
"Return a sexp used to access SYMBOL inside VARIABLE."
(let* ((clean (let-alist--remove-dot symbol))
(name (symbol-name clean)))
(if (string-match "\\`\\." name)

View file

@ -1818,8 +1818,9 @@ variables.")
,(if (eq (selected-window) (minibuffer-window))
'display-buffer-at-bottom
'display-buffer-below-selected))
,(when temp-buffer-resize-mode
'(window-height . resize-temp-buffer-window))
,(if temp-buffer-resize-mode
'(window-height . resize-temp-buffer-window)
'(window-height . shrink-window-if-larger-than-buffer))
,(when temp-buffer-resize-mode
'(preserve-size . (nil . t))))
nil

View file

@ -195,11 +195,12 @@ instead of the host name declared in TARGET-VEC."
(setq tramp-gw-gw-proc
(funcall
socks-function
(tramp-get-connection-name gw-vec)
(tramp-get-connection-buffer gw-vec)
(let ((tramp-verbose 0)) (tramp-get-connection-name gw-vec))
(let ((tramp-verbose 0)) (tramp-get-connection-buffer gw-vec))
(tramp-file-name-real-host target-vec)
(tramp-file-name-port target-vec)))
(set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
(set-process-coding-system tramp-gw-gw-proc 'binary 'binary)
(tramp-compat-set-process-query-on-exit-flag tramp-gw-gw-proc nil)
(tramp-message
vec 4 "Opened %s process `%s'"
@ -260,6 +261,10 @@ authentication is requested from proxy server, provide it."
(200 (setq found t))
;; We need basic authentication.
(401 (setq authentication (tramp-gw-basic-authentication nil first)))
;; Access forbidden.
(403 (tramp-error-with-buffer
(current-buffer) tramp-gw-vector 'file-error
"Connection to %s:%d forbidden." host service))
;; Target host not found.
(404 (tramp-error-with-buffer
(current-buffer) tramp-gw-vector 'file-error

View file

@ -2471,8 +2471,12 @@ The method used must be an out-of-band method."
(mapconcat 'identity (process-command p) " "))
(tramp-set-connection-property p "vector" orig-vec)
(tramp-compat-set-process-query-on-exit-flag p nil)
(tramp-process-actions
p v nil tramp-actions-copy-out-of-band)
;; We must adapt `tramp-local-end-of-line' for
;; sending the password.
(let ((tramp-local-end-of-line tramp-rsh-end-of-line))
(tramp-process-actions
p v nil tramp-actions-copy-out-of-band))
;; Check the return code.
(goto-char (point-max))
@ -2883,7 +2887,7 @@ the result will be a local, non-Tramp, file name."
(name1 name)
(i 0)
;; We do not want to raise an error when
;; `start-file-process' has been started several time in
;; `start-file-process' has been started several times in
;; `eshell' and friends.
(tramp-current-connection nil))
@ -4510,7 +4514,8 @@ Gateway hops are already opened."
;; Therefore, we must remember the gateway vector. But we
;; cannot do it as connection property, because it shouldn't
;; be persistent. And we have no started process yet either.
(tramp-set-file-property (car target-alist) "" "gateway" hop)))
(let ((tramp-verbose 0))
(tramp-set-file-property (car target-alist) "" "gateway" hop))))
;; Foreign and out-of-band methods are not supported for multi-hops.
(when (cdr target-alist)
@ -4687,7 +4692,8 @@ connection if a previous connection has died for some reason."
l-method 'tramp-connection-timeout))
(gw-args
(tramp-get-method-parameter l-method 'tramp-gw-args))
(gw (tramp-get-file-property hop "" "gateway" nil))
(gw (let ((tramp-verbose 0))
(tramp-get-file-property hop "" "gateway" nil)))
(g-method (and gw (tramp-file-name-method gw)))
(g-user (and gw (tramp-file-name-user gw)))
(g-host (and gw (tramp-file-name-real-host gw)))
@ -4715,8 +4721,10 @@ connection if a previous connection has died for some reason."
(setq login-args (append async-args login-args)))
;; Add gateway arguments if necessary.
(when (and gw gw-args)
(setq login-args (append gw-args login-args)))
(when gw
(tramp-set-connection-property p "gateway" t)
(when gw-args
(setq login-args (append gw-args login-args))))
;; Check for port number. Until now, there's no
;; need for handling like method, user, host.
@ -4902,8 +4910,9 @@ FMT and ARGS which are passed to `error'."
(or (tramp-send-command-and-check vec command)
(apply 'tramp-error vec 'file-error fmt args)))
(defun tramp-send-command-and-read (vec command &optional noerror)
(defun tramp-send-command-and-read (vec command &optional noerror marker)
"Run COMMAND and return the output, which must be a Lisp expression.
If MARKER is a regexp, read the output after that string.
In case there is no valid Lisp expression and NOERROR is nil, it
raises an error."
(when (if noerror
@ -4911,8 +4920,17 @@ raises an error."
(tramp-barf-unless-okay
vec command "`%s' returns with error" command))
(with-current-buffer (tramp-get-connection-buffer vec)
;; Read the expression.
(goto-char (point-min))
;; Read the marker.
(when (stringp marker)
(condition-case nil
(re-search-forward marker)
(error (unless noerror
(tramp-error
vec 'file-error
"`%s' does not return the marker `%s': `%s'"
command marker (buffer-string))))))
;; Read the expression.
(condition-case nil
(prog1 (read (current-buffer))
;; Error handling.
@ -5064,25 +5082,22 @@ Return ATTR."
"/bin:/usr/bin")
"/bin:/usr/bin"))))
(own-remote-path
;; We cannot apply `tramp-send-command-and-read' because
;; the login shell could return more than just the $PATH
;; string. So we emulate that function.
;; The login shell could return more than just the $PATH
;; string. So we use `tramp-end-of-heredoc' as marker.
(when elt2
(tramp-send-command
(tramp-send-command-and-read
vec
(format
"%s -l %s 'echo \\\"$PATH\\\"'"
"%s -l %s 'echo %s \\\"$PATH\\\"'"
(tramp-get-method-parameter
(tramp-file-name-method vec) 'tramp-remote-shell)
(mapconcat
'identity
(tramp-get-method-parameter
(tramp-file-name-method vec) 'tramp-remote-shell-args)
" ")))
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-max))
(forward-line -1)
(read (current-buffer))))))
" ")
(tramp-shell-quote-argument tramp-end-of-heredoc))
nil (regexp-quote tramp-end-of-heredoc)))))
;; Replace place holder `tramp-default-remote-path'.
(when elt1

View file

@ -1610,7 +1610,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
(let ((enable-recursive-minibuffers t))
;; `tramp-error' does not show messages. So we must do it
;; ourselves.
(message fmt-string arguments)
(apply 'message fmt-string arguments)
;; Show buffer.
(pop-to-buffer buf)
(discard-input)
@ -3086,115 +3086,118 @@ User is always nil."
(setq filename (expand-file-name filename))
(let (result local-copy remote-copy)
(with-parsed-tramp-file-name filename nil
(with-tramp-progress-reporter
v 3 (format "Inserting `%s'" filename)
(unwind-protect
(if (not (file-exists-p filename))
(progn
;; We don't raise a Tramp error, because it might be
;; suppressed, like in `find-file-noselect-1'.
(tramp-message
v 1 "File not `%s' found on remote host" filename)
(signal 'file-error
(list "File not found on remote host" filename)))
(unwind-protect
(if (not (file-exists-p filename))
(tramp-error
v 'file-error "File `%s' not found on remote host" filename)
(if (and (tramp-local-host-p v)
(let (file-name-handler-alist)
(file-readable-p localname)))
;; Short track: if we are on the local host, we can
;; run directly.
(setq result
(tramp-run-real-handler
'insert-file-contents
(list localname visit beg end replace)))
(with-tramp-progress-reporter
v 3 (format "Inserting `%s'" filename)
(condition-case err
(if (and (tramp-local-host-p v)
(let (file-name-handler-alist)
(file-readable-p localname)))
;; Short track: if we are on the local host, we can
;; run directly.
(setq result
(tramp-run-real-handler
'insert-file-contents
(list localname visit beg end replace)))
;; When we shall insert only a part of the file, we
;; copy this part. This works only for the shell file
;; name handlers.
(when (and (or beg end)
(tramp-get-method-parameter
(tramp-file-name-method v) 'tramp-login-program))
(setq remote-copy (tramp-make-tramp-temp-file v))
;; This is defined in tramp-sh.el. Let's assume
;; this is loaded already.
(tramp-compat-funcall
'tramp-send-command
v
(cond
((and beg end)
(format "dd bs=1 skip=%d if=%s count=%d of=%s"
beg (tramp-shell-quote-argument localname)
(- end beg) remote-copy))
(beg
(format "dd bs=1 skip=%d if=%s of=%s"
beg (tramp-shell-quote-argument localname)
remote-copy))
(end
(format "dd bs=1 count=%d if=%s of=%s"
end (tramp-shell-quote-argument localname)
remote-copy))))
(setq tramp-temp-buffer-file-name nil beg nil end nil))
;; When we shall insert only a part of the file, we
;; copy this part. This works only for the shell file
;; name handlers.
(when (and (or beg end)
(tramp-get-method-parameter
(tramp-file-name-method v)
'tramp-login-program))
(setq remote-copy (tramp-make-tramp-temp-file v))
;; This is defined in tramp-sh.el. Let's assume
;; this is loaded already.
(tramp-compat-funcall
'tramp-send-command
v
(cond
((and beg end)
(format "dd bs=1 skip=%d if=%s count=%d of=%s"
beg (tramp-shell-quote-argument localname)
(- end beg) remote-copy))
(beg
(format "dd bs=1 skip=%d if=%s of=%s"
beg (tramp-shell-quote-argument localname)
remote-copy))
(end
(format "dd bs=1 count=%d if=%s of=%s"
end (tramp-shell-quote-argument localname)
remote-copy))))
(setq tramp-temp-buffer-file-name nil beg nil end nil))
;; `insert-file-contents-literally' takes care to
;; avoid calling jka-compr. By let-binding
;; `inhibit-file-name-operation', we propagate that
;; care to the `file-local-copy' operation.
(setq local-copy
(let ((inhibit-file-name-operation
(when (eq inhibit-file-name-operation
'insert-file-contents)
'file-local-copy)))
(cond
((stringp remote-copy)
(file-local-copy
(tramp-make-tramp-file-name
method user host remote-copy)))
((stringp tramp-temp-buffer-file-name)
(copy-file filename tramp-temp-buffer-file-name 'ok)
tramp-temp-buffer-file-name)
(t (file-local-copy filename)))))
;; `insert-file-contents-literally' takes care to
;; avoid calling jka-compr. By let-binding
;; `inhibit-file-name-operation', we propagate that
;; care to the `file-local-copy' operation.
(setq local-copy
(let ((inhibit-file-name-operation
(when (eq inhibit-file-name-operation
'insert-file-contents)
'file-local-copy)))
(cond
((stringp remote-copy)
(file-local-copy
(tramp-make-tramp-file-name
method user host remote-copy)))
((stringp tramp-temp-buffer-file-name)
(copy-file
filename tramp-temp-buffer-file-name 'ok)
tramp-temp-buffer-file-name)
(t (file-local-copy filename)))))
;; When the file is not readable for the owner, it
;; cannot be inserted, even if it is readable for the
;; group or for everybody.
(set-file-modes
local-copy (tramp-compat-octal-to-decimal "0600"))
;; When the file is not readable for the owner, it
;; cannot be inserted, even if it is readable for the
;; group or for everybody.
(set-file-modes
local-copy (tramp-compat-octal-to-decimal "0600"))
(when (and (null remote-copy)
(tramp-get-method-parameter
method 'tramp-copy-keep-tmpfile))
;; We keep the local file for performance reasons,
;; useful for "rsync".
(setq tramp-temp-buffer-file-name local-copy))
(when (and (null remote-copy)
(tramp-get-method-parameter
method 'tramp-copy-keep-tmpfile))
;; We keep the local file for performance reasons,
;; useful for "rsync".
(setq tramp-temp-buffer-file-name local-copy))
;; We must ensure that `file-coding-system-alist'
;; matches `local-copy'. We must also use `visit',
;; otherwise there might be an error in the
;; `revert-buffer' function under XEmacs.
(let ((file-coding-system-alist
(tramp-find-file-name-coding-system-alist
filename local-copy)))
(setq result
(insert-file-contents
local-copy visit beg end replace)))))
;; We must ensure that `file-coding-system-alist'
;; matches `local-copy'. We must also use `visit',
;; otherwise there might be an error in the
;; `revert-buffer' function under XEmacs.
(let ((file-coding-system-alist
(tramp-find-file-name-coding-system-alist
filename local-copy)))
(setq result
(insert-file-contents
local-copy visit beg end replace))))
(error
(add-hook 'find-file-not-found-functions
`(lambda () (signal ',(car err) ',(cdr err)))
nil t)
(signal (car err) (cdr err))))))
;; Save exit.
(progn
(when visit
(setq buffer-file-name filename)
(setq buffer-read-only (not (file-writable-p filename)))
(set-visited-file-modtime)
(set-buffer-modified-p nil))
(when (and (stringp local-copy)
(or remote-copy (null tramp-temp-buffer-file-name)))
(delete-file local-copy))
(when (stringp remote-copy)
(delete-file
(tramp-make-tramp-file-name method user host remote-copy)))))))
;; Save exit.
(progn
(when visit
(setq buffer-file-name filename)
(setq buffer-read-only (not (file-writable-p filename)))
(set-visited-file-modtime)
(set-buffer-modified-p nil))
(when (and (stringp local-copy)
(or remote-copy (null tramp-temp-buffer-file-name)))
(delete-file local-copy))
(when (stringp remote-copy)
(delete-file
(tramp-make-tramp-file-name method user host remote-copy)))))
;; Result.
(list (expand-file-name filename)
(cadr result))))
;; Result.
(list (expand-file-name filename)
(cadr result)))))
(defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix)
"Like `load' for Tramp files."
@ -3609,15 +3612,19 @@ connection buffer."
This is needed in order to hide `last-coding-system-used', which is set
for process communication also."
(with-current-buffer (process-buffer proc)
(tramp-message proc 10 "%s %s" proc (process-status proc))
(let (buffer-read-only last-coding-system-used)
;; FIXME: If there is a gateway process, we need communication
;; between several processes. Too complicate to implement, so we
;; read output from all processes.
(let ((p (if (tramp-get-connection-property proc "gateway" nil) nil proc))
buffer-read-only last-coding-system-used)
;; Under Windows XP, accept-process-output doesn't return
;; sometimes. So we add an additional timeout.
(with-timeout ((or timeout 1))
(if (featurep 'xemacs)
(accept-process-output proc timeout timeout-msecs)
(accept-process-output proc timeout timeout-msecs (and proc t)))))
(tramp-message proc 10 "\n%s" (buffer-string))))
(accept-process-output p timeout timeout-msecs)
(accept-process-output p timeout timeout-msecs (and proc t))))
(tramp-message proc 10 "%s %s %s\n%s"
proc (process-status proc) p (buffer-string)))))
(defun tramp-check-for-regexp (proc regexp)
"Check, whether REGEXP is contained in process buffer of PROC.
@ -4184,25 +4191,27 @@ Invokes `password-read' if available, `read-passwd' else."
;; it's bound. `auth-source-user-or-password' is an
;; obsoleted function, it has been replaced by
;; `auth-source-search'.
(and (boundp 'auth-sources)
(tramp-get-connection-property
v "first-password-request" nil)
;; Try with Tramp's current method.
(if (fboundp 'auth-source-search)
(setq auth-info
(tramp-compat-funcall
'auth-source-search
:max 1
:user (or tramp-current-user t)
:host tramp-current-host
:port tramp-current-method)
auth-passwd (plist-get (nth 0 auth-info) :secret)
auth-passwd (if (functionp auth-passwd)
(funcall auth-passwd)
auth-passwd))
(tramp-compat-funcall
'auth-source-user-or-password
"password" tramp-current-host tramp-current-method)))
(ignore-errors
(and (boundp 'auth-sources)
(tramp-get-connection-property
v "first-password-request" nil)
;; Try with Tramp's current method.
(if (fboundp 'auth-source-search)
(setq auth-info
(tramp-compat-funcall
'auth-source-search
:max 1
:user (or tramp-current-user t)
:host tramp-current-host
:port tramp-current-method)
auth-passwd (plist-get
(nth 0 auth-info) :secret)
auth-passwd (if (functionp auth-passwd)
(funcall auth-passwd)
auth-passwd))
(tramp-compat-funcall
'auth-source-user-or-password
"password" tramp-current-host tramp-current-method))))
;; Try the password cache.
(when (functionp 'password-read)
(let ((password

View file

@ -63,19 +63,19 @@
;; with the same name as the link; then, if unsuccessful, ask the user if
;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
;; the user wishes to append 'tag' as a new toplevel heading at the end of
;; the buffer; and finally, defer to org's default behaviour which is to
;; the buffer; and finally, defer to org's default behavior which is to
;; search the entire text of the current buffer for 'tag'.
;;
;; This behaviour can be modified by changing the value of
;; This behavior can be modified by changing the value of
;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
;; .emacs, which describes the same behaviour as the above paragraph with
;; .emacs, which describes the same behavior as the above paragraph with
;; one difference:
;;
;; (setq org-ctags-open-link-functions
;; '(org-ctags-find-tag
;; org-ctags-ask-rebuild-tags-file-then-find-tag
;; org-ctags-ask-append-topic
;; org-ctags-fail-silently)) ; <-- prevents org default behaviour
;; org-ctags-fail-silently)) ; <-- prevents org default behavior
;;
;;
;; Usage

View file

@ -581,7 +581,7 @@ The function must accept two parameters:
The function should return the string to be exported.
For example, the variable could be set to the following function
in order to mimic default behaviour:
in order to mimic default behavior:
The default value simply returns the value of CONTENTS."
:group 'org-export-html

View file

@ -589,7 +589,7 @@ The function must accept six parameters:
The function should return the string to be exported.
For example, the variable could be set to the following function
in order to mimic default behaviour:
in order to mimic default behavior:
\(defun org-latex-format-inlinetask \(todo type priority name tags contents\)
\"Format an inline task element for LaTeX export.\"

View file

@ -228,7 +228,7 @@ If you create a site-map file, adjust the sorting like this:
`:sitemap-sort-files'
The site map is normally sorted alphabetically. You can
change this behaviour setting this to `anti-chronologically',
change this behavior setting this to `anti-chronologically',
`chronologically', or nil.
`:sitemap-ignore-case'

View file

@ -493,7 +493,7 @@ t Allow export of math snippets."
"The last level which is still exported as a headline.
Inferior levels will usually produce itemize or enumerate lists
when exported, but back-end behaviour may differ.
when exported, but back-end behavior may differ.
This option can also be set with the OPTIONS keyword,
e.g. \"H:2\"."
@ -1736,13 +1736,13 @@ Assume buffer is in Org mode. Narrowing, if any, is ignored."
(t
;; Options in `org-export-options-alist'.
(dolist (property (funcall find-properties key))
(let ((behaviour (nth 4 (assq property options))))
(let ((behavior (nth 4 (assq property options))))
(setq plist
(plist-put
plist property
;; Handle value depending on specified
;; BEHAVIOR.
(case behaviour
(case behavior
(space
(if (not (plist-get plist property))
(org-trim val)

View file

@ -227,10 +227,15 @@ Blank lines separate paragraphs. Semicolons start comments.
\\{emacs-lisp-mode-map}"
:group 'lisp
(defvar xref-find-function)
(defvar xref-identifier-completion-table-function)
(lisp-mode-variables nil nil 'elisp)
(setq imenu-case-fold-search nil)
(setq-local eldoc-documentation-function
#'elisp-eldoc-documentation-function)
(setq-local xref-find-function #'elisp-xref-find)
(setq-local xref-identifier-completion-table-function
#'elisp--xref-identifier-completion-table)
(add-hook 'completion-at-point-functions
#'elisp-completion-at-point nil 'local))
@ -413,6 +418,7 @@ It can be quoted, or be inside a quoted form."
(match-string 0 doc))))
(declare-function find-library-name "find-func" (library))
(declare-function find-function-library "find-func" (function &optional l-o v))
(defun elisp--company-location (str)
(let ((sym (intern-soft str)))
@ -467,11 +473,11 @@ It can be quoted, or be inside a quoted form."
:company-location #'elisp--company-location))
((elisp--form-quoted-p beg)
(list nil obarray
;; Don't include all symbols
;; (bug#16646).
;; Don't include all symbols (bug#16646).
:predicate (lambda (sym)
(or (boundp sym)
(fboundp sym)
(featurep sym)
(symbol-plist sym)))
:annotation-function
(lambda (str) (if (fboundp (intern-soft str)) " <f>"))
@ -548,6 +554,75 @@ It can be quoted, or be inside a quoted form."
(define-obsolete-function-alias
'lisp-completion-at-point 'elisp-completion-at-point "25.1")
;;; Xref backend
(declare-function xref-make-elisp-location "xref" (symbol type file))
(declare-function xref-make-bogus-location "xref" (message))
(declare-function xref-make "xref" (description location))
(defun elisp-xref-find (action id)
(require 'find-func)
(pcase action
(`definitions
(let ((sym (intern-soft id)))
(when sym
(elisp--xref-find-definitions sym))))
(`apropos
(elisp--xref-find-apropos id))))
(defun elisp--xref-identifier-file (type sym)
(pcase type
(`defun (when (fboundp sym)
(find-function-library sym)))
(`defvar (when (boundp sym)
(or (symbol-file sym 'defvar)
(help-C-file-name sym 'var))))
(`feature (when (featurep sym)
(ignore-errors
(find-library-name (symbol-name sym)))))
(`defface (when (facep sym)
(symbol-file sym 'defface)))))
(defun elisp--xref-find-definitions (symbol)
(save-excursion
(let (lst)
(dolist (type '(feature defface defvar defun))
(let ((loc
(condition-case err
(let ((file (elisp--xref-identifier-file type symbol)))
(when file
(when (string-match-p "\\.elc\\'" file)
(setq file (substring file 0 -1)))
(xref-make-elisp-location symbol type file)))
(error
(xref-make-bogus-location (error-message-string err))))))
(when loc
(push
(xref-make (format "(%s %s)" type symbol)
loc)
lst))))
lst)))
(defun elisp--xref-find-apropos (regexp)
(apply #'nconc
(let (lst)
(dolist (sym (apropos-internal regexp))
(push (elisp--xref-find-definitions sym) lst))
(nreverse lst))))
(defvar elisp--xref-identifier-completion-table
(apply-partially #'completion-table-with-predicate
obarray
(lambda (sym)
(or (boundp sym)
(fboundp sym)
(featurep sym)
(facep sym)))
'strict))
(defun elisp--xref-identifier-completion-table ()
elisp--xref-identifier-completion-table)
;;; Elisp Interaction mode
(defvar lisp-interaction-mode-map

View file

@ -28,6 +28,7 @@
(require 'ring)
(require 'button)
(require 'xref)
;;;###autoload
(defvar tags-file-name nil
@ -141,11 +142,8 @@ Otherwise, `find-tag-default' is used."
:group 'etags
:type '(choice (const nil) function))
(defcustom find-tag-marker-ring-length 16
"Length of marker rings `find-tag-marker-ring' and `tags-location-ring'."
:group 'etags
:type 'integer
:version "20.3")
(define-obsolete-variable-alias 'find-tag-marker-ring-length
'xref-marker-ring-length "25.1")
(defcustom tags-tag-face 'default
"Face for tags in the output of `tags-apropos'."
@ -182,15 +180,18 @@ Example value:
(sexp :tag "Tags to search")))
:version "21.1")
(defvar find-tag-marker-ring (make-ring find-tag-marker-ring-length)
"Ring of markers which are locations from which \\[find-tag] was invoked.")
(defvaralias 'find-tag-marker-ring 'xref--marker-ring)
(make-obsolete-variable
'find-tag-marker-ring
"use `xref-push-marker-stack' or `xref-pop-marker-stack' instead."
"25.1")
(defvar default-tags-table-function nil
"If non-nil, a function to choose a default tags file for a buffer.
This function receives no arguments and should return the default
tags table file to use for the current buffer.")
(defvar tags-location-ring (make-ring find-tag-marker-ring-length)
(defvar tags-location-ring (make-ring xref-marker-ring-length)
"Ring of markers which are locations visited by \\[find-tag].
Pop back to the last location with \\[negative-argument] \\[find-tag].")
@ -713,15 +714,13 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
(interactive)
;; Clear out the markers we are throwing away.
(let ((i 0))
(while (< i find-tag-marker-ring-length)
(while (< i xref-marker-ring-length)
(if (aref (cddr tags-location-ring) i)
(set-marker (aref (cddr tags-location-ring) i) nil))
(if (aref (cddr find-tag-marker-ring) i)
(set-marker (aref (cddr find-tag-marker-ring) i) nil))
(setq i (1+ i))))
(xref-clear-marker-stack)
(setq tags-file-name nil
tags-location-ring (make-ring find-tag-marker-ring-length)
find-tag-marker-ring (make-ring find-tag-marker-ring-length)
tags-location-ring (make-ring xref-marker-ring-length)
tags-table-list nil
tags-table-computed-list nil
tags-table-computed-list-for nil
@ -780,6 +779,7 @@ tags table and its (recursively) included tags tables."
(quit (message "Tags completion table construction aborted.")
(setq tags-completion-table nil)))))
;;;###autoload
(defun tags-lazy-completion-table ()
(let ((buf (current-buffer)))
(lambda (string pred action)
@ -898,7 +898,7 @@ See documentation of variable `tags-file-name'."
;; Run the user's hook. Do we really want to do this for pop?
(run-hooks 'local-find-tag-hook))))
;; Record whence we came.
(ring-insert find-tag-marker-ring (point-marker))
(xref-push-marker-stack)
(if (and next-p last-tag)
;; Find the same table we last used.
(visit-tags-table-buffer 'same)
@ -954,7 +954,6 @@ See documentation of variable `tags-file-name'."
(switch-to-buffer buf)
(error (pop-to-buffer buf)))
(goto-char pos)))
;;;###autoload (define-key esc-map "." 'find-tag)
;;;###autoload
(defun find-tag-other-window (tagname &optional next-p regexp-p)
@ -995,7 +994,6 @@ See documentation of variable `tags-file-name'."
;; the window's point from the buffer.
(set-window-point (selected-window) tagpoint))
window-point)))
;;;###autoload (define-key ctl-x-4-map "." 'find-tag-other-window)
;;;###autoload
(defun find-tag-other-frame (tagname &optional next-p)
@ -1020,7 +1018,6 @@ See documentation of variable `tags-file-name'."
(interactive (find-tag-interactive "Find tag other frame: "))
(let ((pop-up-frames t))
(find-tag-other-window tagname next-p)))
;;;###autoload (define-key ctl-x-5-map "." 'find-tag-other-frame)
;;;###autoload
(defun find-tag-regexp (regexp &optional next-p other-window)
@ -1044,25 +1041,10 @@ See documentation of variable `tags-file-name'."
;; We go through find-tag-other-window to do all the display hair there.
(funcall (if other-window 'find-tag-other-window 'find-tag)
regexp next-p t))
;;;###autoload (define-key esc-map [?\C-.] 'find-tag-regexp)
;;;###autoload (define-key esc-map "*" 'pop-tag-mark)
;;;###autoload
(defun pop-tag-mark ()
"Pop back to where \\[find-tag] was last invoked.
(defalias 'pop-tag-mark 'xref-pop-marker-stack)
This is distinct from invoking \\[find-tag] with a negative argument
since that pops a stack of markers at which tags were found, not from
where they were found."
(interactive)
(if (ring-empty-p find-tag-marker-ring)
(error "No previous locations for find-tag invocation"))
(let ((marker (ring-remove find-tag-marker-ring 0)))
(switch-to-buffer (or (marker-buffer marker)
(error "The marked buffer has been deleted")))
(goto-char (marker-position marker))
(set-marker marker nil nil)))
(defvar tag-lines-already-matched nil
"Matches remembered between calls.") ; Doc string: calls to what?
@ -1859,7 +1841,6 @@ nil, we exit; otherwise we scan the next file."
(and messaged
(null tags-loop-operate)
(message "Scanning file %s...found" buffer-file-name))))
;;;###autoload (define-key esc-map "," 'tags-loop-continue)
;;;###autoload
(defun tags-search (regexp &optional file-list-form)
@ -2077,6 +2058,54 @@ for \\[find-tag] (which see)."
(completion-in-region (car comp-data) (cadr comp-data)
(nth 2 comp-data)
(plist-get (nthcdr 3 comp-data) :predicate)))))
;;; Xref backend
;; Stop searching if we find more than xref-limit matches, as the xref
;; infrastructure is not designed to handle very long lists.
;; Switching to some kind of lazy list might be better, but hopefully
;; we hit the limit rarely.
(defconst etags--xref-limit 1000)
;;;###autoload
(defun etags-xref-find (action id)
(pcase action
(`definitions (etags--xref-find-definitions id))
(`apropos (etags--xref-find-definitions id t))))
(defun etags--xref-find-definitions (pattern &optional regexp?)
;; This emulates the behaviour of `find-tag-in-order' but instead of
;; returning one match at a time all matches are returned as list.
;; NOTE: find-tag-tag-order is typically a buffer-local variable.
(let* ((xrefs '())
(first-time t)
(search-fun (if regexp? #'re-search-forward #'search-forward))
(marks (make-hash-table :test 'equal))
(case-fold-search (if (memq tags-case-fold-search '(nil t))
tags-case-fold-search
case-fold-search)))
(save-excursion
(while (visit-tags-table-buffer (not first-time))
(setq first-time nil)
(dolist (order-fun (cond (regexp? find-tag-regexp-tag-order)
(t find-tag-tag-order)))
(goto-char (point-min))
(while (and (funcall search-fun pattern nil t)
(< (hash-table-count marks) etags--xref-limit))
(when (funcall order-fun pattern)
(beginning-of-line)
(cl-destructuring-bind (hint line &rest pos) (etags-snarf-tag)
(unless (eq hint t) ; hint==t if we are in a filename line
(let* ((file (file-of-tag))
(mark-key (cons file line)))
(unless (gethash mark-key marks)
(let ((loc (xref-make-file-location
(expand-file-name file) line 0)))
(push (xref-make hint loc) xrefs)
(puthash mark-key t marks)))))))))))
(nreverse xrefs)))
(provide 'etags)

View file

@ -1637,12 +1637,29 @@ This performs fontification according to `js--class-styles'."
js--font-lock-keywords-3)
"Font lock keywords for `js-mode'. See `font-lock-keywords'.")
(defconst js--syntax-propertize-regexp-syntax-table
(let ((st (make-char-table 'syntax-table (string-to-syntax "."))))
(modify-syntax-entry ?\[ "(]" st)
(modify-syntax-entry ?\] ")[" st)
(modify-syntax-entry ?\\ "\\" st)
st))
(defun js-syntax-propertize-regexp (end)
(when (eq (nth 3 (syntax-ppss)) ?/)
;; A /.../ regexp.
(when (re-search-forward "\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*/" end 'move)
(put-text-property (1- (point)) (point)
'syntax-table (string-to-syntax "\"/")))))
(let ((ppss (syntax-ppss)))
(when (eq (nth 3 ppss) ?/)
;; A /.../ regexp.
(while
(when (re-search-forward "\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*/"
end 'move)
(if (nth 1 (with-syntax-table
js--syntax-propertize-regexp-syntax-table
(let ((parse-sexp-lookup-properties nil))
(parse-partial-sexp (nth 8 ppss) (point)))))
;; A / within a character class is not the end of a regexp.
t
(put-text-property (1- (point)) (point)
'syntax-table (string-to-syntax "\"/"))
nil))))))
(defun js-syntax-propertize (start end)
;; Javascript allows immediate regular expression objects, written /.../.
@ -1656,7 +1673,7 @@ This performs fontification according to `js--class-styles'."
;; We can probably just add +, -, !, <, >, %, ^, ~, |, &, ?, : at which
;; point I think only * and / would be missing which could also be added,
;; but need care to avoid affecting the // and */ comment markers.
("\\(?:^\\|[=([{,:;]\\)\\(?:[ \t]\\)*\\(/\\)[^/*]"
("\\(?:^\\|[=([{,:;]\\|\\_<return\\_>\\)\\(?:[ \t]\\)*\\(/\\)[^/*]"
(1 (ignore
(forward-char -1)
(when (or (not (memq (char-after (match-beginning 0)) '(?\s ?\t)))

View file

@ -69,7 +69,7 @@
;; Besides that only the standard CPython (2.x and 3.x) shell and
;; IPython are officially supported out of the box, the interaction
;; should support any other readline based Python shells as well
;; (e.g. Jython and Pypy have been reported to work). You can change
;; (e.g. Jython and PyPy have been reported to work). You can change
;; your default interpreter and commandline arguments by setting the
;; `python-shell-interpreter' and `python-shell-interpreter-args'
;; variables. This example enables IPython globally:
@ -119,18 +119,24 @@
;; modify its behavior.
;; Shell completion: hitting tab will try to complete the current
;; word. Shell completion is implemented in such way that if you
;; change the `python-shell-interpreter' it should be possible to
;; integrate custom logic to calculate completions. To achieve this
;; you just need to set `python-shell-completion-setup-code' and
;; `python-shell-completion-string-code'. The default provided code,
;; enables autocompletion for both CPython and IPython (and ideally
;; any readline based Python shell). This code depends on the
;; readline module, so if you are using some Operating System that
;; bundles Python without it (like Windows), installing pyreadline
;; from URL `http://ipython.scipy.org/moin/PyReadline/Intro' should
;; suffice. To troubleshoot why you are not getting any completions
;; you can try the following in your Python shell:
;; word. The two built-in mechanisms depend on Python's readline
;; module: the "native" completion is tried first and is activated
;; when `python-shell-completion-native-enable' is non-nil, the
;; current `python-shell-interpreter' is not a member of the
;; `python-shell-completion-native-disabled-interpreters' variable and
;; `python-shell-completion-native-setup' succeeds; the "fallback" or
;; "legacy" mechanism works by executing Python code in the background
;; and enables auto-completion for shells that do not support
;; receiving escape sequences (with some limitations, i.e. completion
;; in blocks does not work). The code executed for the "fallback"
;; completion can be found in `python-shell-completion-setup-code' and
;; `python-shell-completion-string-code' variables. Their default
;; values enable completion for both CPython and IPython, and probably
;; any readline based shell (it's known to work with PyPy). If your
;; Python installation lacks readline (like CPython for Windows),
;; installing pyreadline (URL `http://ipython.org/pyreadline.html')
;; should suffice. To troubleshoot why you are not getting any
;; completions, you can try the following in your Python shell:
;; >>> import readline, rlcompleter
@ -256,6 +262,7 @@
(defvar outline-heading-end-regexp)
(autoload 'comint-mode "comint")
(autoload 'help-function-arglist "help-fns")
;;;###autoload
(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode))
@ -395,7 +402,18 @@
(* ?\\ ?\\) (any ?\' ?\")))
(* ?\\ ?\\)
;; Match single or triple quotes of any kind.
(group (or "\"" "\"\"\"" "'" "'''"))))))
(group (or "\"" "\"\"\"" "'" "'''")))))
(coding-cookie . ,(rx line-start ?# (* space)
(or
;; # coding=<encoding name>
(: "coding" (or ?: ?=) (* space) (group-n 1 (+ (or word ?-))))
;; # -*- coding: <encoding name> -*-
(: "-*-" (* space) "coding:" (* space)
(group-n 1 (+ (or word ?-))) (* space) "-*-")
;; # vim: set fileencoding=<encoding name> :
(: "vim:" (* space) "set" (+ space)
"fileencoding" (* space) ?= (* space)
(group-n 1 (+ (or word ?-))) (* space) ":")))))
"Additional Python specific sexps for `python-rx'")
(defmacro python-rx (&rest regexps)
@ -1206,12 +1224,18 @@ the line will be re-indented automatically if needed."
(eolp)
;; Avoid re-indenting on extra colon
(not (equal ?: (char-before (1- (point)))))
(not (python-syntax-comment-or-string-p))
;; Never re-indent at beginning of defun
(not (save-excursion
(python-nav-beginning-of-statement)
(python-info-looking-at-beginning-of-defun))))
(python-indent-line)))))
(not (python-syntax-comment-or-string-p)))
;; Just re-indent dedenters
(let ((dedenter-pos (python-info-dedenter-statement-p))
(current-pos (point)))
(when dedenter-pos
(save-excursion
(goto-char dedenter-pos)
(python-indent-line)
(unless (= (line-number-at-pos dedenter-pos)
(line-number-at-pos current-pos))
;; Reindent region if this is a multiline statement
(python-indent-region dedenter-pos current-pos)))))))))
;;; Navigation
@ -2087,36 +2111,18 @@ and `python-shell-output-prompt-regexp' using the values from
(defun python-shell-get-process-name (dedicated)
"Calculate the appropriate process name for inferior Python process.
If DEDICATED is t and the variable `buffer-file-name' is non-nil
returns a string with the form
`python-shell-buffer-name'[variable `buffer-file-name'] else
returns the value of `python-shell-buffer-name'."
(let ((process-name
(if (and dedicated
buffer-file-name)
(format "%s[%s]" python-shell-buffer-name buffer-file-name)
(format "%s" python-shell-buffer-name))))
process-name))
If DEDICATED is t returns a string with the form
`python-shell-buffer-name'[`buffer-name'] else returns the value
of `python-shell-buffer-name'."
(if dedicated
(format "%s[%s]" python-shell-buffer-name (buffer-name))
python-shell-buffer-name))
(defun python-shell-internal-get-process-name ()
"Calculate the appropriate process name for Internal Python process.
The name is calculated from `python-shell-global-buffer-name' and
a hash of all relevant global shell settings in order to ensure
uniqueness for different types of configurations."
(format "%s [%s]"
python-shell-internal-buffer-name
(md5
(concat
python-shell-interpreter
python-shell-interpreter-args
python-shell--prompt-calculated-input-regexp
python-shell--prompt-calculated-output-regexp
(mapconcat #'symbol-value python-shell-setup-codes "")
(mapconcat #'identity python-shell-process-environment "")
(mapconcat #'identity python-shell-extra-pythonpaths "")
(mapconcat #'identity python-shell-exec-path "")
(or python-shell-virtualenv-root "")
(mapconcat #'identity python-shell-exec-path "")))))
the `buffer-name'."
(format "%s[%s]" python-shell-internal-buffer-name (buffer-name)))
(defun python-shell-calculate-command ()
"Calculate the string used to execute the inferior Python process."
@ -2256,11 +2262,9 @@ Avoids `recenter' calls until OUTPUT is completely sent."
"Execute the forms in BODY with the shell buffer temporarily current.
Signals an error if no shell buffer is available for current buffer."
(declare (indent 0) (debug t))
(let ((shell-buffer (make-symbol "shell-buffer")))
`(let ((,shell-buffer (python-shell-get-buffer)))
(when (not ,shell-buffer)
(error "No inferior Python buffer available."))
(with-current-buffer ,shell-buffer
(let ((shell-process (make-symbol "shell-process")))
`(let ((,shell-process (python-shell-get-process-or-error)))
(with-current-buffer (process-buffer ,shell-process)
,@body))))
(defvar python-shell--font-lock-buffer nil)
@ -2472,12 +2476,12 @@ variable.
(python-shell-accept-process-output
(get-buffer-process (current-buffer))))
(defun python-shell-make-comint (cmd proc-name &optional pop internal)
(defun python-shell-make-comint (cmd proc-name &optional show internal)
"Create a Python shell comint buffer.
CMD is the Python command to be executed and PROC-NAME is the
process name the comint buffer will get. After the comint buffer
is created the `inferior-python-mode' is activated. When
optional argument POP is non-nil the buffer is shown. When
optional argument SHOW is non-nil the buffer is shown. When
optional argument INTERNAL is non-nil this process is run on a
buffer with a name that starts with a space, following the Emacs
convention for temporary/internal buffers, and also makes sure
@ -2506,16 +2510,13 @@ killed."
(mapconcat #'identity args " ")))
(with-current-buffer buffer
(inferior-python-mode))
(and pop (pop-to-buffer buffer t))
(when show (display-buffer buffer))
(and internal (set-process-query-on-exit-flag process nil))))
proc-buffer-name)))
;;;###autoload
(defun run-python (&optional cmd dedicated show)
"Run an inferior Python process.
Input and output via buffer named after
`python-shell-buffer-name'. If there is a process already
running in that buffer, just switch to it.
Argument CMD defaults to `python-shell-calculate-command' return
value. When called interactively with `prefix-arg', it allows
@ -2523,6 +2524,11 @@ the user to edit such value and choose whether the interpreter
should be DEDICATED for the current buffer. When numeric prefix
arg is other than 0 or 4 do not SHOW.
For a given buffer and same values of DEDICATED, if a process is
already running for it, it will do nothing. This means that if
the current buffer is using a global process, the user is still
able to switch it to use a dedicated one.
Runs the hook `inferior-python-mode-hook' after
`comint-mode-hook' is run. (Type \\[describe-mode] in the
process buffer for a list of commands.)"
@ -2533,10 +2539,10 @@ process buffer for a list of commands.)"
(y-or-n-p "Make dedicated process? ")
(= (prefix-numeric-value current-prefix-arg) 4))
(list (python-shell-calculate-command) nil t)))
(python-shell-make-comint
(or cmd (python-shell-calculate-command))
(python-shell-get-process-name dedicated) show)
dedicated)
(get-buffer-process
(python-shell-make-comint
(or cmd (python-shell-calculate-command))
(python-shell-get-process-name dedicated) show)))
(defun run-python-internal ()
"Run an inferior Internal Python process.
@ -2579,6 +2585,21 @@ If current buffer is in `inferior-python-mode', return it."
"Return inferior Python process for current buffer."
(get-buffer-process (python-shell-get-buffer)))
(defun python-shell-get-process-or-error (&optional interactivep)
"Return inferior Python process for current buffer or signal error.
When argument INTERACTIVEP is non-nil, use `user-error' instead
of `error' with a user-friendly message."
(or (python-shell-get-process)
(if interactivep
(user-error
"Start a Python process first with `M-x run-python' or `%s'."
;; Get the binding.
(key-description
(where-is-internal
#'run-python overriding-local-map t)))
(error
"No inferior Python process running."))))
(defun python-shell-get-or-create-process (&optional cmd dedicated show)
"Get or create an inferior Python process for current buffer and return it.
Arguments CMD, DEDICATED and SHOW are those of `run-python' and
@ -2594,6 +2615,11 @@ be asked for their values."
(run-python cmd dedicated show)))
(or shell-process (python-shell-get-process))))
(make-obsolete
#'python-shell-get-or-create-process
"Instead call `python-shell-get-process' and create one if returns nil."
"25.1")
(defvar python-shell-internal-buffer nil
"Current internal shell buffer for the current buffer.
This is really not necessary at all for the code to work but it's
@ -2606,12 +2632,10 @@ there for compatibility with CEDET.")
(defun python-shell-internal-get-or-create-process ()
"Get or create an inferior Internal Python process."
(let* ((proc-name (python-shell-internal-get-process-name))
(proc-buffer-name (format " *%s*" proc-name)))
(when (not (process-live-p proc-name))
(run-python-internal)
(setq python-shell-internal-buffer proc-buffer-name))
(get-buffer-process proc-buffer-name)))
(let ((proc-name (python-shell-internal-get-process-name)))
(if (process-live-p proc-name)
(get-process proc-name)
(run-python-internal))))
(define-obsolete-function-alias
'python-proc 'python-shell-internal-get-or-create-process "24.3")
@ -2628,20 +2652,24 @@ there for compatibility with CEDET.")
(concat (file-remote-p default-directory) "/tmp")
temporary-file-directory))
(temp-file-name (make-temp-file "py"))
(coding-system-for-write 'utf-8))
(coding-system-for-write (python-info-encoding)))
(with-temp-file temp-file-name
(insert "# -*- coding: utf-8 -*-\n") ;Not needed for Python-3.
(insert string)
(delete-trailing-whitespace))
temp-file-name))
(defun python-shell-send-string (string &optional process)
"Send STRING to inferior Python PROCESS."
(interactive "sPython command: ")
(let ((process (or process (python-shell-get-or-create-process))))
(defun python-shell-send-string (string &optional process msg)
"Send STRING to inferior Python PROCESS.
When optional argument MSG is non-nil, forces display of a
user-friendly message if there's no process running; defaults to
t when called interactively."
(interactive
(list (read-string "Python command: ") nil t))
(let ((process (or process (python-shell-get-process-or-error msg))))
(if (string-match ".\n+." string) ;Multiline.
(let* ((temp-file-name (python-shell--save-temp-file string)))
(python-shell-send-file temp-file-name process temp-file-name t))
(let* ((temp-file-name (python-shell--save-temp-file string))
(file-name (or (buffer-file-name) temp-file-name)))
(python-shell-send-file file-name process temp-file-name t))
(comint-send-string process string)
(when (or (not (string-match "\n\\'" string))
(string-match "\n[ \t].*\n?\\'" string))
@ -2680,7 +2708,7 @@ detecting a prompt at the end of the buffer."
(defun python-shell-send-string-no-output (string &optional process)
"Send STRING to PROCESS and inhibit output.
Return the output."
(let ((process (or process (python-shell-get-or-create-process)))
(let ((process (or process (python-shell-get-process-or-error)))
(comint-preoutput-filter-functions
'(python-shell-output-filter))
(python-shell-output-filter-in-progress t)
@ -2717,12 +2745,6 @@ Returns the output. See `python-shell-send-string-no-output'."
(define-obsolete-function-alias
'python-send-string 'python-shell-internal-send-string "24.3")
(defvar python--use-fake-loc nil
"If non-nil, use `compilation-fake-loc' to trace errors back to the buffer.
If nil, regions of text are prepended by the corresponding number of empty
lines and Python is told to output error messages referring to the whole
source file.")
(defun python-shell-buffer-substring (start end &optional nomain)
"Send buffer substring from START to END formatted for shell.
This is a wrapper over `buffer-substring' that takes care of
@ -2732,27 +2754,32 @@ the python shell:
\"if __name__ == '__main__'\" block will be removed.
2. When a subregion of the buffer is sent, it takes care of
appending extra empty lines so tracebacks are correct.
3. Wraps indented regions under an \"if True:\" block so the
3. When the region sent is a substring of the current buffer, a
coding cookie is added.
4. Wraps indented regions under an \"if True:\" block so the
interpreter evaluates them correctly."
(let ((substring (buffer-substring-no-properties start end))
(fillstr (unless python--use-fake-loc
(make-string (1- (line-number-at-pos start)) ?\n)))
(toplevel-block-p (save-excursion
(goto-char start)
(or (zerop (line-number-at-pos start))
(progn
(python-util-forward-comment 1)
(zerop (current-indentation)))))))
(let* ((substring (buffer-substring-no-properties start end))
(starts-at-point-min-p (save-restriction
(widen)
(= (point-min) start)))
(encoding (python-info-encoding))
(fillstr (when (not starts-at-point-min-p)
(concat
(format "# -*- coding: %s -*-\n" encoding)
(make-string
;; Substract 2 because of the coding cookie.
(- (line-number-at-pos start) 2) ?\n))))
(toplevel-block-p (save-excursion
(goto-char start)
(or (zerop (line-number-at-pos start))
(progn
(python-util-forward-comment 1)
(zerop (current-indentation)))))))
(with-temp-buffer
(python-mode)
(if fillstr (insert fillstr))
(insert substring)
(goto-char (point-min))
(unless python--use-fake-loc
;; python-shell--save-temp-file adds an extra coding line, which would
;; throw off the line-counts, so let's try to compensate here.
(if (looking-at "[ \t]*[#\n]")
(delete-region (point) (line-beginning-position 2))))
(when (not toplevel-block-p)
(insert "if True:")
(delete-region (point) (line-end-position)))
@ -2763,53 +2790,65 @@ the python shell:
(when (python-nav-if-name-main)
(cons (point)
(progn (python-nav-forward-sexp-safe)
;; Include ending newline
(forward-line 1)
(point)))))))
;; Oh destructuring bind, how I miss you.
(if-name-main-start (car if-name-main-start-end))
(if-name-main-end (cdr if-name-main-start-end)))
(if-name-main-end (cdr if-name-main-start-end))
(fillstr (make-string
(- (line-number-at-pos if-name-main-end)
(line-number-at-pos if-name-main-start)) ?\n)))
(when if-name-main-start-end
(goto-char if-name-main-start)
(delete-region if-name-main-start if-name-main-end)
(insert
(make-string
(- (line-number-at-pos if-name-main-end)
(line-number-at-pos if-name-main-start)) ?\n)))))
(insert fillstr))))
;; Ensure there's only one coding cookie in the generated string.
(goto-char (point-min))
(when (looking-at-p (python-rx coding-cookie))
(forward-line 1)
(when (looking-at-p (python-rx coding-cookie))
(delete-region
(line-beginning-position) (line-end-position))))
(buffer-substring-no-properties (point-min) (point-max)))))
(declare-function compilation-fake-loc "compile"
(marker file &optional line col))
(defun python-shell-send-region (start end &optional send-main msg)
"Send the region delimited by START and END to inferior Python process.
When optional argument SEND-MAIN is non-nil, allow execution of
code inside blocks delimited by \"if __name__== '__main__':\".
When called interactively SEND-MAIN defaults to nil, unless it's
called with prefix argument. When optional argument MSG is
non-nil, forces display of a user-friendly message if there's no
process running; defaults to t when called interactively."
(interactive
(list (region-beginning) (region-end) current-prefix-arg t))
(let* ((string (python-shell-buffer-substring start end (not send-main)))
(process (python-shell-get-process-or-error msg))
(original-string (buffer-substring-no-properties start end))
(_ (string-match "\\`\n*\\(.*\\)" original-string)))
(message "Sent: %s..." (match-string 1 original-string))
(python-shell-send-string string process)))
(defun python-shell-send-region (start end &optional nomain)
"Send the region delimited by START and END to inferior Python process."
(interactive "r")
(let* ((python--use-fake-loc
(or python--use-fake-loc (not buffer-file-name)))
(string (python-shell-buffer-substring start end nomain))
(process (python-shell-get-or-create-process))
(_ (string-match "\\`\n*\\(.*\\)" string)))
(message "Sent: %s..." (match-string 1 string))
(let* ((temp-file-name (python-shell--save-temp-file string))
(file-name (or (buffer-file-name) temp-file-name)))
(python-shell-send-file file-name process temp-file-name t)
(unless python--use-fake-loc
(with-current-buffer (process-buffer process)
(compilation-fake-loc (copy-marker start) temp-file-name
2)) ;; Not 1, because of the added coding line.
))))
(defun python-shell-send-buffer (&optional arg)
(defun python-shell-send-buffer (&optional send-main msg)
"Send the entire buffer to inferior Python process.
With prefix ARG allow execution of code inside blocks delimited
by \"if __name__== '__main__':\"."
(interactive "P")
When optional argument SEND-MAIN is non-nil, allow execution of
code inside blocks delimited by \"if __name__== '__main__':\".
When called interactively SEND-MAIN defaults to nil, unless it's
called with prefix argument. When optional argument MSG is
non-nil, forces display of a user-friendly message if there's no
process running; defaults to t when called interactively."
(interactive (list current-prefix-arg t))
(save-restriction
(widen)
(python-shell-send-region (point-min) (point-max) (not arg))))
(python-shell-send-region (point-min) (point-max) send-main msg)))
(defun python-shell-send-defun (arg)
(defun python-shell-send-defun (&optional arg msg)
"Send the current defun to inferior Python process.
When argument ARG is non-nil do not include decorators."
(interactive "P")
When argument ARG is non-nil do not include decorators. When
optional argument MSG is non-nil, forces display of a
user-friendly message if there's no process running; defaults to
t when called interactively."
(interactive (list current-prefix-arg t))
(save-excursion
(python-shell-send-region
(progn
@ -2825,42 +2864,60 @@ When argument ARG is non-nil do not include decorators."
(progn
(or (python-nav-end-of-defun)
(end-of-line 1))
(point-marker)))))
(point-marker))
nil ;; noop
msg)))
(defun python-shell-send-file (file-name &optional process temp-file-name
delete)
delete msg)
"Send FILE-NAME to inferior Python PROCESS.
If TEMP-FILE-NAME is passed then that file is used for processing
instead, while internally the shell will continue to use FILE-NAME.
If DELETE is non-nil, delete the file afterwards."
(interactive "fFile to send: ")
(let* ((process (or process (python-shell-get-or-create-process)))
instead, while internally the shell will continue to use
FILE-NAME. If TEMP-FILE-NAME and DELETE are non-nil, then
TEMP-FILE-NAME is deleted after evaluation is performed. When
optional argument MSG is non-nil, forces display of a
user-friendly message if there's no process running; defaults to
t when called interactively."
(interactive
(list
(read-file-name "File to send: ") ; file-name
nil ; process
nil ; temp-file-name
nil ; delete
t)) ; msg
(let* ((process (or process (python-shell-get-process-or-error msg)))
(encoding (with-temp-buffer
(insert-file-contents
(or temp-file-name file-name))
(python-info-encoding)))
(file-name (expand-file-name
(or (file-remote-p file-name 'localname)
file-name)))
(temp-file-name (when temp-file-name
(expand-file-name
(or (file-remote-p temp-file-name 'localname)
temp-file-name))))
(file-name (or (when file-name
(expand-file-name
(or (file-remote-p file-name 'localname)
file-name)))
temp-file-name)))
(when (not file-name)
(error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil"))
temp-file-name)))))
(python-shell-send-string
(format
(concat "__pyfile = open('''%s''');"
"exec(compile(__pyfile.read(), '''%s''', 'exec'));"
"__pyfile.close()%s")
(or temp-file-name file-name) file-name
(if delete (format "; import os; os.remove('''%s''')"
(or temp-file-name file-name))
""))
(concat
"import codecs, os;"
"__pyfile = codecs.open('''%s''', encoding='''%s''');"
"__code = __pyfile.read().encode('''%s''');"
"__pyfile.close();"
(when (and delete temp-file-name)
(format "os.remove('''%s''');" temp-file-name))
"exec(compile(__code, '''%s''', 'exec'));")
(or temp-file-name file-name) encoding encoding file-name)
process)))
(defun python-shell-switch-to-shell ()
"Switch to inferior Python process buffer."
(interactive)
(process-buffer (python-shell-get-or-create-process)) t)
(defun python-shell-switch-to-shell (&optional msg)
"Switch to inferior Python process buffer.
When optional argument MSG is non-nil, forces display of a
user-friendly message if there's no process running; defaults to
t when called interactively."
(interactive "p")
(pop-to-buffer
(process-buffer (python-shell-get-process-or-error msg)) nil t))
(defun python-shell-send-setup-code ()
"Send all setup code for shell.
@ -2947,6 +3004,194 @@ the full statement in the case of imports."
"25.1"
"Completion string code must work for (i)pdb.")
(defcustom python-shell-completion-native-disabled-interpreters
;; PyPy's readline cannot handle some escape sequences yet.
(list "pypy")
"List of disabled interpreters.
When a match is found, native completion is disabled."
:type '(repeat string))
(defcustom python-shell-completion-native-enable t
"Enable readline based native completion."
:type 'boolean)
(defcustom python-shell-completion-native-output-timeout 0.01
"Time in seconds to wait for completion output before giving up."
:type 'float)
(defvar python-shell-completion-native-redirect-buffer
" *Python completions redirect*"
"Buffer to be used to redirect output of readline commands.")
(defun python-shell-completion-native-interpreter-disabled-p ()
"Return non-nil if interpreter has native completion disabled."
(when python-shell-completion-native-disabled-interpreters
(string-match
(regexp-opt python-shell-completion-native-disabled-interpreters)
(file-name-nondirectory python-shell-interpreter))))
(defun python-shell-completion-native-try ()
"Return non-nil if can trigger native completion."
(let ((python-shell-completion-native-enable t))
(python-shell-completion-native-get-completions
(get-buffer-process (current-buffer))
nil "int")))
(defun python-shell-completion-native-setup ()
"Try to setup native completion, return non-nil on success."
(let ((process (python-shell-get-process)))
(python-shell-send-string
(funcall
'mapconcat
#'identity
(list
"try:"
" import readline, rlcompleter"
;; Remove parens on callables as it breaks completion on
;; arguments (e.g. str(Ari<tab>)).
" class Completer(rlcompleter.Completer):"
" def _callable_postfix(self, val, word):"
" return word"
" readline.set_completer(Completer().complete)"
" if readline.__doc__ and 'libedit' in readline.__doc__:"
" readline.parse_and_bind('bind ^I rl_complete')"
" else:"
" readline.parse_and_bind('tab: complete')"
" print ('python.el: readline is available')"
"except:"
" print ('python.el: readline not available')")
"\n")
process)
(python-shell-accept-process-output process)
(when (save-excursion
(re-search-backward
(regexp-quote "python.el: readline is available") nil t 1))
(python-shell-completion-native-try))))
(defun python-shell-completion-native-turn-off (&optional msg)
"Turn off shell native completions.
With argument MSG show deactivation message."
(interactive "p")
(python-shell-with-shell-buffer
(set (make-local-variable 'python-shell-completion-native-enable) nil)
(when msg
(message "Shell native completion is disabled, using fallback"))))
(defun python-shell-completion-native-turn-on (&optional msg)
"Turn on shell native completions.
With argument MSG show deactivation message."
(interactive "p")
(python-shell-with-shell-buffer
(set (make-local-variable 'python-shell-completion-native-enable) t)
(python-shell-completion-native-turn-on-maybe msg)))
(defun python-shell-completion-native-turn-on-maybe (&optional msg)
"Turn on native completions if enabled and available.
With argument MSG show activation/deactivation message."
(interactive "p")
(python-shell-with-shell-buffer
(when python-shell-completion-native-enable
(cond
((python-shell-completion-native-interpreter-disabled-p)
(python-shell-completion-native-turn-off msg))
((python-shell-completion-native-setup)
(when msg
(message "Shell native completion is enabled.")))
(t (lwarn
'(python python-shell-completion-native-turn-on-maybe)
:warning
(concat
"Your `python-shell-interpreter' doesn't seem to "
"support readline, yet `python-shell-completion-native' "
(format "was `t' and %S is not part of the "
(file-name-nondirectory python-shell-interpreter))
"`python-shell-completion-native-disabled-interpreters' "
"list. Native completions have been disabled locally. "))
(python-shell-completion-native-turn-off msg))))))
(defun python-shell-completion-native-turn-on-maybe-with-msg ()
"Like `python-shell-completion-native-turn-on-maybe' but force messages."
(python-shell-completion-native-turn-on-maybe t))
(add-hook 'inferior-python-mode-hook
#'python-shell-completion-native-turn-on-maybe-with-msg)
(defun python-shell-completion-native-toggle (&optional msg)
"Toggle shell native completion.
With argument MSG show activation/deactivation message."
(interactive "p")
(python-shell-with-shell-buffer
(if python-shell-completion-native-enable
(python-shell-completion-native-turn-off msg)
(python-shell-completion-native-turn-on msg))
python-shell-completion-native-enable))
(defun python-shell-completion-native-get-completions (process import input)
"Get completions using native readline for PROCESS.
When IMPORT is non-nil takes precedence over INPUT for
completion."
(when (and python-shell-completion-native-enable
(python-util-comint-last-prompt)
(>= (point) (cdr (python-util-comint-last-prompt))))
(let* ((input (or import input))
(original-filter-fn (process-filter process))
(redirect-buffer (get-buffer-create
python-shell-completion-native-redirect-buffer))
(separators (python-rx
(or whitespace open-paren close-paren)))
(trigger "\t\t\t")
(new-input (concat input trigger))
(input-length
(save-excursion
(+ (- (point-max) (comint-bol)) (length new-input))))
(delete-line-command (make-string input-length ?\b))
(input-to-send (concat new-input delete-line-command)))
;; Ensure restoring the process filter, even if the user quits
;; or there's some other error.
(unwind-protect
(with-current-buffer redirect-buffer
;; Cleanup the redirect buffer
(delete-region (point-min) (point-max))
;; Mimic `comint-redirect-send-command', unfortunately it
;; can't be used here because it expects a newline in the
;; command and that's exactly what we are trying to avoid.
(let ((comint-redirect-echo-input nil)
(comint-redirect-verbose nil)
(comint-redirect-perform-sanity-check nil)
(comint-redirect-insert-matching-regexp nil)
;; Feed it some regex that will never match.
(comint-redirect-finished-regexp "^\\'$")
(comint-redirect-output-buffer redirect-buffer))
;; Compatibility with Emacs 24.x. Comint changed and
;; now `comint-redirect-filter' gets 3 args. This
;; checks which version of `comint-redirect-filter' is
;; in use based on its args and uses `apply-partially'
;; to make it up for the 3 args case.
(if (= (length
(help-function-arglist 'comint-redirect-filter)) 3)
(set-process-filter
process (apply-partially
#'comint-redirect-filter original-filter-fn))
(set-process-filter process #'comint-redirect-filter))
(process-send-string process input-to-send)
(accept-process-output
process
python-shell-completion-native-output-timeout)
;; XXX: can't use `python-shell-accept-process-output'
;; here because there are no guarantees on how output
;; ends. The workaround here is to call
;; `accept-process-output' until we don't find anything
;; else to accept.
(while (accept-process-output
process
python-shell-completion-native-output-timeout))
(cl-remove-duplicates
(split-string
(buffer-substring-no-properties
(point-min) (point-max))
separators t))))
(set-process-filter process original-filter-fn)))))
(defun python-shell-completion-get-completions (process import input)
"Do completion at point using PROCESS for IMPORT or INPUT.
When IMPORT is non-nil takes precedence over INPUT for
@ -3004,11 +3249,15 @@ using that one instead of current buffer's process."
last-prompt-end
(forward-char (length (match-string-no-properties 0)))
(point))))
(end (point)))
(end (point))
(completion-fn
(if python-shell-completion-native-enable
#'python-shell-completion-native-get-completions
#'python-shell-completion-get-completions)))
(list start end
(completion-table-dynamic
(apply-partially
#'python-shell-completion-get-completions
completion-fn
process import-statement)))))
(define-obsolete-function-alias
@ -4155,6 +4404,32 @@ operator."
(* whitespace) line-end))
(string-equal "" (match-string-no-properties 1))))
(defun python-info-encoding-from-cookie ()
"Detect current buffer's encoding from its coding cookie.
Returns the enconding as a symbol."
(let ((first-two-lines
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(forward-line 2)
(buffer-substring-no-properties
(point)
(point-min))))))
(when (string-match (python-rx coding-cookie) first-two-lines)
(intern (match-string-no-properties 1 first-two-lines)))))
(defun python-info-encoding ()
"Return encoding for file.
Try `python-info-encoding-from-cookie', if none is found then
default to utf-8."
;; If no enconding is defined, then it's safe to use UTF-8: Python 2
;; uses ASCII as default while Python 3 uses UTF-8. This means that
;; in the worst case escenario python.el will make things work for
;; Python 2 files with unicode data and no encoding defined.
(or (python-info-encoding-from-cookie)
'utf-8))
;;; Utility functions

View file

@ -2374,7 +2374,7 @@ Calls the value of `sh-set-shell-hook' if set."
(sh-make-vars-local))
(message "Indentation setup for shell type %s" sh-shell))
(message "No indentation for this shell type.")
(setq indent-line-function 'sh-basic-indent-line))
(setq-local indent-line-function 'sh-basic-indent-line))
(when font-lock-mode
(setq font-lock-set-defaults nil)
(font-lock-set-defaults)

524
lisp/progmodes/xref.el Normal file
View file

@ -0,0 +1,524 @@
;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
;; Copyright (C) 2014 Free Software Foundation, Inc.
;; 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:
;; This file provides a somewhat generic infrastructure for cross
;; referencing commands, in particular "find-definition".
;;
;; Some part of the functionality must be implemented in a language
;; dependent way and that's done by defining `xref-find-function',
;; `xref-identifier-at-point-function' and
;; `xref-identifier-completion-table-function', which see.
;;
;; A major mode should make these variables buffer-local first.
;;
;; `xref-find-function' can be called in several ways, see its
;; description. It has to operate with "xref" and "location" values.
;;
;; One would usually call `make-xref' and `xref-make-file-location',
;; `xref-make-buffer-location' or `xref-make-bogus-location' to create
;; them.
;;
;; Each identifier must be represented as a string. Implementers can
;; use string properties to store additional information about the
;; identifier, but they should keep in mind that values returned from
;; `xref-identifier-completion-table-function' should still be
;; distinct, because the user can't see the properties when making the
;; choice.
;;
;; See the functions `etags-xref-find' and `elisp-xref-find' for full
;; examples.
;;; Code:
(require 'cl-lib)
(require 'eieio)
(require 'ring)
(defgroup xref nil "Cross-referencing commands"
:group 'tools)
;;; Locations
(defclass xref-location () ()
:documentation "A location represents a position in a file or buffer.")
;; If a backend decides to subclass xref-location it can provide
;; methods for some of the following functions:
(defgeneric xref-location-marker (location)
"Return the marker for LOCATION.")
(defgeneric xref-location-group (location)
"Return a string used to group a set of locations.
This is typically the filename.")
;;;; Commonly needed location classes are defined here:
;; FIXME: might be useful to have an optional "hint" i.e. a string to
;; search for in case the line number is sightly out of date.
(defclass xref-file-location (xref-location)
((file :type string :initarg :file)
(line :type fixnum :initarg :line)
(column :type fixnum :initarg :column))
:documentation "A file location is a file/line/column triple.
Line numbers start from 1 and columns from 0.")
(defun xref-make-file-location (file line column)
"Create and return a new xref-file-location."
(make-instance 'xref-file-location :file file :line line :column column))
(defmethod xref-location-marker ((l xref-file-location))
(with-slots (file line column) l
(with-current-buffer
(or (get-file-buffer file)
(let ((find-file-suppress-same-file-warnings t))
(find-file-noselect file)))
(save-restriction
(widen)
(save-excursion
(goto-char (point-min))
(beginning-of-line line)
(move-to-column column)
(point-marker))))))
(defmethod xref-location-group ((l xref-file-location))
(oref l :file))
(defclass xref-buffer-location (xref-location)
((buffer :type buffer :initarg :buffer)
(position :type fixnum :initarg :position)))
(defun xref-make-buffer-location (buffer position)
"Create and return a new xref-buffer-location."
(make-instance 'xref-buffer-location :buffer buffer :position position))
(defmethod xref-location-marker ((l xref-buffer-location))
(with-slots (buffer position) l
(let ((m (make-marker)))
(move-marker m position buffer))))
(defmethod xref-location-group ((l xref-buffer-location))
(with-slots (buffer) l
(or (buffer-file-name buffer)
(format "(buffer %s)" (buffer-name buffer)))))
(defclass xref-bogus-location (xref-location)
((message :type string :initarg :message
:reader xref-bogus-location-message))
:documentation "Bogus locations are sometimes useful to
indicate errors, e.g. when we know that a function exists but the
actual location is not known.")
(defun xref-make-bogus-location (message)
"Create and return a new xref-bogus-location."
(make-instance 'xref-bogus-location :message message))
(defmethod xref-location-marker ((l xref-bogus-location))
(user-error "%s" (oref l :message)))
(defmethod xref-location-group ((_ xref-bogus-location)) "(No location)")
;; This should be in elisp-mode.el, but it's preloaded, and we can't
;; preload defclass and defmethod (at least, not yet).
(defclass xref-elisp-location (xref-location)
((symbol :type symbol :initarg :symbol)
(type :type symbol :initarg :type)
(file :type string :initarg :file
:reader xref-location-group))
:documentation "Location of an Emacs Lisp symbol definition.")
(defun xref-make-elisp-location (symbol type file)
(make-instance 'xref-elisp-location :symbol symbol :type type :file file))
(defmethod xref-location-marker ((l xref-elisp-location))
(with-slots (symbol type file) l
(let ((buffer-point
(pcase type
(`defun (find-function-search-for-symbol symbol nil file))
((or `defvar `defface)
(find-function-search-for-symbol symbol type file))
(`feature
(cons (find-file-noselect file) 1)))))
(with-current-buffer (car buffer-point)
(goto-char (or (cdr buffer-point) (point-min)))
(point-marker)))))
;;; Cross-reference
(defclass xref--xref ()
((description :type string :initarg :description
:reader xref--xref-description)
(location :type xref-location :initarg :location
:reader xref--xref-location))
:comment "An xref is used to display and locate constructs like
variables or functions.")
(defun xref-make (description location)
"Create and return a new xref.
DESCRIPTION is a short string to describe the xref.
LOCATION is an `xref-location'."
(make-instance 'xref--xref :description description :location location))
;;; API
(declare-function etags-xref-find "etags" (action id))
(declare-function tags-lazy-completion-table "etags" ())
;; For now, make the etags backend the default.
(defvar xref-find-function #'etags-xref-find
"Function to look for cross-references.
It can be called in several ways:
(definitions IDENTIFIER): Find definitions of IDENTIFIER. The
result must be a list of xref objects. If no definitions can be
found, return nil.
(references IDENTIFIER): Find references of IDENTIFIER. The
result must be a list of xref objects. If no references can be
found, return nil.
(apropos PATTERN): Find all symbols that match PATTERN. PATTERN
is a regexp.
IDENTIFIER can be any string returned by
`xref-identifier-at-point-function', or from the table returned
by `xref-identifier-completion-table-function'.
To create an xref object, call `xref-make'.")
(defvar xref-identifier-at-point-function #'xref-default-identifier-at-point
"Function to get the relevant identifier at point.
The return value must be a string or nil. nil means no
identifier at point found.
If it's hard to determine the identifier precisely (e.g., because
it's a method call on unknown type), the implementation can
return a simple string (such as symbol at point) marked with a
special text property which `xref-find-function' would recognize
and then delegate the work to an external process.")
(defvar xref-identifier-completion-table-function #'tags-lazy-completion-table
"Function that returns the completion table for identifiers.")
(defun xref-default-identifier-at-point ()
(let ((thing (thing-at-point 'symbol)))
(and thing (substring-no-properties thing))))
;;; misc utilities
(defun xref--alistify (list key test)
"Partition the elements of LIST into an alist.
KEY extracts the key from an element and TEST is used to compare
keys."
(let ((alist '()))
(dolist (e list)
(let* ((k (funcall key e))
(probe (cl-assoc k alist :test test)))
(if probe
(setcdr probe (cons e (cdr probe)))
(push (cons k (list e)) alist))))
;; Put them back in order.
(cl-loop for (key . value) in (reverse alist)
collect (cons key (reverse value)))))
(defun xref--insert-propertized (props &rest strings)
"Insert STRINGS with text properties PROPS."
(let ((start (point)))
(apply #'insert strings)
(add-text-properties start (point) props)))
(defun xref--search-property (property &optional backward)
"Search the next text range where text property PROPERTY is non-nil.
Return the value of PROPERTY. If BACKWARD is non-nil, search
backward."
(let ((next (if backward
#'previous-single-char-property-change
#'next-single-char-property-change))
(start (point))
(value nil))
(while (progn
(goto-char (funcall next (point) property))
(not (or (setq value (get-text-property (point) property))
(eobp)
(bobp)))))
(cond (value)
(t (goto-char start) nil))))
;;; Marker stack (M-. pushes, M-, pops)
(defcustom xref-marker-ring-length 16
"Length of the xref marker ring."
:type 'integer
:version "25.1")
(defvar xref--marker-ring (make-ring xref-marker-ring-length)
"Ring of markers to implement the marker stack.")
(defun xref-push-marker-stack ()
"Add point to the marker stack."
(ring-insert xref--marker-ring (point-marker)))
;;;###autoload
(defun xref-pop-marker-stack ()
"Pop back to where \\[xref-find-definitions] was last invoked."
(interactive)
(let ((ring xref--marker-ring))
(when (ring-empty-p ring)
(error "Marker stack is empty"))
(let ((marker (ring-remove ring 0)))
(switch-to-buffer (or (marker-buffer marker)
(error "The marked buffer has been deleted")))
(goto-char (marker-position marker))
(set-marker marker nil nil))))
;; etags.el needs this
(defun xref-clear-marker-stack ()
"Discard all markers from the marker stack."
(let ((ring xref--marker-ring))
(while (not (ring-empty-p ring))
(let ((marker (ring-remove ring)))
(set-marker marker nil nil)))))
(defun xref--goto-location (location)
"Set buffer and point according to xref-location LOCATION."
(let ((marker (xref-location-marker location)))
(set-buffer (marker-buffer marker))
(cond ((and (<= (point-min) marker) (<= marker (point-max))))
(widen-automatically (widen))
(t (error "Location is outside accessible part of buffer")))
(goto-char marker)))
(defun xref--pop-to-location (location &optional window)
"Goto xref-location LOCATION and display the buffer.
WINDOW controls how the buffer is displayed:
nil -- switch-to-buffer
'window -- pop-to-buffer (other window)
'frame -- pop-to-buffer (other frame)"
(xref--goto-location location)
(cl-ecase window
((nil) (switch-to-buffer (current-buffer)))
(window (pop-to-buffer (current-buffer) t))
(frame (let ((pop-up-frames t)) (pop-to-buffer (current-buffer) t)))))
;;; XREF buffer (part of the UI)
;; The xref buffer is used to display a set of xrefs.
(defun xref--display-position (pos other-window recenter-arg)
;; show the location, but don't hijack focus.
(with-selected-window (display-buffer (current-buffer) other-window)
(goto-char pos)
(recenter recenter-arg)))
(defun xref--show-location (location)
(condition-case err
(progn
(xref--goto-location location)
(xref--display-position (point) t 1))
(user-error (message (error-message-string err)))))
(defun xref--next-line (backward)
(let ((loc (xref--search-property 'xref-location backward)))
(when loc
(save-window-excursion
(xref--show-location loc)
(sit-for most-positive-fixnum)))))
(defun xref-next-line ()
"Move to the next xref and display its source in the other window."
(interactive)
(xref--next-line nil))
(defun xref-prev-line ()
"Move to the previous xref and display its source in the other window."
(interactive)
(xref--next-line t))
(defun xref--location-at-point ()
(or (get-text-property (point) 'xref-location)
(error "No reference at point")))
(defvar-local xref--window nil)
(defun xref-goto-xref ()
"Jump to the xref at point and bury the xref buffer."
(interactive)
(let ((loc (xref--location-at-point))
(window xref--window))
(quit-window)
(xref--pop-to-location loc window)))
(define-derived-mode xref--xref-buffer-mode fundamental-mode "XREF"
"Mode for displaying cross-references."
(setq buffer-read-only t))
(let ((map xref--xref-buffer-mode-map))
(define-key map (kbd "q") #'quit-window)
(define-key map [remap next-line] #'xref-next-line)
(define-key map [remap previous-line] #'xref-prev-line)
(define-key map (kbd "RET") #'xref-goto-xref)
;; suggested by Johan Claesson "to further reduce finger movement":
(define-key map (kbd ".") #'xref-next-line)
(define-key map (kbd ",") #'xref-prev-line))
(defconst xref-buffer-name "*xref*"
"The name of the buffer to show xrefs.")
(defun xref--insert-xrefs (xref-alist)
"Insert XREF-ALIST in the current-buffer.
XREF-ALIST is of the form ((GROUP . (XREF ...)) ...). Where
GROUP is a string for decoration purposes and XREF is an
`xref--xref' object."
(cl-loop for ((group . xrefs) . more1) on xref-alist do
(xref--insert-propertized '(face bold) group "\n")
(cl-loop for (xref . more2) on xrefs do
(insert " ")
(with-slots (description location) xref
(xref--insert-propertized
(list 'xref-location location
'face 'font-lock-keyword-face)
description))
(when (or more1 more2)
(insert "\n")))))
(defun xref--analyze (xrefs)
"Find common filenames in XREFS.
Return an alist of the form ((FILENAME . (XREF ...)) ...)."
(xref--alistify xrefs
(lambda (x)
(xref-location-group (xref--xref-location x)))
#'equal))
(defun xref--show-xref-buffer (xrefs window)
(let ((xref-alist (xref--analyze xrefs)))
(with-current-buffer (get-buffer-create xref-buffer-name)
(let ((inhibit-read-only t))
(erase-buffer)
(xref--insert-xrefs xref-alist)
(xref--xref-buffer-mode)
(pop-to-buffer (current-buffer))
(goto-char (point-min))
(setq xref--window window)
(current-buffer)))))
;; This part of the UI seems fairly uncontroversial: it reads the
;; identifier and deals with the single definition case.
;;
;; The controversial multiple definitions case is handed off to
;; xref-show-xrefs-function.
(defvar xref-show-xrefs-function 'xref--show-xref-buffer
"Function to display a list of xrefs.")
(defun xref--show-xrefs (id kind xrefs window)
(cond
((null xrefs)
(user-error "No known %s for: %s" kind id))
((not (cdr xrefs))
(xref-push-marker-stack)
(xref--pop-to-location (xref--xref-location (car xrefs)) window))
(t
(xref-push-marker-stack)
(funcall xref-show-xrefs-function xrefs window))))
(defun xref--read-identifier (prompt)
"Return the identifier at point or read it from the minibuffer."
(let ((id (funcall xref-identifier-at-point-function)))
(cond ((or current-prefix-arg (not id))
(completing-read prompt
(funcall xref-identifier-completion-table-function)
nil t id))
(t id))))
;;; Commands
(defun xref--find-definitions (id window)
(xref--show-xrefs id "definitions"
(funcall xref-find-function 'definitions id)
window))
;;;###autoload
(defun xref-find-definitions (identifier)
"Find the definition of the identifier at point.
With prefix argument, prompt for the identifier."
(interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier nil))
;;;###autoload
(defun xref-find-definitions-other-window (identifier)
"Like `xref-find-definitions' but switch to the other window."
(interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier 'window))
;;;###autoload
(defun xref-find-definitions-other-frame (identifier)
"Like `xref-find-definitions' but switch to the other frame."
(interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier 'frame))
;;;###autoload
(defun xref-find-references (identifier)
"Find references to the identifier at point.
With prefix argument, prompt for the identifier."
(interactive (list (xref--read-identifier "Find references of: ")))
(xref--show-xrefs identifier "references"
(funcall xref-find-function 'references identifier)
nil))
;;;###autoload
(defun xref-find-apropos (pattern)
"Find all meaningful symbols that match PATTERN.
The argument has the same meaning as in `apropos'."
(interactive (list (read-from-minibuffer
"Search for pattern (word list or regexp): ")))
(require 'apropos)
(xref--show-xrefs pattern "apropos"
(funcall xref-find-function 'apropos
(apropos-parse-pattern
(if (string-equal (regexp-quote pattern) pattern)
;; Split into words
(or (split-string pattern "[ \t]+" t)
(user-error "No word list given"))
pattern)))
nil))
;;; Key bindings
;;;###autoload (define-key esc-map "." #'xref-find-definitions)
;;;###autoload (define-key esc-map "," #'xref-pop-marker-stack)
;;;###autoload (define-key esc-map [?\C-.] #'xref-find-apropos)
;;;###autoload (define-key ctl-x-4-map "." #'xref-find-definitions-other-window)
;;;###autoload (define-key ctl-x-5-map "." #'xref-find-definitions-other-frame)
(provide 'xref)
;;; xref.el ends here

View file

@ -138,6 +138,8 @@ disabled, i.e., the position is recorded for all files."
:version "24.1"
:type 'regexp :group 'save-place)
(declare-function dired-current-directory "dired" (&optional localp))
(defun toggle-save-place (&optional parg)
"Toggle whether to save your place in this file between sessions.
If this mode is enabled, point is recorded when you kill the buffer
@ -153,7 +155,7 @@ file:
\(setq-default save-place t)"
(interactive "P")
(if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
dired-directory)))
(dired-current-directory))))
(message "Buffer `%s' not visiting a file or directory" (buffer-name))
(setq save-place (if parg
(> (prefix-numeric-value parg) 0)
@ -172,12 +174,13 @@ file:
;; file. If not, do so, then feel free to modify the alist. It
;; will be saved again when Emacs is killed.
(or save-place-loaded (load-save-place-alist-from-file))
(let ((item (or buffer-file-name
(and (derived-mode-p 'dired-mode)
dired-directory
(expand-file-name (if (consp dired-directory)
(car dired-directory)
dired-directory))))))
(let* ((directory (and (derived-mode-p 'dired-mode)
(dired-current-directory)))
(item (or buffer-file-name
(and directory
(expand-file-name (if (consp directory)
(car directory)
directory))))))
(when (and item
(or (not save-place-ignore-files-regexp)
(not (string-match save-place-ignore-files-regexp
@ -186,8 +189,7 @@ file:
(position (cond ((eq major-mode 'hexl-mode)
(with-no-warnings
(1+ (hexl-current-address))))
((and (derived-mode-p 'dired-mode)
dired-directory)
((and (derived-mode-p 'dired-mode) directory)
(let ((filename (dired-get-filename nil t)))
(if filename
`((dired-filename . ,filename))
@ -305,7 +307,7 @@ may have changed) back to `save-place-alist'."
;; save-place checks buffer-file-name too, but we can avoid
;; overhead of function call by checking here too.
(and (or buffer-file-name (and (derived-mode-p 'dired-mode)
dired-directory))
(dired-current-directory)))
(save-place-to-alist))
(setq buf-list (cdr buf-list))))))
@ -325,19 +327,21 @@ may have changed) back to `save-place-alist'."
(defun save-place-dired-hook ()
"Position the point in a Dired buffer."
(or save-place-loaded (load-save-place-alist-from-file))
(let ((cell (assoc (and (derived-mode-p 'dired-mode)
dired-directory
(expand-file-name (if (consp dired-directory)
(car dired-directory)
dired-directory)))
save-place-alist)))
(let* ((directory (and (derived-mode-p 'dired-mode)
(dired-current-directory)))
(cell (assoc (and directory
(expand-file-name (if (consp directory)
(car directory)
directory)))
save-place-alist)))
(if cell
(progn
(or revert-buffer-in-progress-p
(if (integerp (cdr cell))
(goto-char (cdr cell))
(and (assq 'dired-filename (cdr cell))
(dired-goto-file (cdr (assq 'dired-filename (cdr cell)))))))
(cond
((integerp (cdr cell))
(goto-char (cdr cell)))
((and (listp (cdr cell)) (assq 'dired-filename (cdr cell)))
(dired-goto-file (cdr (assq 'dired-filename (cdr cell)))))))
;; and make sure it will be saved again for later
(setq save-place t)))))

View file

@ -308,6 +308,13 @@ for Shell mode only."
(const :tag "on" t))
:group 'shell)
(defcustom shell-display-buffer-actions display-buffer-base-action
"The `display-buffer' actions for the `*shell*' buffer."
:type display-buffer--action-custom-type
:risky t
:version "25.1"
:group 'shell)
(defvar shell-dirstack nil
"List of directories saved by pushd in this buffer's shell.
Thus, this does not include the shell's current directory.")
@ -718,7 +725,7 @@ Otherwise, one argument `-i' is passed to the shell.
;; The buffer's window must be correctly set when we call comint (so
;; that comint sets the COLUMNS env var properly).
(pop-to-buffer-same-window buffer)
(pop-to-buffer buffer shell-display-buffer-actions)
(unless (comint-check-proc buffer)
(let* ((prog (or explicit-shell-file-name
(getenv "ESHELL") shell-file-name))

View file

@ -1667,7 +1667,6 @@ invoking, give a prefix argument to `execute-extended-command'."
(let ((prefix-arg prefixarg))
(command-execute function 'record))
;; If enabled, show which key runs this command.
;; (when binding
;; But first wait, and skip the message if there is input.
(let* ((waited
;; If this command displayed something in the echo area;
@ -1675,10 +1674,11 @@ invoking, give a prefix argument to `execute-extended-command'."
;; FIXME: Wait *after* running post-command-hook!
;; FIXME: Don't wait if execute-extended-command--shorter won't
;; find a better answer anyway!
(sit-for (cond
((zerop (length (current-message))) 0)
((numberp suggest-key-bindings) suggest-key-bindings)
(t 2)))))
(when suggest-key-bindings
(sit-for (cond
((zerop (length (current-message))) 0)
((numberp suggest-key-bindings) suggest-key-bindings)
(t 2))))))
(when (and waited (not (consp unread-command-events)))
(unless (or binding executing-kbd-macro (not (symbolp function))
(<= (length (symbol-name function)) 2))

View file

@ -1463,9 +1463,7 @@ Each element in the list should be a list of strings or pairs
(goto-char (point-min))))
"\tMany people have contributed code included in GNU Emacs\n"
:link ("Contributing"
,(lambda (_button)
(view-file (expand-file-name "CONTRIBUTE" data-directory))
(goto-char (point-min))))
,(lambda (_button) (info "(emacs)Contributing")))
"\tHow to contribute improvements to Emacs\n"
"\n"
:link ("GNU and Freedom" ,(lambda (_button) (describe-gnu-project)))
@ -2039,9 +2037,7 @@ Type \\[describe-distribution] for information on "))
(insert-button "Contributing"
'action
(lambda (_button)
(view-file (expand-file-name "CONTRIBUTE" data-directory))
(goto-char (point-min)))
(lambda (_button) (info "(emacs)Contributing"))
'follow-link t)
(insert "\tHow to contribute improvements to Emacs\n\n")

View file

@ -2166,7 +2166,7 @@ keyboard-quit events while waiting for a valid input."
char))
(defun sit-for (seconds &optional nodisp obsolete)
"Perform redisplay, then wait for SECONDS seconds or until input is available.
"Redisplay, then wait for SECONDS seconds. Stop when input is available.
SECONDS may be a floating-point value.
\(On operating systems that do not support waiting for fractions of a
second, floating-point values are rounded down to the nearest integer.)
@ -2184,7 +2184,7 @@ floating point support."
(declare (advertised-calling-convention (seconds &optional nodisp) "22.1"))
;; This used to be implemented in C until the following discussion:
;; http://lists.gnu.org/archive/html/emacs-devel/2006-07/msg00401.html
;; Then it was moved to C using an implementation based on an idle timer,
;; Then it was moved here using an implementation based on an idle timer,
;; which was then replaced by the use of read-event.
(if (numberp nodisp)
(setq seconds (+ seconds (* 1e-3 nodisp))

View file

@ -1300,18 +1300,48 @@ Inserts the value of `tex-open-quote' (normally ``) or `tex-close-quote'
\(normally '') depending on the context. With prefix argument, always
inserts \" characters."
(interactive "*P")
;; Discover if we'll be inserting normal double quotes.
;;
(if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\))
(eq (get-text-property (point) 'face) 'tex-verbatim)
(save-excursion
(backward-char (length tex-open-quote))
(when (or (looking-at (regexp-quote tex-open-quote))
(looking-at (regexp-quote tex-close-quote)))
(delete-char (length tex-open-quote))
t)))
(eq (get-text-property (point) 'face) 'tex-verbatim)
;; Discover if a preceding occurrence of `tex-open-quote'
;; should be morphed to a normal double quote.
;;
(and (>= (point) (+ (point-min) (length tex-open-quote)))
(save-excursion
(backward-char (length tex-open-quote))
(when (or (looking-at (regexp-quote tex-open-quote))
(looking-at (regexp-quote tex-close-quote)))
(delete-char (length tex-open-quote))
(when (looking-at (regexp-quote tex-close-quote))
(delete-char (length tex-close-quote)))
t))))
;; Insert the normal quote (eventually letting
;; `electric-pair-mode' do its thing).
;;
(self-insert-command (prefix-numeric-value arg))
(insert (if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
(memq (preceding-char) '(?~)))
tex-open-quote tex-close-quote))))
;; We'll be inserting fancy TeX quotes, but consider and imitate
;; `electric-pair-mode''s two behaviors: pair-insertion and
;; region wrapping.
;;
(if (and electric-pair-mode (use-region-p))
(let* ((saved (point-marker)))
(goto-char (mark))
(insert (if (> saved (mark)) tex-open-quote tex-close-quote))
(goto-char saved)
(insert (if (> saved (mark)) tex-close-quote tex-open-quote)))
(if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
(memq (preceding-char) '(?~)))
(if electric-pair-mode
(if (looking-at (regexp-quote tex-close-quote))
(forward-char (length tex-close-quote))
(insert tex-open-quote)
(insert tex-close-quote)
(backward-char (length tex-close-quote)))
(insert tex-open-quote))
(if (looking-at (regexp-quote tex-close-quote))
(forward-char (length tex-close-quote))
(insert tex-close-quote))))))
(defun tex-validate-buffer ()
"Check current buffer for paragraphs containing mismatched braces or $s.

View file

@ -30,6 +30,8 @@
;;; Code:
(require 'diff-mode) ; For diff faces.
(defgroup compare-windows nil
"Compare text between windows."
:prefix "compare-"
@ -128,11 +130,19 @@ out all highlighting later with the command `compare-windows-dehighlight'."
:group 'compare-windows
:version "22.1")
(defface compare-windows
'((t :inherit lazy-highlight))
"Face for highlighting of compare-windows difference regions."
(defface compare-windows-removed
'((t :inherit diff-removed))
"Face for highlighting of compare-windows removed regions."
:group 'compare-windows
:version "22.1")
:version "25.1")
(defface compare-windows-added
'((t :inherit diff-added))
"Face for highlighting of compare-windows added regions."
:group 'compare-windows
:version "25.1")
(define-obsolete-face-alias 'compare-windows 'compare-windows-added "25.1")
(defvar compare-windows-overlay1 nil)
(defvar compare-windows-overlay2 nil)
@ -158,7 +168,8 @@ then try to get a window on an iconified frame, and finally
consider all existing frames."
(or (get-mru-window 'visible t t)
(get-mru-window 0 t t)
(get-mru-window t t t)))
(get-mru-window t t t)
(error "No other window")))
(defun compare-windows-get-next-window ()
"Return the window next in the cyclic ordering of windows.
@ -393,13 +404,13 @@ on third call it again advances points to the next difference and so on."
(if compare-windows-overlay1
(move-overlay compare-windows-overlay1 beg1 end1 b1)
(setq compare-windows-overlay1 (make-overlay beg1 end1 b1))
(overlay-put compare-windows-overlay1 'face 'compare-windows)
(overlay-put compare-windows-overlay1 'face 'compare-windows-added)
(overlay-put compare-windows-overlay1 'priority 1000))
(overlay-put compare-windows-overlay1 'window w1)
(if compare-windows-overlay2
(move-overlay compare-windows-overlay2 beg2 end2 b2)
(setq compare-windows-overlay2 (make-overlay beg2 end2 b2))
(overlay-put compare-windows-overlay2 'face 'compare-windows)
(overlay-put compare-windows-overlay2 'face 'compare-windows-removed)
(overlay-put compare-windows-overlay2 'priority 1000))
(overlay-put compare-windows-overlay2 'window w2)
(if (not (eq compare-windows-highlight 'persistent))

View file

@ -371,8 +371,7 @@ or an empty string if none."
(goto-char (point-min))
(pcase stage
(`update-index
(setq next-stage (if (vc-git--empty-db-p) 'ls-files-added
(if files 'ls-files-up-to-date 'diff-index))))
(setq next-stage (if (vc-git--empty-db-p) 'ls-files-added 'diff-index)))
(`ls-files-added
(setq next-stage 'ls-files-unknown)
(while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t)
@ -381,7 +380,7 @@ or an empty string if none."
(push (list name 'added (vc-git-create-extra-fileinfo 0 new-perm))
result))))
(`ls-files-up-to-date
(setq next-stage 'diff-index)
(setq next-stage 'ls-files-unknown)
(while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t)
(let ((perm (string-to-number (match-string 1) 8))
(name (match-string 2)))
@ -400,7 +399,7 @@ or an empty string if none."
(vc-git-create-extra-fileinfo 0 0))
result)))
(`diff-index
(setq next-stage 'ls-files-unknown)
(setq next-stage (if files 'ls-files-up-to-date 'ls-files-unknown))
(while (re-search-forward
":\\([0-7]\\{6\\}\\) \\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\(\\([ADMUT]\\)\0\\([^\0]+\\)\\|\\([CR]\\)[0-9]*\0\\([^\0]+\\)\0\\([^\0]+\\)\\)\0"
nil t 1)

View file

@ -237,7 +237,12 @@ displays the buffer specified by BUFFER-OR-NAME before running BODY."
(standard-output ,buffer)
,window ,value)
(with-current-buffer ,buffer
(setq ,window (temp-buffer-window-show ,buffer ,vaction)))
(setq ,window (temp-buffer-window-show
,buffer
;; Remove window-height when it's handled below.
(if (functionp (cdr (assq 'window-height (cdr ,vaction))))
(assq-delete-all 'window-height (copy-sequence ,vaction))
,vaction))))
(let ((inhibit-read-only t)
(inhibit-modification-hooks t))
@ -7798,6 +7803,9 @@ With arg N, put point N/10 of the way from the true end."
(defvar mouse-autoselect-window-timer nil
"Timer used by delayed window autoselection.")
(defvar mouse-autoselect-window-position-1 nil
"First mouse position recorded by delayed window autoselection.")
(defvar mouse-autoselect-window-position nil
"Last mouse position recorded by delayed window autoselection.")
@ -7822,6 +7830,7 @@ Optional argument FORCE means cancel unconditionally."
(memq (nth 4 (event-end last-input-event))
'(handle end-scroll)))))
(setq mouse-autoselect-window-state nil)
(setq mouse-autoselect-window-position-1 nil)
(when (timerp mouse-autoselect-window-timer)
(cancel-timer mouse-autoselect-window-timer))
(remove-hook 'pre-command-hook 'mouse-autoselect-window-cancel)))
@ -7863,21 +7872,32 @@ is active. This function is run by `mouse-autoselect-window-timer'."
;; A menu / popup dialog is active or the mouse is not on the
;; text region of WINDOW: Suspend autoselection temporarily.
(mouse-autoselect-window-start mouse-position nil t))
((eq mouse-autoselect-window-state 'suspend)
((or (eq mouse-autoselect-window-state 'suspend)
;; When the mouse is at its first recorded position, restart
;; delayed autoselection. This works around a scenario with
;; two two-window frames with identical dimensions: select the
;; first window of the first frame, switch to the second
;; frame, move the mouse to its second window, minimize the
;; second frame. Now the second window of the first frame
;; gets selected although the mouse never really "moved" into
;; that window.
(and (numberp mouse-autoselect-window)
(equal (mouse-position) mouse-autoselect-window-position-1)))
;; Delayed autoselection was temporarily suspended, reenable it.
(mouse-autoselect-window-start mouse-position))
((and window (not (eq window (selected-window)))
(or (not (numberp mouse-autoselect-window))
(and (> mouse-autoselect-window 0)
;; If `mouse-autoselect-window' is positive, select
;; window if the window is the same as before.
(and (>= mouse-autoselect-window 0)
;; If `mouse-autoselect-window' is non-negative,
;; select window if it's the same as before.
(eq window mouse-autoselect-window-window))
;; Otherwise select window if the mouse is at the same
;; position as before. Observe that the first test after
;; starting autoselection usually fails since the value of
;; `mouse-autoselect-window-position' recorded there is the
;; position where the mouse has entered the new window and
;; not necessarily where the mouse has stopped moving.
;; Otherwise select window iff the mouse is at the same
;; position as before. Observe that the first test
;; after starting autoselection usually fails since the
;; value of `mouse-autoselect-window-position' recorded
;; there is the position where the mouse has entered the
;; new window and not necessarily where the mouse has
;; stopped moving.
(equal mouse-position mouse-autoselect-window-position))
;; The minibuffer is a candidate window if it's active.
(or (not (window-minibuffer-p window))
@ -7921,14 +7941,14 @@ is active. This function is run by `mouse-autoselect-window-timer'."
(not (minibuffer-window-active-p window)))
;; Don't switch when autoselection shall be delayed.
(and (numberp mouse-autoselect-window)
(not (zerop mouse-autoselect-window))
(not (eq mouse-autoselect-window-state 'select))
(progn
(let ((position (mouse-position)))
;; Cancel any delayed autoselection.
(mouse-autoselect-window-cancel t)
;; Start delayed autoselection from current mouse
;; position and window.
(mouse-autoselect-window-start (mouse-position) window)
(setq mouse-autoselect-window-position-1 position)
(mouse-autoselect-window-start position window)
;; Executing a command cancels delayed autoselection.
(add-hook
'pre-command-hook 'mouse-autoselect-window-cancel))))

View file

@ -439,10 +439,9 @@ resource_widget_value (XlwMenuWidget mw, widget_value *val)
int complete_length =
strlen (resourced_name) + strlen (val->value) + 2;
complete_name = XtMalloc (complete_length);
*complete_name = 0;
strcat (complete_name, resourced_name);
strcat (complete_name, " ");
strcat (complete_name, val->value);
char *z = stpcpy (complete_name, resourced_name);
*z++ = ' ';
strcpy (z, val->value);
}
val->toolkit_data = complete_name;

View file

@ -123,6 +123,7 @@ AC_DEFUN([gl_EARLY],
# Code from module stdint:
# Code from module stdio:
# Code from module stdlib:
# Code from module stpcpy:
# Code from module strftime:
# Code from module string:
# Code from module strtoimax:
@ -341,6 +342,12 @@ AC_DEFUN([gl_INIT],
gl_STDINT_H
gl_STDIO_H
gl_STDLIB_H
gl_FUNC_STPCPY
if test $HAVE_STPCPY = 0; then
AC_LIBOBJ([stpcpy])
gl_PREREQ_STPCPY
fi
gl_STRING_MODULE_INDICATOR([stpcpy])
gl_FUNC_GNU_STRFTIME
gl_HEADER_STRING_H
gl_FUNC_STRTOIMAX
@ -889,6 +896,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdint.in.h
lib/stdio.in.h
lib/stdlib.in.h
lib/stpcpy.c
lib/strftime.c
lib/strftime.h
lib/string.in.h
@ -995,6 +1003,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdint.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/stpcpy.m4
m4/strftime.m4
m4/string_h.m4
m4/strtoimax.m4

25
m4/stpcpy.m4 Normal file
View file

@ -0,0 +1,25 @@
# stpcpy.m4 serial 8
dnl Copyright (C) 2002, 2007, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STPCPY],
[
dnl Persuade glibc <string.h> to declare stpcpy().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
dnl The stpcpy() declaration in lib/string.in.h uses 'restrict'.
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_CHECK_FUNCS([stpcpy])
if test $ac_cv_func_stpcpy = no; then
HAVE_STPCPY=0
fi
])
# Prerequisites of lib/stpcpy.c.
AC_DEFUN([gl_PREREQ_STPCPY], [
:
])

View file

@ -1,3 +1,8 @@
2014-12-26 Eli Zaretskii <eliz@gnu.org>
* gnulib.mk (stpcpy, string): Sync with the latest change in
lib/gnulib.mk.
2014-12-13 Eli Zaretskii <eliz@gnu.org>
* gnulib.mk (stddef.h): Sync with the latest change in lib/gnulib.mk.

View file

@ -43,7 +43,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings
MOSTLYCLEANFILES += core *.stackdump
@ -771,6 +771,15 @@ EXTRA_DIST += stdint.in.h
## end gnulib module stdint
## begin gnulib module stpcpy
EXTRA_DIST += stpcpy.c
EXTRA_libgnu_a_SOURCES += stpcpy.c
## end gnulib module stpcpy
## begin gnulib module strftime
libgnu_a_SOURCES += strftime.c
@ -779,6 +788,106 @@ EXTRA_DIST += strftime.h
## end gnulib module strftime
## begin gnulib module string
BUILT_SOURCES += string.h
# We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler.
string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
-e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
-e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
-e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
-e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
-e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
-e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
-e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
-e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
-e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
-e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
-e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
-e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
-e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
-e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
-e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
-e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
-e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
-e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
-e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
-e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
-e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
-e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
-e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
-e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
-e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
-e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
-e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
-e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
-e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
-e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
-e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
-e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
-e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
-e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
-e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
< $(srcdir)/string.in.h | \
sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
-e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
-e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
-e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
-e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
-e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
-e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
-e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
-e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
-e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
-e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
-e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
-e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
-e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
< $(srcdir)/string.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += string.h string.h-t
EXTRA_DIST += string.in.h
## end gnulib module string
## begin gnulib module strtoimax

View file

@ -1,3 +1,120 @@
2014-12-28 Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
Wrap dll functions more simply
* decompress.c, gnutls.c, image.c, xml.c:
If WINDOWSNT, use '#define FOO fn_FOO' to wrap dll functions,
rather than the inverse when not WINDOWSNT. This isolates the
fn_* business into the WINDOWSNT-specific section of the code,
which makes it easier to maintain the generic code.
* decompress.c (DEF_ZLIB_FN, LOAD_ZLIB_FN):
* gnutls.c (DEF_GNUTLS_FN, LOAD_GNUTLS_FN):
* image.c (DEF_IMGLIB_FN, LOAD_IMGLIB_FN):
* xml.c (DEF_XML2_FN, LOAD_XML2_FN):
Remove. All uses replaced by DEF_DLL_FN.
* decompress.c (inflateInit2): Remove; no longer needed.
* w32.h (DEF_DLL_FN, LOAD_DLL_FN): New macros.
Port memory-full checking to GnuTLS 3.3
Instead of using gnutls_global_set_mem_functions, check every call
to a GnuTLS function that might return an indication of memory
exhaustion. Suggested by Dmitry Antipov in:
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02056.html
* gnutls.c (gnutls_global_set_mem_functions) [WINDOWSNT]: Remove.
(init_gnutls_functions): Do not load gnutls_global_set_mem_functions.
(fn_gnutls_global_set_mem_functions) [!WINDOWSNT]: Remove.
All uses removed.
(check_memory_full): New function.
(emacs_gnutls_handshake, emacs_gnutls_handle_error)
(gnutls_make_error, gnutls_certificate_details, Fgnutls_peer_status)
(Fgnutls_boot): Use it.
(emacs_gnutls_global_init): Avoid gnutls_global_set_mem_functions.
2014-12-27 Paul Eggert <eggert@cs.ucla.edu>
Fix parse_settings to match internal documentation
* xsettings.c (parse_settings): Return the number of settings seen.
Count the settings changes accurately.
(read_settings): Don't confuse number of settings changes with
the return code from XGetWindowProperty.
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_iterator_to_next) <GET_FROM_STRING>: Limit search in
composition_compute_stop_pos to the number of characters in the
string. (Bug#19435)
<GET_FROM_BUFFER, GET_FROM_STRING>: Simplify code.
* composite.c (composition_compute_stop_pos): If no composition
was found in a string before ENDPOS, and ENDPOS is the string end,
no need to back up to a safe point.
* dispextern.h (struct it) <end_charpos>: Improve commentary.
2014-12-27 Jan Djärv <jan.h.d@swipnet.se>
* nsimage.m (allocInitFromFile:): Initialize bmRep.
(dealloc): Release bmRep.
(setPixmapData): Make bmRep local so class member is not
set (Bug#19133).
(setPixmapData): Rename local variable bmRep to avoid compiler
warning.
2014-12-27 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (do_ewmh_fullscreen): Don't remove maximized_horz/vert
when going to fullscreen (Bug#0x180004f).
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* buffer.c (syms_of_buffer) <Vafter_change_functions>: fix docstring.
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* gnutls.c (gnutls_init): Fix deprecation warning from GCC.
2014-12-26 Paul Eggert <eggert@cs.ucla.edu>
Use bool for boolean in xselect.c, xsettings.c
* xselect.c (x_get_local_selection, struct selection_data)
(x_selection_request_lisp_error, struct prop_location)
(x_handle_selection_request, x_convert_selection)
(waiting_for_other_props_on_window, expect_property_change)
(wait_for_property_change, x_handle_property_notify)
(x_get_foreign_selection, x_get_window_property)
(receive_incremental_selection)
(x_get_window_property_as_lisp_data)
(lisp_data_to_selection_data, Fx_get_selection_internal)
(x_send_client_event):
* xselect.c, xterm.h (x_handle_dnd_message):
* xsettings.c (dpyinfo_valid, parse_settings, read_settings)
(apply_xft_settings, read_and_apply_settings)
(xft_settings_event, init_gsettings, init_xsettings)
(syms_of_xsettings):
Use bool for boolean.
* xselect.c (x_get_window_property): Omit last arg, which was an
unused boolean.
* xsettings.c (apply_xft_settings): Remove 2nd arg, which was
always true. All callers changed.
2014-12-26 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead
of strcat.
* w32menu.c (add_menu_item): Use stpcpy instead of strcat.
* w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of
strcat.
2014-12-26 Paul Eggert <eggert@cs.ucla.edu>
Use bool for boolean in xsmfns.c
* xsmfns.c, xterm.h (x_session_have_connection):
* xsmfns.c (doing_interact, smc_interact_CB, Fhandle_save_session):
Use bool for boolean.
(x_session_initialize, Fhandle_save_session):
Prefer NILP (x) to EQ (x, Qnil).
2014-12-23 Didier Verna <didier@didierverna.net> (tiny change).
* nsselect.m (Fns_selection_owner_p): Return a Lisp boolean, not a
@ -202,6 +319,10 @@
Call gnutls_certificate_set_x509_system_trust. Log an error message if
it fails.
2014-12-14 Paul Eggert <eggert@cs.ucla.edu>
* regex.c (analyze_first): Rename from analyze_first.
2014-12-13 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (XMALLOC_BASE_ALIGNMENT): Use max_align_t instead of
@ -871,6 +992,8 @@
* fileio.c (Fexpand_file_name): Use make_unibyte_string, not
build_string, when importing a home directory. (Bug#18873)
2014-12-27 Eli Zaretskii <eliz@gnu.org>
* dispnew.c (buffer_posn_from_coords):
Use WINDOW_WANTS_HEADER_LINE_P, not WINDOW_WANTS_MODELINE_P, to
account for the header-line height. (Bug#18839)

View file

@ -6066,9 +6066,9 @@ from happening repeatedly and making Emacs nonfunctional. */);
doc: /* List of functions to call after each text change.
Three arguments are passed to each function: the positions of
the beginning and end of the range of changed text,
and the length in bytes of the pre-change text replaced by that range.
and the length in chars of the pre-change text replaced by that range.
\(For an insertion, the pre-change length is zero;
for a deletion, that length is the number of bytes deleted,
for a deletion, that length is the number of chars deleted,
and the post-change beginning and end are at the same place.)
Buffer changes made while executing the `after-change-functions'

View file

@ -1315,13 +1315,10 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
if (STRINGP (display))
{
char *vdata;
if (MAX_ALLOCA - sizeof "DISPLAY=" < SBYTES (display))
exec_failed (new_argv[0], ENOMEM);
vdata = alloca (sizeof "DISPLAY=" + SBYTES (display));
strcpy (vdata, "DISPLAY=");
strcat (vdata, SSDATA (display));
char *vdata = alloca (sizeof "DISPLAY=" + SBYTES (display));
lispstpcpy (stpcpy (vdata, "DISPLAY="), display);
new_env = add_env (env, new_env, vdata);
}

Some files were not shown because too many files have changed in this diff Show more