[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs Lisp Programming Questions
From: |
Andreas Röhler |
Subject: |
Re: Emacs Lisp Programming Questions |
Date: |
Wed, 04 Nov 2009 10:26:47 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
David Combs wrote:
> In article <mailman.8228.1254921577.2239.help-gnu-emacs@gnu.org>,
> Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>> clint.laskowski wrote:
>>> Hello, gnu.emacs.help. I have a few questions about programming in
>>> Emacs Lisp. I hope you can help. Here they are:
>>>
>>> 1. Is this a good place to ask questions about programming in Emacs
>>> Lisp, especially with regards to text processing? If there's a better
>>> place, I'd appreciate knowing.
>>>
>>> 2. I want to write an interactive Elisp program to remove sequential
>>> duplicate lines from a buffer. This buffer is not sorted, and it
>>> should not be sorted. The program should simply look for two
>>> sequential lines that are identical, delete one, and then move on to
>>> the next line and do it over until it reaches the end of the buffer.
>>>
just see I used a private `region-active-p'
(unless (featurep 'xemacs)
(defun region-active-p ()
"and mark-active transient-mark-mode
(not (eq (region-beginning) (region-end)"
(and mark-active transient-mark-mode
(not (eq (condition-case nil (region-beginning)(error nil))
(condition-case nil (region-end) (error nil)))))))