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
59c1a7de
Commit
59c1a7de
authored
May 08, 1995
by
Richard M. Stallman
Browse files
(get-method-definition, get-method-definition-1): New functions.
(add-log-current-defun): Use them to handle objc-mode.
parent
002c4306
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
lisp/add-log.el
lisp/add-log.el
+27
-0
No files found.
lisp/add-log.el
View file @
59c1a7de
...
...
@@ -349,6 +349,8 @@ Has a preference of looking backwards."
(skip-chars-forward " \t")
(buffer-substring (point)
(progn (forward-sexp 1) (point))))
((and (eq major-mode 'objc-mode)
(get-method-definition)))
((memq major-mode '(c-mode c++-mode c++-c-mode))
(beginning-of-line)
;; See if we are in the beginning part of a function,
...
...
@@ -471,6 +473,31 @@ Has a preference of looking backwards."
(match-end 1))))))))
(error nil)))
;; Subroutine used within get-method-definition.
;; Add the last match in the buffer to the end of `md',
;; followed by the string END; move to the end of that match.
(defun get-method-definition-1 (end)
(setq md (concat md
(buffer-substring (match-beginning 1) (match-end 1))
end))
(goto-char (match-end 0)))
;; For objective C, return the method name if we are in a method.
(defun get-method-definition ()
(let ((md "
[
"))
(save-excursion
(if (re-search-backward "
^@implementation
\\
(
.
*\\
)
$
" nil t)
(get-method-definition-1 "
")))
(save-excursion
(cond
((re-search-backward "
^\\
(
[-+]\\
)
[
\t\n\f\r]*\\
((
[^
)
]*
)
\\
)
?
" nil t)
(get-method-definition-1 "")
(while (not (looking-at "
[{
;]"))
(
looking-at
"\\([^ ;{:\t\n\f\r]*:?\\)\\(([^)]*)\\)?[^ ;{:\t\n\f\r]*[ \t\n\f\r]*"
)
(
get-method-definition-1
""
))
(
concat
md
"]"
))))
))
(
provide
'add-log
)
...
...
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