unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 15839@debbugs.gnu.org
Subject: bug#15839: 24.3.50; `isearch-allow-scroll': be able to scroll point off screen temporarily
Date: Fri, 07 Dec 2018 01:03:54 +0200	[thread overview]
Message-ID: <87o99y5kbp.fsf@mail.linkov.net> (raw)
In-Reply-To: <87mupij1g0.fsf@web.de> (Michael Heerdegen's message of "Thu, 06 Dec 2018 13:15:43 +0100")

>> Isn't this binding of shift-left and shift-right from Org mode?
>
> No, I simply have personal global bindings for these:
>
> (global-set-key [(shift left)]  #'backward-char)
> (global-set-key [(shift right)] #'forward-char)

Your keybindings are related to cursor motion,
so it makes sense to allow them to work in isearch-mode.

One way to do this:

(define-key isearch-mode-map [(shift left)]
  (lambda (&optional n)
    (interactive "^p")
    (setq isearch-pre-move-point (point))
    (call-interactively 'backward-char)))

(define-key isearch-mode-map [(shift right)]
  (lambda (&optional n)
    (interactive "^p")
    (setq isearch-pre-move-point (point))
    (call-interactively 'forward-char)))

Or do you want to be able to put properties to allow a command, e.g.:

(put 'backward-char 'isearch-move 'enabled)
(put 'forward-char 'isearch-move 'enabled)

with such patch

diff --git a/lisp/isearch.el b/lisp/isearch.el
index dcd119a517..6b0d9f03af 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2871,7 +2871,11 @@ isearch-pre-command-hook
                         (stringp (nth 1 (interactive-form this-command)))
                         (string-match-p "^^" (nth 1 (interactive-form this-command))))))
           (and (eq isearch-yank-on-move 'shift)
-               this-command-keys-shift-translated))
+               (or (and this-command-keys-shift-translated
+                        (symbolp this-command)
+                        (not (eq (get this-command 'isearch-move) 'disabled)))
+                   (and (symbolp this-command)
+                        (eq (get this-command 'isearch-move) 'enabled)))))
       (setq this-command-keys-shift-translated nil)
       (setq isearch-pre-move-point (point)))
      ;; Append control characters to the search string


I'm still not sure if this needed to be generalized more, and how far.
For example, I think that shift-left and shift-right
from org-mode should exit Isearch as well as windmove shift-keys
should exit Isearch and move focus to another window.





  reply	other threads:[~2018-12-06 23:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 23:02 bug#15839: 24.3.50; `isearch-allow-scroll': be able to scroll point off screen temporarily Drew Adams
2013-11-09  0:57 ` Juri Linkov
2013-11-09  3:09   ` Drew Adams
2013-11-10 13:46 ` Stefan Monnier
2013-11-10 16:52   ` Drew Adams
2013-11-11 19:08     ` Drew Adams
2018-11-24 22:45 ` Juri Linkov
2018-11-25  3:14   ` Drew Adams
2018-11-25 20:15     ` Juri Linkov
2018-11-26  0:16       ` Drew Adams
2018-11-26 23:35         ` Juri Linkov
2018-11-27  0:49           ` Drew Adams
2018-11-28  0:35             ` Juri Linkov
2018-11-28 15:15               ` Drew Adams
2018-11-28 23:01                 ` Juri Linkov
2018-11-29  3:36                   ` Drew Adams
2018-11-29 22:23                     ` Juri Linkov
2018-11-30  0:27                       ` Drew Adams
2018-11-30  7:28                         ` Eli Zaretskii
     [not found]                         ` <<83lg5bc9d6.fsf@gnu.org>
2018-11-30 15:33                           ` Drew Adams
2018-12-04  0:29                         ` Juri Linkov
2018-12-04 14:46                           ` Drew Adams
2018-12-04 20:46                             ` Drew Adams
2018-12-04 21:38                               ` Juri Linkov
2018-12-05  0:32                                 ` Drew Adams
2018-12-05 23:44                                   ` Juri Linkov
2018-12-06  1:20                                     ` Drew Adams
2018-12-05 12:59                           ` Michael Heerdegen
2018-12-05 23:49                             ` Juri Linkov
2018-12-06 12:15                               ` Michael Heerdegen
2018-12-06 23:03                                 ` Juri Linkov [this message]
2018-12-07 12:42                                   ` Michael Heerdegen
2018-12-08 23:38                                     ` Juri Linkov
2018-12-09  1:13                                       ` Michael Heerdegen
2018-12-10  0:21                                         ` Juri Linkov
2018-12-10  0:58                                           ` Michael Heerdegen
2018-12-11  0:37                                             ` Juri Linkov
2018-12-11 18:22                                               ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o99y5kbp.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=15839@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).