unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9032: 24.0.50; Cc-mode does not recognize objective-C method names.
@ 2011-07-09  8:09 Jan Djärv
  0 siblings, 0 replies; only message in thread
From: Jan Djärv @ 2011-07-09  8:09 UTC (permalink / raw)
  To: 9032

Hello.

To reproduce:

emacs -Q nsterm.m
C-s (void)logNot C-n C-n C-x 4 a

The text in the ChangeLog is:

	* nsterm.m (-):

When using add-log for objective-C files, you always get the function
"-" in the ChangeLog.  add-log uses c-defun-name, which does not do a
very good job.  The patch below fixes this.  I have run this locally for
a while and it works well on Emacs sources at least.  It is always
better than the current "-".

I sent a bug report to bug-cc-mode about 6 moths ago, but that seems to be dead.

=== modified file 'lisp/progmodes/cc-cmds.el'
--- lisp/progmodes/cc-cmds.el    2010-10-31 11:54:02 +0000
+++ lisp/progmodes/cc-cmds.el    2010-12-02 09:03:09 +0000
@@ -1724,6 +1724,14 @@
          ;; DEFFLAGSET(syslog_opt_flags,LOG_PID ...) ==> syslog_opt_flags
          (match-string-no-properties 1))

+       ((and (derived-mode-p 'objc-mode)
+         (looking-at "[-+]\s*("))
+        (when (c-syntactic-re-search-forward ")\s*" nil t)
+          (c-forward-token-2)
+          (setq name-end (point))
+          (c-backward-token-2)
+          (buffer-substring-no-properties (point) name-end)))
+
         (t
          ;; Normal function or initializer.
          (when (c-syntactic-re-search-forward "[{(]" nil t)

          Jan D.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
     `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Users/jhd/bin/Emacs.app/Contents/Resources/etc/DEBUG.


In GNU Emacs 24.0.50.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
  of 2011-07-08 on zeplin
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--verbose' '--enable-asserts' '--without-x' 
'--with-ns' 'CFLAGS=-g''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: C
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: sv_SE.UTF-8
   value of $XMODIFIERS: nil
   locale-coding-system: utf-8-unix
   default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
   tooltip-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
<escape> x e m a c s <tab> b u <tab> <backspace> <backspace>
<tab> <escape> <backspace> r e p o r t - e <tab> <
return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug help-mode easymenu view time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-09  8:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-09  8:09 bug#9032: 24.0.50; Cc-mode does not recognize objective-C method names Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).