emacs-devel
[Top][All Lists]
Advanced

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

Re: Should we move 20.x related stuff out of NEWS ?


From: Juri Linkov
Subject: Re: Should we move 20.x related stuff out of NEWS ?
Date: Sun, 25 Apr 2004 07:55:27 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden (Kim F. Storm) writes:
> Juri Linkov <address@hidden> writes:
>> Alan Mackenzie <address@hidden> writes:
>> > On the other hand, I've often wondered whether C-M-a ought to set the
>> > mark.  I often do a C-u C-<space> first.  Maybe I should try advising
>> > C-M-[ae] to set the mark.
>> 
>> Setting the mark by C-M-a is very useful when the user uses it to jump
>> to the function's beginning to see its arguments and wants to return
>> back to the original place.  However, the mark shouldn't be set when
>> the user uses C-M-a to move the point between defuns.
>
> So it should only set the mark if the previous command was not C-M-a.

Yes, it looks right.

>> The highest level can be reached by giving a sufficiently large
>> argument to the `outline-up-heading' function.
>
> C-u C-c C-u ?

Usually, this is enough to reach the top level, but for reliability
the numeric argument should be 1000 (the magic constant used in many
places related to outline-mode).

Anyhow, the following patches set the mark for C-M-a and C-M-e
in programming modes, and for C-c C-u in outline mode.

BTW, I think isearch should not set the mark at the beginning of the
buffer.  Often users move the point to the beginning to start the
search from the top.  It's too inconvenient to have this position in
the mark ring to go back to the original position.  And moreover,
the beginning of the buffer can be reached very easily when needed
without going through the mark ring.

Index: lisp/emacs-lisp/lisp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/lisp.el,v
retrieving revision 1.52
diff -u -r1.52 lisp.el
--- lisp/emacs-lisp/lisp.el     14 Apr 2004 18:20:23 -0000      1.52
+++ lisp/emacs-lisp/lisp.el     25 Apr 2004 04:58:59 -0000
@@ -175,6 +175,8 @@
 If variable `beginning-of-defun-function' is non-nil, its value
 is called as a function to find the defun's beginning."
   (interactive "p")
+  (and (eq this-command 'beginning-of-defun)
+       (or (eq last-command 'beginning-of-defun) (push-mark)))
   (and (beginning-of-defun-raw arg)
        (progn (beginning-of-line) t)))
 
@@ -223,6 +225,8 @@
 If variable `end-of-defun-function' is non-nil, its value
 is called as a function to find the defun's end."
   (interactive "p")
+  (and (eq this-command 'end-of-defun)
+       (or (eq last-command 'end-of-defun) (push-mark)))
   (if (or (null arg) (= arg 0)) (setq arg 1))
   (if end-of-defun-function
       (if (> arg 0)

Index: lisp/outline.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/outline.el,v
retrieving revision 1.5
diff -u -r1.5 outline.el
--- lisp/outline.el     21 Jan 2004 03:25:37 -0000      1.5
+++ lisp/outline.el     25 Apr 2004 05:03:02 -0000
@@ -884,6 +879,8 @@
 With argument, move up ARG levels.
 If INVISIBLE-OK is non-nil, also consider invisible lines."
   (interactive "p")
+  (and (eq this-command 'outline-up-heading)
+       (or (eq last-command 'outline-up-heading) (push-mark)))
   (outline-back-to-heading invisible-ok)
   (let ((start-level (funcall outline-level)))
     (if (eq start-level 1)

Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.226
diff -u -r1.226 isearch.el
--- lisp/isearch.el     4 Mar 2004 16:54:08 -0000       1.226
+++ lisp/isearch.el     25 Apr 2004 04:39:34 -0000
@@ -699,9 +700,9 @@
       ;; Exiting the save-window-excursion clobbers window-start; restore it.
       (set-window-start (selected-window) found-start t))
 
-    ;; If there was movement, mark the starting position.
+    ;; If there was movement, mark the starting position (except at bob).
     ;; Maybe should test difference between and set mark iff > threshold.
-    (if (/= (point) isearch-opoint)
+    (if (and (/= (point) isearch-opoint) (/= isearch-opoint (point-min)))
        (or (and transient-mark-mode mark-active)
            (progn
              (push-mark isearch-opoint t)

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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