unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30212: 26.0.91; [PATCH] push mark before moving point in shell output
@ 2018-01-22 19:55 Alex Branham
  2018-04-17 20:24 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Branham @ 2018-01-22 19:55 UTC (permalink / raw)
  To: 30212

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

Since shell commands move point, I find it useful to push the mark so that I can navigate around different output using C-u C-SPC. This patch adds the push-mark call that's necessary to shell-command--save-pos-or-erase.

Thanks,
Alex

From fc14474033fe1d678ae774ca77b61b80a3988610 Mon Sep 17 00:00:00 2001
From: Alex Branham <branham@utexas.edu>
Date: Mon, 22 Jan 2018 13:51:06 -0600
Subject: [PATCH] * lisp/simple.el (shell-command--save-pos-or-erase):
 push-mark then move point

---
 lisp/simple.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/simple.el b/lisp/simple.el
index 3ac6b86381c..fdd56b67115 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3311,6 +3311,7 @@ shell-command--save-pos-or-erase
                  (let ((inhibit-read-only t))
                    (erase-buffer) nil))))
     (when pos
+      (push-mark pos t)
       (goto-char (point-max))
       (push (cons (current-buffer) pos)
             shell-command-saved-pos))))
-- 
2.16.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-simple.el-shell-command-save-pos-or-erase-push-.patch --]
[-- Type: text/x-patch, Size: 741 bytes --]

From fc14474033fe1d678ae774ca77b61b80a3988610 Mon Sep 17 00:00:00 2001
From: Alex Branham <branham@utexas.edu>
Date: Mon, 22 Jan 2018 13:51:06 -0600
Subject: [PATCH] * lisp/simple.el (shell-command--save-pos-or-erase):
 push-mark then move point

---
 lisp/simple.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/simple.el b/lisp/simple.el
index 3ac6b86381c..fdd56b67115 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3311,6 +3311,7 @@ shell-command--save-pos-or-erase
                  (let ((inhibit-read-only t))
                    (erase-buffer) nil))))
     (when pos
+      (push-mark pos t)
       (goto-char (point-max))
       (push (cons (current-buffer) pos)
             shell-command-saved-pos))))
-- 
2.16.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#30212: 26.0.91; [PATCH] push mark before moving point in shell output
  2018-01-22 19:55 bug#30212: 26.0.91; [PATCH] push mark before moving point in shell output Alex Branham
@ 2018-04-17 20:24 ` Lars Ingebrigtsen
  2018-04-18  6:10   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-17 20:24 UTC (permalink / raw)
  To: Alex Branham; +Cc: 30212

Alex Branham <alex.branham@gmail.com> writes:

> Since shell commands move point, I find it useful to push the mark so
> that I can navigate around different output using C-u C-SPC. This
> patch adds the push-mark call that's necessary to
> shell-command--save-pos-or-erase.

[...]

>      (when pos
> +      (push-mark pos t)
>        (goto-char (point-max))

Hm...  I don't think it would be a good idea to set the mark
unexpectedly -- people have certain expectations on what commands set
the mark, and setting it for every command in shell mode would be
unusual and get in the way of people's work habits, I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#30212: 26.0.91; [PATCH] push mark before moving point in shell output
  2018-04-17 20:24 ` Lars Ingebrigtsen
@ 2018-04-18  6:10   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2018-04-18  6:10 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: alex.branham, 30212

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 17 Apr 2018 22:24:05 +0200
> Cc: 30212@debbugs.gnu.org
> 
> Alex Branham <alex.branham@gmail.com> writes:
> 
> > Since shell commands move point, I find it useful to push the mark so
> > that I can navigate around different output using C-u C-SPC. This
> > patch adds the push-mark call that's necessary to
> > shell-command--save-pos-or-erase.
> 
> [...]
> 
> >      (when pos
> > +      (push-mark pos t)
> >        (goto-char (point-max))
> 
> Hm...  I don't think it would be a good idea to set the mark
> unexpectedly -- people have certain expectations on what commands set
> the mark, and setting it for every command in shell mode would be
> unusual and get in the way of people's work habits, I think.

If the commands in questions tend to move very far away, it is
accepted Emacs behavior to push a mark before such large moves.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-18  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 19:55 bug#30212: 26.0.91; [PATCH] push mark before moving point in shell output Alex Branham
2018-04-17 20:24 ` Lars Ingebrigtsen
2018-04-18  6:10   ` Eli Zaretskii

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).