Merge branch 'master' into xwidget

This commit is contained in:
jave 2014-12-28 17:33:38 +01:00
commit 703cbed72f
66 changed files with 3184 additions and 1996 deletions

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,43 @@
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 +48,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>

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

@ -1,3 +1,7 @@
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

@ -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,22 @@
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

View file

@ -370,9 +370,9 @@ More specifically, a Q-pattern can take the following forms:
@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},
@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}.

View file

@ -2218,8 +2218,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,6 +2260,29 @@ 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

View file

@ -654,9 +654,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

@ -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

@ -483,17 +483,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 +602,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

@ -4467,7 +4467,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

@ -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

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,9 @@
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
@ -426,6 +434,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

@ -1,3 +1,7 @@
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

@ -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,78 @@
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 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 +110,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 +204,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 +328,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 +401,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 +424,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 +457,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 +577,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 +784,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 +801,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 +926,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 +939,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 +1118,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 +1323,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 +1340,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 +1689,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 +2383,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 +3390,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 +3555,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 +3693,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 +4087,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 +4341,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 +4553,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>
@ -4864,7 +4942,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 +5190,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 +5981,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 +6662,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 +6691,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 +7679,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

@ -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

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

@ -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))
@ -414,17 +419,39 @@ It can be quoted, or be inside a quoted form."
(declare-function find-library-name "find-func" (library))
(defvar elisp--identifier-types '(defun defvar feature defface))
(defun elisp--identifier-location (type sym)
(pcase (cons type sym)
(`(defun . ,(pred fboundp))
(find-definition-noselect sym nil))
(`(defvar . ,(pred boundp))
(find-definition-noselect sym 'defvar))
(`(defface . ,(pred facep))
(find-definition-noselect sym 'defface))
(`(feature . ,(pred featurep))
(require 'find-func)
(cons (find-file-noselect (find-library-name
(symbol-name sym)))
1))))
(defun elisp--company-location (str)
(let ((sym (intern-soft str)))
(cond
((fboundp sym) (find-definition-noselect sym nil))
((boundp sym) (find-definition-noselect sym 'defvar))
((featurep sym)
(require 'find-func)
(cons (find-file-noselect (find-library-name
(symbol-name sym)))
0))
((facep sym) (find-definition-noselect sym 'defface)))))
(catch 'res
(let ((sym (intern-soft str)))
(when sym
(dolist (type elisp--identifier-types)
(let ((loc (elisp--identifier-location type sym)))
(and loc (throw 'res loc))))))))
(defvar elisp--identifier-completion-table
(apply-partially #'completion-table-with-predicate
obarray
(lambda (sym)
(or (boundp sym)
(fboundp sym)
(featurep sym)
(symbol-plist sym)))
'strict))
(defun elisp-completion-at-point ()
"Function used for `completion-at-point-functions' in `emacs-lisp-mode'."
@ -466,13 +493,8 @@ It can be quoted, or be inside a quoted form."
:company-docsig #'elisp--company-doc-string
:company-location #'elisp--company-location))
((elisp--form-quoted-p beg)
(list nil obarray
;; Don't include all symbols
;; (bug#16646).
:predicate (lambda (sym)
(or (boundp sym)
(fboundp sym)
(symbol-plist sym)))
;; Don't include all symbols (bug#16646).
(list nil elisp--identifier-completion-table
:annotation-function
(lambda (str) (if (fboundp (intern-soft str)) " <f>"))
:company-doc-buffer #'elisp--company-doc-buffer
@ -548,6 +570,50 @@ 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-buffer-location "xref" (buffer position))
(declare-function xref-make-bogus-location "xref" (message))
(declare-function xref-make "xref" (description location))
(defun elisp-xref-find (action id)
(pcase action
(`definitions
(let ((sym (intern-soft id)))
(when sym
(elisp--xref-find-definitions sym))))
(`apropos
(elisp--xref-find-apropos id))))
(defun elisp--xref-find-definitions (symbol)
(save-excursion
(let (lst)
(dolist (type elisp--identifier-types)
(let ((loc
(condition-case err
(let ((buf-pos (elisp--identifier-location type symbol)))
(when buf-pos
(xref-make-buffer-location (car buf-pos)
(or (cdr buf-pos) 1))))
(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))))
(defun elisp--xref-identifier-completion-table ()
elisp--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 /.../.

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

@ -0,0 +1,499 @@
;; 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)")
;;; 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

@ -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

@ -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

@ -7798,6 +7798,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 +7825,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 +7867,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 +7936,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,27 @@
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
C one (Bug#19396).
2014-12-22 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (x_bitmap_icon): Partly revert change from 2014-03-21 which
@ -197,6 +221,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

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);
}

View file

@ -357,7 +357,7 @@ xd_signature_cat (char *signature, char const *x)
ptrdiff_t xlen = strlen (x);
if (DBUS_MAXIMUM_SIGNATURE_LENGTH - xlen <= siglen)
string_overflow ();
strcat (signature, x);
strcpy (signature + siglen, x);
}
/* Compute SIGNATURE of OBJECT. It must have a form that it can be

View file

@ -42,6 +42,8 @@ static ptrdiff_t get_doc_string_buffer_size;
static unsigned char *read_bytecode_pointer;
static char const sibling_etc[] = "../etc/";
/* `readchar' in lread.c calls back here to fetch the next byte.
If UNREADFLAG is 1, we unread a byte. */
@ -80,7 +82,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
{
char *from, *to, *name, *p, *p1;
int fd;
ptrdiff_t minsize;
int offset;
EMACS_INT position;
Lisp_Object file, tem, pos;
@ -113,21 +114,14 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
tem = Ffile_name_absolute_p (file);
file = ENCODE_FILE (file);
if (NILP (tem))
{
Lisp_Object docdir = ENCODE_FILE (Vdoc_directory);
minsize = SCHARS (docdir);
/* sizeof ("../etc/") == 8 */
if (minsize < 8)
minsize = 8;
name = SAFE_ALLOCA (minsize + SCHARS (file) + 8);
char *z = lispstpcpy (name, docdir);
strcpy (z, SSDATA (file));
}
else
{
name = SSDATA (file);
}
Lisp_Object docdir
= NILP (tem) ? ENCODE_FILE (Vdoc_directory) : empty_unibyte_string;
ptrdiff_t docdir_sizemax = SBYTES (docdir) + 1;
#ifndef CANNOT_DUMP
docdir_sizemax = max (docdir_sizemax, sizeof sibling_etc);
#endif
name = SAFE_ALLOCA (docdir_sizemax + SBYTES (file));
lispstpcpy (lispstpcpy (name, docdir), file);
fd = emacs_open (name, O_RDONLY, 0);
if (fd < 0)
@ -137,8 +131,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
{
/* Preparing to dump; DOC file is probably not installed.
So check in ../etc. */
strcpy (name, "../etc/");
strcat (name, SSDATA (file));
lispstpcpy (stpcpy (name, sibling_etc), file);
fd = emacs_open (name, O_RDONLY, 0);
}
@ -580,7 +573,6 @@ the same file name is found in the `doc-directory'. */)
(0)
#endif /* CANNOT_DUMP */
{
static char const sibling_etc[] = "../etc/";
dirname = sibling_etc;
dirlen = sizeof sibling_etc - 1;
}
@ -594,8 +586,7 @@ the same file name is found in the `doc-directory'. */)
count = SPECPDL_INDEX ();
USE_SAFE_ALLOCA;
name = SAFE_ALLOCA (dirlen + SBYTES (filename) + 1);
strcpy (name, dirname);
strcat (name, SSDATA (filename)); /*** Add this line ***/
lispstpcpy (stpcpy (name, dirname), filename); /*** Add this line ***/
/* Vbuild_files is nil when temacs is run, and non-nil after that. */
if (NILP (Vbuild_files))

View file

@ -1350,10 +1350,9 @@ name, or nil if there is no such user. */)
USE_SAFE_ALLOCA;
char *r = SAFE_ALLOCA (strlen (p) + SBYTES (login) + 1);
memcpy (r, p, q - p);
r[q - p] = 0;
strcat (r, SSDATA (login));
char *s = lispstpcpy (&r[q - p], login);
r[q - p] = upcase ((unsigned char) r[q - p]);
strcat (r, q + 1);
strcpy (s, q + 1);
full = build_string (r);
SAFE_FREE ();
}

View file

@ -4076,23 +4076,23 @@ xrdb_get_resource (XrmDatabase rdb, Lisp_Object attribute, Lisp_Object class, Li
/* Start with emacs.FRAMENAME for the name (the specific one)
and with `Emacs' for the class key (the general one). */
lispstpcpy (name_key, Vx_resource_name);
lispstpcpy (class_key, Vx_resource_class);
char *nz = lispstpcpy (name_key, Vx_resource_name);
char *cz = lispstpcpy (class_key, Vx_resource_class);
strcat (class_key, ".");
strcat (class_key, SSDATA (class));
*cz++ = '.';
cz = lispstpcpy (cz, class);
if (!NILP (component))
{
strcat (class_key, ".");
strcat (class_key, SSDATA (subclass));
*cz++ = '.';
lispstpcpy (cz, subclass);
strcat (name_key, ".");
strcat (name_key, SSDATA (component));
*nz++ = '.';
nz = lispstpcpy (nz, component);
}
strcat (name_key, ".");
strcat (name_key, SSDATA (attribute));
*nz++ = '.';
lispstpcpy (nz, attribute);
char *value = x_get_string_resource (rdb, name_key, class_key);
SAFE_FREE();

View file

@ -1839,12 +1839,12 @@ xg_get_file_with_chooser (struct frame *f,
if (x_gtk_file_dialog_help_text)
{
msgbuf[0] = '\0';
char *z = msgbuf;
/* Gtk+ 2.10 has the file name text entry box integrated in the dialog.
Show the C-l help text only for versions < 2.10. */
if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE)
strcat (msgbuf, "\nType C-l to display a file name text entry box.\n");
strcat (msgbuf, "\nIf you don't like this file selector, use the "
z = stpcpy (z, "\nType C-l to display a file name text entry box.\n");
strcpy (z, "\nIf you don't like this file selector, use the "
"corresponding\nkey binding or customize "
"use-file-dialog to turn it off.");

View file

@ -276,7 +276,7 @@ bool input_pending;
/* True if more input was available last time we read an event.
Since redisplay can take a significant amount of time and is not
indispensible to perform the user's commands, when input arrives
indispensable to perform the user's commands, when input arrives
"too fast", Emacs skips redisplay. More specifically, if the next
command has already been input when we finish the previous command,
we skip the intermediate redisplay.

View file

@ -438,7 +438,8 @@ Updated by Christian Limpach (chris@nice.ch)
if (EQ (selection, Qnil)) selection = QPRIMARY;
if (EQ (selection, Qt)) selection = QSECONDARY;
return ns_get_pb_change_count (selection)
== ns_get_our_change_count_for (selection);
== ns_get_our_change_count_for (selection)
? Qt : Qnil;
}

View file

@ -255,9 +255,9 @@ tparam1 (const char *string, char *outstring, int len,
}
*op = 0;
while (doup-- > 0)
strcat (op, up);
op = stpcpy (op, up);
while (doleft-- > 0)
strcat (op, left);
op = stpcpy (op, left);
return outstring;
}

View file

@ -3405,10 +3405,10 @@ sys_readdir (DIR *dirp)
int ln;
strcpy (filename, dir_pathname);
ln = strlen (filename) - 1;
if (!IS_DIRECTORY_SEP (filename[ln]))
strcat (filename, "\\");
strcat (filename, "*");
ln = strlen (filename);
if (!IS_DIRECTORY_SEP (filename[ln - 1]))
filename[ln++] = '\\';
strcpy (filename + ln, "*");
/* Note: No need to resolve symlinks in FILENAME, because
FindFirst opens the directory that is the target of a
@ -4969,7 +4969,7 @@ stat_worker (const char * path, struct stat * buf, int follow_symlinks)
{
/* Make sure root directories end in a slash. */
if (!IS_DIRECTORY_SEP (name[len-1]))
strcat (name, "\\");
strcpy (name + len, "\\");
if (GetDriveType (name) < 2)
{
errno = ENOENT;
@ -5438,8 +5438,7 @@ symlink (char const *filename, char const *linkname)
p--;
if (p > linkfn)
strncpy (tem, linkfn, p - linkfn);
tem[p - linkfn] = '\0';
strcat (tem, filename);
strcpy (tem + (p - linkfn), filename);
dir_access = faccessat (AT_FDCWD, tem, D_OK, AT_EACCESS);
}
else

View file

@ -1256,9 +1256,9 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
if (wv->key != NULL)
{
out_string = SAFE_ALLOCA (strlen (wv->name) + strlen (wv->key) + 2);
strcpy (out_string, wv->name);
strcat (out_string, "\t");
strcat (out_string, wv->key);
p = stpcpy (out_string, wv->name);
p = stpcpy (p, "\t");
strcpy (p, wv->key);
}
else
out_string = (char *)wv->name;

View file

@ -1665,10 +1665,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
if (egetenv ("CMDPROXY"))
strcpy (cmdname, egetenv ("CMDPROXY"));
else
{
lispstpcpy (cmdname, Vinvocation_directory);
strcat (cmdname, "cmdproxy.exe");
}
strcpy (lispstpcpy (cmdname, Vinvocation_directory), "cmdproxy.exe");
/* Can't use unixtodos_filename here, since that needs its file
name argument encoded in UTF-8. */
@ -3183,18 +3180,20 @@ get_lcid_callback (LPTSTR locale_num_str)
if (GetLocaleInfo (try_lcid, LOCALE_SABBREVLANGNAME,
locval, LOCALE_NAME_MAX_LENGTH))
{
size_t locval_len;
/* This is for when they only specify the language, as in "ENU". */
if (stricmp (locval, lname) == 0)
{
found_lcid = try_lcid;
return FALSE;
}
strcat (locval, "_");
locval_len = strlen (locval);
strcpy (locval + locval_len, "_");
if (GetLocaleInfo (try_lcid, LOCALE_SABBREVCTRYNAME,
locval + strlen (locval), LOCALE_NAME_MAX_LENGTH))
locval + locval_len + 1, LOCALE_NAME_MAX_LENGTH))
{
size_t locval_len = strlen (locval);
locval_len = strlen (locval);
if (strnicmp (locval, lname, locval_len) == 0
&& (lname[locval_len] == '.'
|| lname[locval_len] == '\0'))

View file

@ -1710,13 +1710,14 @@ xic_create_fontsetname (const char *base_fontname, int motif)
{
const char *sep = motif ? ";" : ",";
char *fontsetname;
char *z;
/* Make a fontset name from the base font name. */
if (xic_default_fontset == base_fontname)
{
/* There is no base font name, use the default. */
fontsetname = xmalloc (strlen (base_fontname) + 2);
strcpy (fontsetname, base_fontname);
z = stpcpy (fontsetname, base_fontname);
}
else
{
@ -1737,9 +1738,9 @@ xic_create_fontsetname (const char *base_fontname, int motif)
Use the specified font plus the default. */
fontsetname = xmalloc (strlen (base_fontname)
+ strlen (xic_default_fontset) + 3);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, xic_default_fontset);
z = stpcpy (fontsetname, base_fontname);
z = stpcpy (z, sep);
z = stpcpy (z, xic_default_fontset);
}
else
{
@ -1800,27 +1801,26 @@ xic_create_fontsetname (const char *base_fontname, int motif)
/* Build the font spec that matches all. */
len = p - p2 + strlen (allcs) + strlen (all) + strlen (allfamilies) + 1;
font_all = alloca (len);
strcpy (font_all, allfamilies);
strcat (font_all, all);
memcpy (font_all + strlen (all) + strlen (allfamilies), p2, p - p2);
strcpy (font_all + strlen (all) + strlen (allfamilies) + (p - p2),
allcs);
z = stpcpy (font_all, allfamilies);
z = stpcpy (z, all);
memcpy (z, p2, p - p2);
strcpy (z + (p - p2), allcs);
/* Build the actual font set name. */
len = strlen (base_fontname) + strlen (font_allcs)
+ strlen (font_allfamilies) + strlen (font_all) + 5;
fontsetname = xmalloc (len);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, font_allcs);
strcat (fontsetname, sep);
strcat (fontsetname, font_allfamilies);
strcat (fontsetname, sep);
strcat (fontsetname, font_all);
z = stpcpy (fontsetname, base_fontname);
z = stpcpy (z, sep);
z = stpcpy (z, font_allcs);
z = stpcpy (z, sep);
z = stpcpy (z, font_allfamilies);
z = stpcpy (z, sep);
z = stpcpy (z, font_all);
}
}
if (motif)
return strcat (fontsetname, ":");
strcpy (z, ":");
return fontsetname;
}
#endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */

View file

@ -232,9 +232,10 @@ gethomedir (void)
if (ptr == NULL)
return xstrdup ("/");
copy = xmalloc (strlen (ptr) + 2);
strcpy (copy, ptr);
return strcat (copy, "/");
ptrdiff_t len = strlen (ptr);
copy = xmalloc (len + 2);
strcpy (copy + len, "/");
return memcpy (copy, ptr, len);
}
@ -334,6 +335,7 @@ get_user_app (const char *class)
return db;
}
static char const xdefaults[] = ".Xdefaults";
static XrmDatabase
get_user_db (Display *display)
@ -351,16 +353,12 @@ get_user_db (Display *display)
db = XrmGetStringDatabase (xdefs);
else
{
char *home;
char *xdefault;
home = gethomedir ();
xdefault = xmalloc (strlen (home) + sizeof ".Xdefaults");
strcpy (xdefault, home);
strcat (xdefault, ".Xdefaults");
db = XrmGetFileDatabase (xdefault);
xfree (home);
xfree (xdefault);
char *home = gethomedir ();
ptrdiff_t homelen = strlen (home);
char *filename = xrealloc (home, homelen + sizeof xdefaults);
strcpy (filename + homelen, xdefaults);
db = XrmGetFileDatabase (filename);
xfree (filename);
}
#ifdef HAVE_XSCREENRESOURCESTRING
@ -380,24 +378,22 @@ static XrmDatabase
get_environ_db (void)
{
XrmDatabase db;
char *p;
char *path = 0;
char *p = getenv ("XENVIRONMENT");
char *filename = 0;
if ((p = getenv ("XENVIRONMENT")) == NULL)
if (!p)
{
static char const xdefaults[] = ".Xdefaults-";
char *home = gethomedir ();
char const *host = SSDATA (Vsystem_name);
ptrdiff_t pathsize = (strlen (home) + sizeof xdefaults
+ SBYTES (Vsystem_name));
path = xrealloc (home, pathsize);
strcat (strcat (path, xdefaults), host);
p = path;
ptrdiff_t homelen = strlen (home);
ptrdiff_t filenamesize = (homelen + sizeof xdefaults
+ SBYTES (Vsystem_name));
p = filename = xrealloc (home, filenamesize);
lispstpcpy (stpcpy (filename + homelen, xdefaults), Vsystem_name);
}
db = XrmGetFileDatabase (p);
xfree (path);
xfree (filename);
return db;
}

View file

@ -53,7 +53,7 @@ static int ice_fd = -1;
/* A flag that says if we are in shutdown interactions or not. */
static int doing_interact;
static bool doing_interact;
/* The session manager object for the session manager connection. */
@ -123,9 +123,9 @@ x_session_check_input (int fd, void *data)
kbd_buffer_store_event (&emacs_event);
}
/* Return non-zero if we have a connection to a session manager. */
/* Return true if we have a connection to a session manager. */
int
bool
x_session_have_connection (void)
{
return ice_fd != -1;
@ -138,7 +138,7 @@ x_session_have_connection (void)
static void
smc_interact_CB (SmcConn smcConn, SmPointer clientData)
{
doing_interact = True;
doing_interact = true;
emacs_event.kind = SAVE_SESSION_EVENT;
emacs_event.arg = Qnil;
}
@ -230,8 +230,7 @@ smc_save_yourself_CB (SmcConn smcConn,
props[props_idx]->vals[vp_idx++].value = emacs_program;
smid_opt = xmalloc (strlen (SMID_OPT) + strlen (client_id) + 1);
strcpy (smid_opt, SMID_OPT);
strcat (smid_opt, client_id);
strcpy (stpcpy (smid_opt, SMID_OPT), client_id);
props[props_idx]->vals[vp_idx].length = strlen (smid_opt);
props[props_idx]->vals[vp_idx++].value = smid_opt;
@ -242,8 +241,7 @@ smc_save_yourself_CB (SmcConn smcConn,
if (cwd)
{
chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1);
strcpy (chdir_opt, CHDIR_OPT);
strcat (chdir_opt, cwd);
strcpy (stpcpy (chdir_opt, CHDIR_OPT), cwd);
props[props_idx]->vals[vp_idx].length = strlen (chdir_opt);
props[props_idx]->vals[vp_idx++].value = chdir_opt;
@ -400,15 +398,15 @@ x_session_initialize (struct x_display_info *dpyinfo)
ptrdiff_t name_len = 0;
ice_fd = -1;
doing_interact = False;
doing_interact = false;
/* Check if we where started by the session manager. If so, we will
have a previous id. */
if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id))
if (! NILP (Vx_session_previous_id) && STRINGP (Vx_session_previous_id))
previous_id = SSDATA (Vx_session_previous_id);
/* Construct the path to the Emacs program. */
if (! EQ (Vinvocation_directory, Qnil))
if (! NILP (Vinvocation_directory))
name_len += SBYTES (Vinvocation_directory);
name_len += SBYTES (Vinvocation_name);
@ -417,7 +415,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
emacs_program = xmalloc (name_len + 1);
char *z = emacs_program;
if (! EQ (Vinvocation_directory, Qnil))
if (! NILP (Vinvocation_directory))
z = lispstpcpy (z, Vinvocation_directory);
lispstpcpy (z, Vinvocation_name);
@ -491,21 +489,19 @@ is told to abort the window system shutdown.
Do not call this function yourself. */)
(Lisp_Object event)
{
int kill_emacs = CONSP (event) && CONSP (XCDR (event))
&& EQ (Qt, XCAR (XCDR (event)));
bool kill_emacs = (CONSP (event) && CONSP (XCDR (event))
&& EQ (Qt, XCAR (XCDR (event))));
/* Check doing_interact so that we don't do anything if someone called
this at the wrong time. */
if (doing_interact && ! kill_emacs)
{
Bool cancel_shutdown = False;
cancel_shutdown = ! EQ (call0 (intern ("emacs-session-save")), Qnil);
bool cancel_shutdown = ! NILP (call0 (intern ("emacs-session-save")));
SmcInteractDone (smc_conn, cancel_shutdown);
SmcSaveYourselfDone (smc_conn, True);
doing_interact = False;
doing_interact = false;
}
else if (kill_emacs)
{
@ -513,7 +509,7 @@ Do not call this function yourself. */)
prevent. Fix this in next version. */
Fkill_emacs (Qnil);
#if 0
#if false
/* This will not be reached, but we want kill-emacs-hook to be run. */
SmcCloseConnection (smc_conn, 0, 0);
ice_connection_closed ();

View file

@ -1107,7 +1107,7 @@ extern void initialize_frame_menubar (struct frame *);
/* Defined in xsmfns.c */
#ifdef HAVE_X_SM
extern void x_session_initialize (struct x_display_info *dpyinfo);
extern int x_session_have_connection (void);
extern bool x_session_have_connection (void);
extern void x_session_close (void);
#endif

View file

@ -143,7 +143,7 @@
2014-10-22 Noam Postavsky <npostavs@users.sourceforget.net>
* test/automated/process-tests.el (process-test-quoted-batfile):
* automated/process-tests.el (process-test-quoted-batfile):
New test.
2014-10-20 Glenn Morris <rgm@gnu.org>

View file

@ -62,7 +62,7 @@
'(nil 1 1 2 nil)))))
(ert-deftest let-alist-remove-dot ()
"Remove firt dot from symbol."
"Remove first dot from symbol."
(should (equal (let-alist--remove-dot 'hi) 'hi))
(should (equal (let-alist--remove-dot '.hi) 'hi))
(should (equal (let-alist--remove-dot '..hi) '.hi)))

View file

@ -7,6 +7,11 @@ let c = 1,
var e = 100500,
+ 1;
function test ()
{
return /[/]/.test ('/') // (bug#19397)
}
var f = bar('/protocols/')
baz();