[Top][All Lists]

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

Re: [h-e-w] Why do replace commands sometimes not work?

From: MBR
Subject: Re: [h-e-w] Why do replace commands sometimes not work?
Date: Fri, 25 May 2012 15:24:48 -0400
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

Thanks, Francis.  That's a big help.  Kevin Buchs' suggestion solves this specific case, but I define macros frequently, and within those macros I often want to move to either the beginning or end of a narrowed region.  I'm looking at (defun beginning-of-buffer ... in simple.el, and it's not obvious to me why it should not be used in Lisp programs.  But as a programmer I'm more familiar with C and its descendants.  I only have a passing acquaintance with Lisp, so there may be things that are obvious to an experienced Emacs-Lisp programmer that are not obvious to me.

On 5/25/2012 2:24 PM, Francis Wright wrote:
Mark: If I run your macro with standard Emacs settings (having started it
with the -Q flag) then I see the problem that you describe, whereas if I run
with my normal settings then I don't. I think it's a question of how the
region is handled and  the significant difference is that in my normal
environment I have Delete Selection Mode turned on, whereas by default it is
off. And it's the setting when the macro is defined that seems to matter.

If you look at the help for M-< it says "Don't use this command in Lisp
programs!", but by using it in a macro that's effectively what you are
doing. However, rather than worrying any further about precisely why your
macro is unreliable, I suggest you use Kevin Buchs' proposal.


reply via email to

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