Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
50bfa18a
Commit
50bfa18a
authored
Nov 22, 2007
by
Stefan Monnier
Browse files
(beginning-of-defun-raw): Pass `arg' down to beginning-of-defun-function.
parent
a352dec1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
etc/NEWS
etc/NEWS
+3
-0
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/emacs-lisp/lisp.el
lisp/emacs-lisp/lisp.el
+20
-9
No files found.
etc/NEWS
View file @
50bfa18a
...
...
@@ -383,6 +383,9 @@ because they clash with commands provided by dirtrack.el. Use
* Lisp Changes in Emacs 23.1
** `beginning-of-defun-function' now takes one argument, the count
given to `beginning-of-defun'.
+++
** New function `match-substitute-replacement' returns the result of
`replace-match' without actually using it in the buffer.
...
...
lisp/ChangeLog
View file @
50bfa18a
2007-11-22 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/lisp.el (beginning-of-defun-raw): Pass `arg' down to
beginning-of-defun-function.
2007-11-22 Reiner Steib <Reiner.Steib@gmx.de>
* mail/hashcash.el: Move from ../gnus. Add hashcash payments to email.
...
...
lisp/emacs-lisp/lisp.el
View file @
50bfa18a
...
...
@@ -175,9 +175,10 @@ normal recipe (see `beginning-of-defun'). Major modes can define this
if defining `defun-prompt-regexp' is not sufficient to handle the mode's
needs.
The function (of no args) should go to the line on which the current
defun starts, and return non-nil, or should return nil if it can't
find the beginning."
)
The function takes the same argument as `beginning-of-defun' and should
behave similarly, returning non-nil if it found the beginning of a defun.
Ideally it should move to a point right before an open-paren which encloses
the body of the defun."
)
(
defun
beginning-of-defun
(
&optional
arg
)
"Move backward to the beginning of a defun.
...
...
@@ -218,12 +219,22 @@ is called as a function to find the defun's beginning."
(
unless
arg
(
setq
arg
1
))
(
cond
(
beginning-of-defun-function
(
if
(
>
arg
0
)
(
dotimes
(
i
arg
)
(
funcall
beginning-of-defun-function
))
;; Better not call end-of-defun-function directly, in case
;; it's not defined.
(
end-of-defun
(
-
arg
))))
(
condition-case
nil
(
funcall
beginning-of-defun-function
arg
)
;; We used to define beginning-of-defun-function as taking no argument
;; but that makes it impossible to implement correct forward motion:
;; we used to use end-of-defun for that, but it's not supposed to do
;; the same thing (it moves to the end of a defun not to the beginning
;; of the next).
;; In case the beginning-of-defun-function uses the old calling
;; convention, fallback on the old implementation.
(
wrong-number-of-arguments
(
if
(
>
arg
0
)
(
dotimes
(
i
arg
)
(
funcall
beginning-of-defun-function
))
;; Better not call end-of-defun-function directly, in case
;; it's not defined.
(
end-of-defun
(
-
arg
))))))
((
or
defun-prompt-regexp
open-paren-in-column-0-is-defun-start
)
(
and
(
<
arg
0
)
(
not
(
eobp
))
(
forward-char
1
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment