unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sean O'Rourke <sorourke@cs.ucsd.edu>
Cc: emacs-devel@gnu.org
Subject: Re: CC Mode 5.31.3
Date: Fri, 24 Feb 2006 10:51:22 -0800	[thread overview]
Message-ID: <m2hd6oh9p1.fsf@803639a8.dynamic.ucsd.edu> (raw)
In-Reply-To: Pine.LNX.3.96.1060224172232.399A-100000@acm.acm

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

Alan Mackenzie <acm@muc.de> writes:
> As agreed with RMS, C-M-[ae] should be be bound to
> c-\(beginning\|end\)-of-defun by default, rather than the standard
> commands \(beginning\|end\)-of-defun.  These two CC Mode commands could
> do with some optimisation, but this seems optional rather than necessary.
> This is still to do.  However, it is trivial, involving only drudge work,
> mostly in the manual.  It should be there in 5.31.4.

Have you thought instead of mode-locally setting
{beginning,end}-of-defun-function?  This way, other commands like
mark-defun that operate on functions automatically pick up the
language-specific versions.  I have been using this setting for
about a year without any problems after making the attached
trivial patch, which prevents infinite recursion when
beginning-of-defun-function itself calls beginning-of-defun.

/s


[-- Attachment #2: Type: text/plain, Size: 1620 bytes --]

Index: lisp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/lisp.el,v
retrieving revision 1.74
diff -p -u -w -u -r1.74 lisp.el
--- lisp.el	6 Feb 2006 12:20:06 -0000	1.74
+++ lisp.el	24 Feb 2006 18:44:26 -0000
@@ -210,12 +210,14 @@ If variable `beginning-of-defun-function
 is called as a function to find the defun's beginning."
   (interactive "p")
   (if beginning-of-defun-function
+      (let ((bodf beginning-of-defun-function)
+            (beginning-of-defun-function nil))
       (if (> (setq arg (or arg 1)) 0)
 	  (dotimes (i arg)
-	    (funcall beginning-of-defun-function))
+              (funcall bodf))
 	;; Better not call end-of-defun-function directly, in case
 	;; it's not defined.
-	(end-of-defun (- arg)))
+            (end-of-defun (- arg))))
     (and arg (< arg 0) (not (eobp)) (forward-char 1))
     (and (re-search-backward (if defun-prompt-regexp
 				 (concat (if open-paren-in-column-0-is-defun-start
@@ -255,12 +257,14 @@ is called as a function to find the defu
       (push-mark))
   (if (or (null arg) (= arg 0)) (setq arg 1))
   (if end-of-defun-function
+      (let ((eodf end-of-defun-function)
+            (end-of-defun-function nil))
       (if (> arg 0)
 	  (dotimes (i arg)
-	    (funcall end-of-defun-function))
+              (funcall eodf))
 	;; Better not call beginning-of-defun-function
 	;; directly, in case it's not defined.
-	(beginning-of-defun (- arg)))
+            (beginning-of-defun (- arg))))
     (let ((first t))
       (while (and (> arg 0) (< (point) (point-max)))
 	(let ((pos (point)))

  reply	other threads:[~2006-02-24 18:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-24 18:13 CC Mode 5.31.3 Alan Mackenzie
2006-02-24 18:51 ` Sean O'Rourke [this message]
2006-02-24 22:04   ` Alan Mackenzie
2006-02-26 12:10 ` Richard Stallman
2006-02-26 17:19   ` Alan Mackenzie
2006-02-27 19:01     ` Richard Stallman
2006-02-26 20:39   ` Alan Mackenzie
2006-02-27  9:07     ` Kim F. Storm
2006-02-27 15:10       ` Alan Mackenzie
2006-02-27 23:46       ` Richard Stallman
2006-02-27 14:31     ` Stefan Monnier
2006-02-27 23:47       ` Richard Stallman
2006-02-27 19:02     ` Richard Stallman
2006-02-26 12:46 ` Vivek Dasmohapatra
     [not found] <87slq8xyqv.fsf-monnier+gmane.emacs.devel@gnu.org>
2006-02-25 11:37 ` Alan Mackenzie
2006-02-26 15:36   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2hd6oh9p1.fsf@803639a8.dynamic.ucsd.edu \
    --to=sorourke@cs.ucsd.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).