emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to align the comments to start from the same column?


From: William Xue
Subject: Re: how to align the comments to start from the same column?
Date: Sat, 14 Jul 2007 14:04:31 +0800
User-agent: Opera Mail/9.21 (Win32)

On Sat, 14 Jul 2007 02:18:49 +0800, Dan Nicolaescu <address@hidden> wrote:

"William Xue" <address@hidden> writes:

  > Hi,
  > when I am coding in cpp files, I will use M-; to make some comments,
  > like  following:
  >
> IoCreateFileSpecifyDeviceObjectHint(&h_rd_file,
  > //  file handle
> GENERIC_READ
  > |  GENERIC_WRITE, // desire access
> &rd_file_obj_attr,
  > // object attributes
> &rd_io_status_block,
  > // io status block
  >                                                             0, //
  > allocation size
> FILE_ATTRIBUTE_NORMAL,
  > // file attributes
> FILE_SHARE_READ,
  > // share access
  >
  > Is there a way to format the comments to the same column?
  >
  > I want something like:
  >
  > 1. select the codes as a region
  > 2. press a magic keybinding
> 3. the comments align to the longest column of comments in the region.


You can find this package:

;;; bc-mode.el --- Minor mode for formatting right-margin block comments.
;;
;; Copyright (C) 1991-1996 Steve Burgett <address@hidden>
;; $Id: bc-mode.el,v 1.1 1996/10/19 18:54:00 burgett Exp burgett $
;;
;; Author: Steve Burgett <address@hidden>
;; Created: July 1992
;; Version: 1.1
;; Keywords: comment minor-mode programming editing
;; HTTP: http://robotics.eecs.berkeley.edu/~burgett/

It has very sophisticated comment handling, I think it does what you want.

Thanks for the information. But the url seems invalid here.
I have googled about it, not found any place to download it.
---8<--------------------------------------------->8---
;;; bc-mode.el --- BC code editing commands for Emacs
;; Copyright (C) 2005  Kumar Appaiah

;; Author: Kumar Appaiah <address@hidden>
;; Keywords:

---8<--------------------------------------------->8---
this file seems not the same with yours.

Could you send it to me by mail?
In advance thanks!

--
Sincerely yours,
William




reply via email to

[Prev in Thread] Current Thread [Next in Thread]