1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00

auto upstream

This commit is contained in:
Joakim Verona 2013-04-18 08:33:35 +02:00
commit 2c9934db35
23 changed files with 1021 additions and 745 deletions

View File

@ -1,3 +1,11 @@
2013-04-18 Glenn Morris <rgm@gnu.org>
* configure.ac (AC_PROG_LN_S): Remove, too restrictive.
(LN_S_FILEONLY): New output variable.
* Makefile.in (LN_S): Remove.
(LN_S_FILEONLY): New, set by configure.
(install-arch-dep): Use LN_S_FILEONLY rather than LN_S.
2013-04-12 Ken Brown <kbrown@cornell.edu>
* configure.ac (canonical): Adapt to 64-bit Cygwin, for which

View File

@ -253,7 +253,8 @@ INSTALL_INFO = @INSTALL_INFO@
# By default, we uphold the dignity of our programs.
INSTALL_STRIP =
MKDIR_P = @MKDIR_P@
LN_S = @LN_S@
# Create a link to a file in the same directory as the target.
LN_S_FILEONLY = @LN_S_FILEONLY@
# We use gzip to compress installed .el files.
GZIP_PROG = @GZIP_PROG@
@ -455,7 +456,7 @@ install-arch-dep: src install-arch-indep install-doc
chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) || true; \
if test "x${NO_BIN_LINK}" = x; then \
rm -f $(DESTDIR)${bindir}/$(EMACS) ; \
cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \
cd $(DESTDIR)${bindir} && $(LN_S_FILEONLY) $(EMACSFULL) $(EMACS); \
fi; \
else \
subdir=${ns_appresdir}/site-lisp; \

View File

@ -801,7 +801,38 @@ dnl AC_PROG_MKDIR_P
dnl if test "x$RANLIB" = x; then
dnl AC_PROG_RANLIB
dnl fi
AC_PROG_LN_S
dnl Sadly, AC_PROG_LN_S is too restrictive. It also tests whether links
dnl can be made to directories. This is not relevant for our usage, and
dnl excludes some cases that work fine for us. Eg MS Windows or files
dnl hosted on AFS, both examples where simple links work, but links to
dnl directories fail. We use a cut-down version instead.
dnl AC_PROG_LN_S
AC_MSG_CHECKING([whether ln -s works for files in the same directory])
rm -f conf$$ conf$$.file
LN_S_FILEONLY='cp -p'
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
LN_S_FILEONLY='ln -s'
elif ln conf$$.file conf$$ 2>/dev/null; then
LN_S_FILEONLY=ln
fi
fi
rm -f conf$$ conf$$.file
if test "$LN_S_FILEONLY" = "ln -s"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, using $LN_S_FILEONLY])
fi
AC_SUBST(LN_S_FILEONLY)
AC_PATH_PROG(INSTALL_INFO, install-info, :,
$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)

View File

@ -1,3 +1,7 @@
2013-04-18 Leo Liu <sdl.web@gmail.com>
* NEWS: Mention new key ? for describe-prefix-bindings.
2013-04-15 Christopher Schmidt <christopher@ch.ristopher.com>
* NEWS: Mention separation of package descriptor and name of

View File

@ -37,6 +37,8 @@ It is no longer needed, as the crt*.o files are no longer linked specially.
* Changes in Emacs 24.4
** Key ? also describes prefix bindings like C-h.
+++
** `apropos-variable' is now `apropos-user-option'
`apropos-user-option' shows all user options while `apropos-variable'
@ -323,7 +325,18 @@ file using `set-file-extended-attributes'.
* Lisp Changes in Emacs 24.4
** `dont-compile' is declared obsolete.
** Obsoleted functions:
*** `dont-compile'
*** `lisp-complete-symbol'
*** `field-complete'
*** `minibuffer-completion-contents'
** `with-wrapper-hook' is obsoleted by `add-function'.
The few hooks that used with-wrapper-hook are replaced as follows:
*** `abbrev-expand-function' obsoletes `abbrev-expand-functions'.
*** `completion-in-region-function' obsoletes `completion-in-region-functions'.
*** `filter-buffer-substring-function' obsoletes `filter-buffer-substring-functions'.
** `get-upcase-table' is obsoleted by the new `case-table-get-table'.

View File

@ -1,3 +1,61 @@
2013-04-18 Tassilo Horn <tsdh@gnu.org>
* files.el (auto-mode-alist): Delete OpenDocument and StarOffice
file extensions from the archive-mode entry in order to prefer
doc-view-mode-maybe with archive-mode as fallback (bug#14188).
2013-04-18 Leo Liu <sdl.web@gmail.com>
* bindings.el (help-event-list): Add ?\?.
2013-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (with-wrapper-hook): Declare obsolete.
* simple.el (filter-buffer-substring-function): New hook.
(filter-buffer-substring): Use it.
(filter-buffer-substring-functions): Mark obsolete.
* minibuffer.el (completion-in-region-function): New hook.
(completion-in-region): Use it.
(completion-in-region-functions): Mark obsolete.
* mail/mailabbrev.el (mail-abbrevs-setup): Use abbrev-expand-function.
* abbrev.el (abbrev-expand-function): New hook.
(expand-abbrev): Use it.
(abbrev-expand-functions): Mark obsolete.
* emacs-lisp/nadvice.el (advice--where-alist): Add :filter-args
and :filter-return.
2013-04-17 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (python-nav--syntactically): Fix cornercases
and do not care about match data.
2013-04-17 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/lisp.el (lisp-completion-at-point): Provide specialized
completion tables when completing error conditions and
`declare' arguments.
(lisp-complete-symbol, field-complete): Mark as obsolete.
(check-parens): Unmatched parens are user errors.
* minibuffer.el (minibuffer-completion-contents): Mark as obsolete.
2013-04-17 Michal Nazarewicz <mina86@mina86.com>
* textmodes/flyspell.el (flyspell-check-pre-word-p): Return nil if
command changed buffer (ie. `flyspell-pre-buffer' is not current
buffer), which prevents making decisions based on invalid value of
`flyspell-pre-point' in the wrong buffer. Most notably, this used to
cause an error when `flyspell-pre-point' was nil after switching
buffers.
(flyspell-post-command-hook): No longer needs to change buffers when
checking pre-word. While at it remove unnecessary progn.
2013-04-17 Nicolas Richard <theonewiththeevillook@yahoo.fr> (tiny change)
* textmodes/ispell.el (ispell-add-per-file-word-list):
Fix `flyspell-correct-word-before-point' error when accepting
words and `coment-padding' is an integer by using
`comment-normalize-vars' (Bug #14214).
2013-04-17 Fabián Ezequiel Gallina <fgallina@gnu.org>
New defun movement commands.

View File

@ -532,7 +532,7 @@ This is the first thing that `expand-abbrev' does, and so this may change
the current abbrev table before abbrev lookup happens."
:type 'hook
:group 'abbrev-mode)
(make-obsolete-variable 'pre-abbrev-expand-hook 'abbrev-expand-functions "23.1")
(make-obsolete-variable 'pre-abbrev-expand-hook 'abbrev-expand-function "23.1")
(defun clear-abbrev-table (table)
"Undefine all abbrevs in abbrev table TABLE, leaving it empty."
@ -832,10 +832,12 @@ see `define-abbrev' for details."
value))
(defvar abbrev-expand-functions nil
"Wrapper hook around `expand-abbrev'.
The functions on this special hook are called with one argument:
a function that performs the abbrev expansion. It should return
the abbrev symbol if expansion took place.")
"Wrapper hook around `expand-abbrev'.")
(make-obsolete-variable 'abbrev-expand-functions 'abbrev-expand-function "24.4")
(defvar abbrev-expand-function #'abbrev--default-expand
"Function to perform abbrev expansion.
Takes no argument and should return the abbrev symbol if expansion took place.")
(defun expand-abbrev ()
"Expand the abbrev before point, if there is an abbrev there.
@ -844,6 +846,9 @@ Returns the abbrev symbol, if expansion took place. (The actual
return value is that of `abbrev-insert'.)"
(interactive)
(run-hooks 'pre-abbrev-expand-hook)
(funcall abbrev-expand-function))
(defun abbrev--default-expand ()
(with-wrapper-hook abbrev-expand-functions ()
(pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point)))
(when sym

View File

@ -675,7 +675,7 @@ language you are using."
(garbage-collect)
(setq help-event-list '(help f1))
(setq help-event-list '(help f1 ?\?))
(make-variable-buffer-local 'minor-mode-overriding-map-alist)

View File

@ -46,6 +46,12 @@ This affects `insert-parentheses' and `insert-pair'."
:group 'lisp)
(defvar forward-sexp-function nil
;; FIXME:
;; - for some uses, we may want a "sexp-only" version, which only
;; jumps over a well-formed sexp, rather than some dwimish thing
;; like jumping from an "else" back up to its "if".
;; - for up-list, we could use the "sexp-only" behavior as well
;; to treat the dwimish halfsexp as a form of "up-list" step.
"If non-nil, `forward-sexp' delegates to this function.
Should take the same arguments and behave similarly to `forward-sexp'.")
@ -618,9 +624,10 @@ character."
;; "Unbalanced parentheses", but those may not be so
;; accurate/helpful, e.g. quotes may actually be
;; mismatched.
(error "Unmatched bracket or quote"))))
(user-error "Unmatched bracket or quote"))))
(defun field-complete (table &optional predicate)
(declare (obsolete completion-in-region "24.4"))
(let ((minibuffer-completion-table table)
(minibuffer-completion-predicate predicate)
;; This made sense for lisp-complete-symbol, but for
@ -645,6 +652,7 @@ considered. If the symbol starts just after an open-parenthesis, only
symbols with function definitions are considered. Otherwise, all
symbols with function definitions, values or properties are
considered."
(declare (obsolete completion-at-point "24.4"))
(interactive)
(let* ((data (lisp-completion-at-point predicate))
(plist (nthcdr 3 data)))
@ -666,25 +674,6 @@ considered."
(skip-syntax-forward "'")
(point))
(scan-error pos)))
(predicate
(or predicate
(save-excursion
(goto-char beg)
(if (not (eq (char-before) ?\())
(lambda (sym) ;why not just nil ? -sm
(or (boundp sym) (fboundp sym)
(symbol-plist sym)))
;; Looks like a funcall position. Let's double check.
(if (condition-case nil
(progn (up-list -2) (forward-char 1)
(eq (char-after) ?\())
(error nil))
;; If the first element of the parent list is an open
;; paren we are probably not in a funcall position.
;; Maybe a `let' varlist or something.
nil
;; Else, we assume that a function name is expected.
'fboundp)))))
(end
(unless (or (eq beg (point-max))
(member (char-syntax (char-after beg)) '(?\" ?\( ?\))))
@ -694,12 +683,51 @@ considered."
(forward-sexp 1)
(when (>= (point) pos)
(point)))
(scan-error pos)))))
(scan-error pos))))
(funpos (eq (char-before beg) ?\()) ;t if in function position.
(table-etc
(if (not funpos)
;; FIXME: We could look at the first element of the list and
;; use it to provide a more specific completion table in some
;; cases. E.g. filter out keywords that are not understood by
;; the macro/function being called.
(list nil obarray ;Could be anything.
:annotation-function
(lambda (str) (if (fboundp (intern-soft str)) " <f>")))
;; Looks like a funcall position. Let's double check.
(save-excursion
(goto-char (1- beg))
(let ((parent
(condition-case nil
(progn (up-list -1) (forward-char 1)
(let ((c (char-after)))
(if (eq c ?\() ?\(
(if (memq (char-syntax c) '(?w ?_))
(read (current-buffer))))))
(error nil))))
(pcase parent
;; FIXME: Rather than hardcode special cases here,
;; we should use something like a symbol-property.
(`declare
(list t (mapcar (lambda (x) (symbol-name (car x)))
(delete-dups
(append
macro-declarations-alist
defun-declarations-alist)))))
((or `condition-case `condition-case-unless-debug)
(list t obarray
:predicate (lambda (sym) (get sym 'error-conditions))))
(_ (list nil obarray #'fboundp))))))))
(when end
(list beg end obarray
:predicate predicate
:annotation-function
(unless (eq predicate 'fboundp)
(lambda (str) (if (fboundp (intern-soft str)) " <f>"))))))))
(let ((tail (if (null (car table-etc))
(cdr table-etc)
(cons
(if (memq (char-syntax (char-after end))
'(?\s ?>))
(cadr table-etc)
(apply-partially 'completion-table-with-terminator
" " (cadr table-etc)))
(cddr table-etc)))))
`(,beg ,end ,@tail))))))
;;; lisp.el ends here

View File

@ -44,7 +44,9 @@
(:after-until "\300\302\002\"\206\013\000\300\301\002\"\207" 4)
(:after-while "\300\302\002\"\205\013\000\300\301\002\"\207" 4)
(:before-until "\300\301\002\"\206\013\000\300\302\002\"\207" 4)
(:before-while "\300\301\002\"\205\013\000\300\302\002\"\207" 4))
(:before-while "\300\301\002\"\205\013\000\300\302\002\"\207" 4)
(:filter-args "\300\302\301!\"\207" 5)
(:filter-return "\301\300\302\"!\207" 5))
"List of descriptions of how to add a function.
Each element has the form (WHERE BYTECODE STACK) where:
WHERE is a keyword indicating where the function is added.
@ -208,7 +210,6 @@ WHERE is a symbol to select an entry in `advice--where-alist'."
;;;###autoload
(defmacro add-function (where place function &optional props)
;; TODO:
;; - obsolete with-wrapper-hook (mostly requires buffer-local support).
;; - provide some kind of control over ordering. E.g. debug-on-entry, ELP
;; and tracing want to stay first.
;; - maybe let `where' specify some kind of predicate and use it
@ -231,6 +232,8 @@ call OLDFUN here:
`:before-until' (lambda (&rest r) (or (apply FUNCTION r) (apply OLDFUN r)))
`:after-while' (lambda (&rest r) (and (apply OLDFUN r) (apply FUNCTION r)))
`:after-until' (lambda (&rest r) (or (apply OLDFUN r) (apply FUNCTION r)))
`:filter-args' (lambda (&rest r) (apply OLDFUN (funcall FUNCTION r)))
`:filter-return'(lambda (&rest r) (funcall FUNCTION (apply OLDFUN r)))
If FUNCTION was already added, do nothing.
PROPS is an alist of additional properties, among which the following have
a special meaning:

View File

@ -2312,7 +2312,7 @@ since only a single case-insensitive search through the alist is made."
("\\.\\(\
arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\
ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode)
("\\.\\(sx[dmicw]\\|od[fgpst]\\|oxt\\)\\'" . archive-mode) ;OpenOffice.org
("\\.oxt\\'" . archive-mode) ;(Open|Libre)Office extensions.
("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode) ; Debian/Opkg packages.
;; Mailer puts message to be edited in
;; /tmp/Re.... or Message

View File

@ -182,7 +182,8 @@ no aliases, which is represented by this being a table with no entries.)")
(nth 5 (file-attributes mail-personal-alias-file)))
(build-mail-abbrevs)))
(mail-abbrevs-sync-aliases)
(add-hook 'abbrev-expand-functions 'mail-abbrev-expand-wrapper nil t)
(add-function :around (local 'abbrev-expand-function)
#'mail-abbrev-expand-wrapper)
(abbrev-mode 1))
(defun mail-abbrevs-enable ()

View File

@ -638,7 +638,8 @@ If ARGS are provided, then pass MESSAGE through `format'."
(defun minibuffer-completion-contents ()
"Return the user input in a minibuffer before point as a string.
That is what completion commands operate on."
That used to be what completion commands operate on."
(declare (obsolete minibuffer-contents "24.4"))
(buffer-substring (field-beginning) (point)))
(defun delete-minibuffer-contents ()
@ -1763,14 +1764,15 @@ variables.")
(exit-minibuffer))
(defvar completion-in-region-functions nil
"Wrapper hook around `completion-in-region'.
The functions on this special hook are called with 5 arguments:
NEXT-FUN START END COLLECTION PREDICATE.
NEXT-FUN is a function of four arguments (START END COLLECTION PREDICATE)
that performs the default operation. The other four arguments are like
the ones passed to `completion-in-region'. The functions on this hook
are expected to perform completion on START..END using COLLECTION
and PREDICATE, either by calling NEXT-FUN or by doing it themselves.")
"Wrapper hook around `completion-in-region'.")
(make-obsolete-variable 'completion-in-region-functions
'completion-in-region-function "24.4")
(defvar completion-in-region-function #'completion--in-region
"Function to perform the job of `completion-in-region'.
The function is called with 4 arguments: START END COLLECTION PREDICATE.
The arguments and expected return value are like the ones of
`completion-in-region'.")
(defvar completion-in-region--data nil)
@ -1792,6 +1794,9 @@ Point needs to be somewhere between START and END.
PREDICATE (a function called with no arguments) says when to
exit."
(cl-assert (<= start (point)) (<= (point) end))
(funcall completion-in-region-function start end collection predicate))
(defun completion--in-region (start end collection &optional predicate)
(with-wrapper-hook
;; FIXME: Maybe we should use this hook to provide a "display
;; completions" operation as well.

File diff suppressed because it is too large Load Diff

View File

@ -2015,10 +2015,10 @@ The following commands are available:
(org-add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local)
(org-add-hook 'pre-command-hook 'org-unhighlight nil 'local)
;; Make sure properties are removed when copying text
(make-local-variable 'filter-buffer-substring-functions)
(add-hook 'filter-buffer-substring-functions
(lambda (fun start end delete)
(substring-no-properties (funcall fun start end delete))))
(substring-no-properties (funcall fun start end delete)))
nil t)
(unless org-agenda-keep-modes
(setq org-agenda-follow-mode org-agenda-start-with-follow-mode
org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode

View File

@ -182,11 +182,11 @@ during idle time."
(org-set-local 'org-hide-leading-stars-before-indent-mode
org-hide-leading-stars)
(org-set-local 'org-hide-leading-stars t))
(make-local-variable 'filter-buffer-substring-functions)
(add-hook 'filter-buffer-substring-functions
(lambda (fun start end delete)
(org-indent-remove-properties-from-string
(funcall fun start end delete))))
(funcall fun start end delete)))
nil t)
(org-add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local)
(org-add-hook 'before-change-functions
'org-indent-notify-modified-headline nil 'local)
@ -213,7 +213,8 @@ during idle time."
(remove-hook 'filter-buffer-substring-functions
(lambda (fun start end delete)
(org-indent-remove-properties-from-string
(funcall fun start end delete))))
(funcall fun start end delete)))
t)
(remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local)
(remove-hook 'before-change-functions
'org-indent-notify-modified-headline 'local)

View File

@ -1192,28 +1192,32 @@ Returns nil if point is not in a def or class."
;; Ensure point moves forward.
(and (> beg-pos (point)) (goto-char beg-pos)))))
(defun python-nav--syntactically (fn poscompfn &optional pos)
"Move to point using FN ignoring non-code or paren context.
FN must take no arguments and could be used to set match-data.
POSCOMPFN is a two arguments function used to compare current and
previous point after it is moved using FN, this is normally a
less-than or greater-than comparison. Optional argument POS is
internally used in recursive calls and should not be explicitly
passed."
(let* ((newpos
(and (funcall fn)
(save-match-data
(and
(not (python-syntax-context-type))
(point-marker)))))
(current-match-data (match-data)))
(cond ((or (and (not pos) newpos)
(and pos newpos (funcall poscompfn newpos pos)))
(set-match-data current-match-data)
(point-marker))
((and (not pos) (not newpos)) nil)
(t (python-nav--syntactically
fn poscompfn (point-marker))))))
(defun python-nav--syntactically (fn poscompfn &optional contextfn)
"Move point using FN avoiding places with specific context.
FN must take no arguments. POSCOMPFN is a two arguments function
used to compare current and previous point after it is moved
using FN, this is normally a less-than or greater-than
comparison. Optional argument CONTEXTFN defaults to
`python-syntax-context-type' and is used for checking current
point context, it must return a non-nil value if this point must
be skipped."
(let ((contextfn (or contextfn 'python-syntax-context-type))
(start-pos (point-marker))
(prev-pos))
(catch 'found
(while t
(let* ((newpos
(and (funcall fn) (point-marker)))
(context (funcall contextfn)))
(cond ((and (not context) newpos
(or (and (not prev-pos) newpos)
(and prev-pos newpos
(funcall poscompfn newpos prev-pos))))
(throw 'found (point-marker)))
((and newpos context)
(setq prev-pos (point)))
(t (when (not newpos) (goto-char start-pos))
(throw 'found nil))))))))
(defun python-nav--forward-defun (arg)
"Internal implementation of python-nav-{backward,forward}-defun.

View File

@ -3291,46 +3291,33 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
(defvar filter-buffer-substring-functions nil
"This variable is a wrapper hook around `filter-buffer-substring'.
Each member of the hook should be a function accepting four arguments:
\(FUN BEG END DELETE), where FUN is itself a function of three arguments
"This variable is a wrapper hook around `filter-buffer-substring'.")
(make-obsolete-variable 'filter-buffer-substring-functions
'filter-buffer-substring-function "24.4")
(defvar filter-buffer-substring-function #'buffer-substring--filter
"Function to perform the filtering in `filter-buffer-substring'.
The function is called with 3 arguments:
\(BEG END DELETE). The arguments BEG, END, and DELETE are the same
as those of `filter-buffer-substring' in each case.
The first hook function to be called receives a FUN equivalent
to the default operation of `filter-buffer-substring',
i.e. one that returns the buffer-substring between BEG and
END (processed by any `buffer-substring-filters'). Normally,
the hook function will call FUN and then do its own processing
of the result. The next hook function receives a FUN equivalent
to the previous hook function, calls it, and does its own
processing, and so on. The overall result is that of all hook
functions acting in sequence.
Any hook may choose not to call FUN though, in which case it
effectively replaces the default behavior with whatever it chooses.
Of course, a later hook function may do the same thing.")
It should return the buffer substring between BEG and END, after filtering.")
(defvar buffer-substring-filters nil
"List of filter functions for `filter-buffer-substring'.
Each function must accept a single argument, a string, and return
a string. The buffer substring is passed to the first function
in the list, and the return value of each function is passed to
the next. The final result (if `buffer-substring-filters' is
nil, this is the unfiltered buffer-substring) is passed to the
first function on `filter-buffer-substring-functions'.
the next.
As a special convention, point is set to the start of the buffer text
being operated on (i.e., the first argument of `filter-buffer-substring')
before these functions are called.")
(make-obsolete-variable 'buffer-substring-filters
'filter-buffer-substring-functions "24.1")
'filter-buffer-substring-function "24.1")
(defun filter-buffer-substring (beg end &optional delete)
"Return the buffer substring between BEG and END, after filtering.
The wrapper hook `filter-buffer-substring-functions' performs
the actual filtering. The obsolete variable `buffer-substring-filters'
is also consulted. If both of these are nil, no filtering is done.
The hook `filter-buffer-substring-function' performs the actual filtering.
By default, no filtering is done.
If DELETE is non-nil, the text between BEG and END is deleted
from the buffer.
@ -3338,9 +3325,12 @@ from the buffer.
This function should be used instead of `buffer-substring',
`buffer-substring-no-properties', or `delete-and-extract-region'
when you want to allow filtering to take place. For example,
major or minor modes can use `filter-buffer-substring-functions' to
major or minor modes can use `filter-buffer-substring-function' to
extract characters that are special to a buffer, and should not
be copied into other buffers."
(funcall filter-buffer-substring-function beg end delete))
(defun buffer-substring--filter (beg end &optional delete)
(with-wrapper-hook filter-buffer-substring-functions (beg end delete)
(cond
((or delete buffer-substring-filters)

View File

@ -1414,7 +1414,9 @@ Of course, a subsequent hook function may do the same thing.
Each hook function definition is used to construct the FUN passed
to the next hook function, if any. The last (or \"outermost\")
FUN is then called once."
(declare (indent 2) (debug (form sexp body)))
(declare (indent 2) (debug (form sexp body))
(obsolete "use a <foo>-function variable modified by add-function."
"24.4"))
;; We need those two gensyms because CL's lexical scoping is not available
;; for function arguments :-(
(let ((funs (make-symbol "funs"))

View File

@ -738,7 +738,7 @@ before the current command."
(let ((ispell-otherchars (ispell-get-otherchars)))
(cond
((not (and (numberp flyspell-pre-point)
(buffer-live-p flyspell-pre-buffer)))
(eq flyspell-pre-buffer (current-buffer))))
nil)
((and (eq flyspell-pre-pre-point flyspell-pre-point)
(eq flyspell-pre-pre-buffer flyspell-pre-buffer))
@ -956,11 +956,10 @@ Mostly we check word delimiters."
;; Prevent anything we do from affecting the mark.
deactivate-mark)
(if (flyspell-check-pre-word-p)
(with-current-buffer flyspell-pre-buffer
(save-excursion
'(flyspell-debug-signal-pre-word-checked)
(save-excursion
(goto-char flyspell-pre-point)
(flyspell-word))))
(goto-char flyspell-pre-point)
(flyspell-word)))
(if (flyspell-check-word-p)
(progn
'(flyspell-debug-signal-word-checked)
@ -974,16 +973,14 @@ Mostly we check word delimiters."
;; FLYSPELL-CHECK-PRE-WORD-P
(setq flyspell-pre-pre-buffer (current-buffer))
(setq flyspell-pre-pre-point (point)))
(progn
(setq flyspell-pre-pre-buffer nil)
(setq flyspell-pre-pre-point nil)
;; when a word is not checked because of a delayed command
;; we do not disable the ispell cache.
(if (and (symbolp this-command)
(setq flyspell-pre-pre-buffer nil)
(setq flyspell-pre-pre-point nil)
;; when a word is not checked because of a delayed command
;; we do not disable the ispell cache.
(when (and (symbolp this-command)
(get this-command 'flyspell-delayed))
(progn
(setq flyspell-word-cache-end -1)
(setq flyspell-word-cache-result '_)))))
(setq flyspell-word-cache-end -1)
(setq flyspell-word-cache-result '_)))
(while (and (not (input-pending-p)) (consp flyspell-changes))
(let ((start (car (car flyspell-changes)))
(stop (cdr (car flyspell-changes))))

View File

@ -4336,8 +4336,13 @@ Both should not be used to define a buffer-local dictionary."
(if (fboundp 'comment-padright)
;; Try and use the proper comment marker,
;; e.g. ";;" rather than ";".
(comment-padright comment-start
(comment-add nil))
(progn
;; XEmacs: comment-normalize-vars
;; (newcomment.el) only in >= 21.5
(and (fboundp 'comment-normalize-vars)
(comment-normalize-vars))
(comment-padright comment-start
(comment-add nil)))
comment-start)
" ")
"")

View File

@ -1,3 +1,9 @@
2013-04-17 Fabián Ezequiel Gallina <fgallina@gnu.org>
* automated/python-tests.el (python-nav-backward-defun-2)
(python-nav-backward-defun-3, python-nav-forward-defun-2)
(python-nav-forward-defun-3): New tests.
2013-04-17 Fabián Ezequiel Gallina <fgallina@gnu.org>
* automated/python-tests.el (python-nav-backward-defun-1)

View File

@ -718,6 +718,60 @@ class A(object): # A
(python-tests-look-at "class A(object): # A" -1)))
(should (not (python-nav-backward-defun)))))
(ert-deftest python-nav-backward-defun-2 ()
(python-tests-with-temp-buffer
"
def decoratorFunctionWithArguments(arg1, arg2, arg3):
'''print decorated function call data to stdout.
Usage:
@decoratorFunctionWithArguments('arg1', 'arg2')
def func(a, b, c=True):
pass
'''
def wwrap(f):
print 'Inside wwrap()'
def wrapped_f(*args):
print 'Inside wrapped_f()'
print 'Decorator arguments:', arg1, arg2, arg3
f(*args)
print 'After f(*args)'
return wrapped_f
return wwrap
"
(goto-char (point-max))
(should (= (save-excursion (python-nav-backward-defun))
(python-tests-look-at " def wrapped_f(*args):" -1)))
(should (= (save-excursion (python-nav-backward-defun))
(python-tests-look-at " def wwrap(f):" -1)))
(should (= (save-excursion (python-nav-backward-defun))
(python-tests-look-at "def decoratorFunctionWithArguments(arg1, arg2, arg3):" -1)))
(should (not (python-nav-backward-defun)))))
(ert-deftest python-nav-backward-defun-3 ()
(python-tests-with-temp-buffer
"
'''
def u(self):
pass
def v(self):
pass
def w(self):
pass
'''
class A(object):
pass
"
(goto-char (point-min))
(let ((point (python-tests-look-at "class A(object):")))
(should (not (python-nav-backward-defun)))
(should (= point (point))))))
(ert-deftest python-nav-forward-defun-1 ()
(python-tests-with-temp-buffer
"
@ -762,6 +816,60 @@ class A(object): # A
(python-tests-look-at "(self): # c")))
(should (not (python-nav-forward-defun)))))
(ert-deftest python-nav-forward-defun-2 ()
(python-tests-with-temp-buffer
"
def decoratorFunctionWithArguments(arg1, arg2, arg3):
'''print decorated function call data to stdout.
Usage:
@decoratorFunctionWithArguments('arg1', 'arg2')
def func(a, b, c=True):
pass
'''
def wwrap(f):
print 'Inside wwrap()'
def wrapped_f(*args):
print 'Inside wrapped_f()'
print 'Decorator arguments:', arg1, arg2, arg3
f(*args)
print 'After f(*args)'
return wrapped_f
return wwrap
"
(goto-char (point-min))
(should (= (save-excursion (python-nav-forward-defun))
(python-tests-look-at "(arg1, arg2, arg3):")))
(should (= (save-excursion (python-nav-forward-defun))
(python-tests-look-at "(f):")))
(should (= (save-excursion (python-nav-forward-defun))
(python-tests-look-at "(*args):")))
(should (not (python-nav-forward-defun)))))
(ert-deftest python-nav-forward-defun-3 ()
(python-tests-with-temp-buffer
"
class A(object):
pass
'''
def u(self):
pass
def v(self):
pass
def w(self):
pass
'''
"
(goto-char (point-min))
(let ((point (python-tests-look-at "(object):")))
(should (not (python-nav-forward-defun)))
(should (= point (point))))))
(ert-deftest python-nav-beginning-of-statement-1 ()
(python-tests-with-temp-buffer
"