all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs keyboard command
@ 2006-07-25 22:57 mailpitches
  2006-07-25 23:42 ` Steve Allan
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: mailpitches @ 2006-07-25 22:57 UTC (permalink / raw)


I'm looking for a specific keyboard command.

When you hit C-X C-F to Find file, you are presented with a default
path such as ~/dir/blah. Is there a key command to travel backwards by
directory, so that I can press this key command and immediately get
~dir/ without having to hit delete four times?

Thanks

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

* Re: Emacs keyboard command
  2006-07-25 22:57 Emacs keyboard command mailpitches
@ 2006-07-25 23:42 ` Steve Allan
  2006-07-26  0:58   ` B. T. Raven
  2006-07-26 11:26 ` Tao Chen
  2006-08-14 13:33 ` HASM
  2 siblings, 1 reply; 15+ messages in thread
From: Steve Allan @ 2006-07-25 23:42 UTC (permalink / raw)


"mailpitches@email.com" <mailpitches@email.com> writes:

>I'm looking for a specific keyboard command.
>
>When you hit C-X C-F to Find file, you are presented with a default
>path such as ~/dir/blah. Is there a key command to travel backwards by
>directory, so that I can press this key command and immediately get
>~dir/ without having to hit delete four times?

Try backward-kill-word, which is bound to M-<backspace> in my version
of Emacs.  I think that'll do what you want.

-- 
-- Steve

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

* Re: Emacs keyboard command
  2006-07-25 23:42 ` Steve Allan
@ 2006-07-26  0:58   ` B. T. Raven
  2006-07-26  6:00     ` Dieter Wilhelm
  2006-07-28  5:29     ` Le
  0 siblings, 2 replies; 15+ messages in thread
From: B. T. Raven @ 2006-07-26  0:58 UTC (permalink / raw)



"Steve Allan" <takezowest@yahoo.com> wrote in message
news:upsft45gf.fsf@attachmate.com...
> "mailpitches@email.com" <mailpitches@email.com> writes:
>
> >I'm looking for a specific keyboard command.
> >
> >When you hit C-X C-F to Find file, you are presented with a default
> >path such as ~/dir/blah. Is there a key command to travel backwards by
> >directory, so that I can press this key command and immediately get
> >~dir/ without having to hit delete four times?
>
> Try backward-kill-word, which is bound to M-<backspace> in my version
> of Emacs.  I think that'll do what you want.
>
> --
> -- Steve

C-<backspace> if Backspace is Del. Also hold Ctl down while typing a-k
will delete everything back to the read-only prompt.

Ed

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

* Re: Emacs keyboard command
  2006-07-26  0:58   ` B. T. Raven
@ 2006-07-26  6:00     ` Dieter Wilhelm
  2006-07-28  5:29     ` Le
  1 sibling, 0 replies; 15+ messages in thread
From: Dieter Wilhelm @ 2006-07-26  6:00 UTC (permalink / raw)
  Cc: help-gnu-emacs

"B. T. Raven" <ecinmn@alcisp.com> writes:

> "Steve Allan" <takezowest@yahoo.com> wrote in message
> news:upsft45gf.fsf@attachmate.com...
>> "mailpitches@email.com" <mailpitches@email.com> writes:
>>
>> >I'm looking for a specific keyboard command.
>> >
>> >When you hit C-X C-F to Find file, you are presented with a default
>> >path such as ~/dir/blah. Is there a key command to travel backwards by
>> >directory, so that I can press this key command and immediately get
>> >~dir/ without having to hit delete four times?
>>
>> Try backward-kill-word, which is bound to M-<backspace> in my version
>> of Emacs.  I think that'll do what you want.
>
> C-<backspace> if Backspace is Del. Also hold Ctl down while typing a-k
> will delete everything back to the read-only prompt.

It's not necessary to kill the whole line just type immediately behind the
presented path `~/dir' (without the accents) and Emacs disregards the
first, wrong part and starts with `~/dir'.


-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Emacs keyboard command
  2006-07-25 22:57 Emacs keyboard command mailpitches
  2006-07-25 23:42 ` Steve Allan
@ 2006-07-26 11:26 ` Tao Chen
  2006-08-13  1:04   ` David Combs
  2006-08-14 13:33 ` HASM
  2 siblings, 1 reply; 15+ messages in thread
From: Tao Chen @ 2006-07-26 11:26 UTC (permalink / raw)


Perhaps ido.el is what you want?
Its homepage: http://www.cua.dk/ido.html

mailpitches@email.com wrote:
> I'm looking for a specific keyboard command.
>
> When you hit C-X C-F to Find file, you are presented with a default
> path such as ~/dir/blah. Is there a key command to travel backwards by
> directory, so that I can press this key command and immediately get
> ~dir/ without having to hit delete four times?
> 
> Thanks

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

* Re: Emacs keyboard command
  2006-07-26  0:58   ` B. T. Raven
  2006-07-26  6:00     ` Dieter Wilhelm
@ 2006-07-28  5:29     ` Le
  1 sibling, 0 replies; 15+ messages in thread
From: Le @ 2006-07-28  5:29 UTC (permalink / raw)


B. T. Raven wrote:
> C-<backspace> if Backspace is Del. Also hold Ctl down while typing a-k
> will delete everything back to the read-only prompt.

I'm late to the discussion, but this seems to be what the OP wanted?
Insert into your init file or autoload as you see fit.


(eval-when-compile (require 'cl))

(defvar le::directory-sep-chars "/\\\\")

(defmacro Init-emacs-load (emacs-form &rest xemacs-forms)
  "Expand to EMACS-FORM on Emacs, XEMACS-FORM on XEmacs."
  (if (featurep 'xemacs)
      (cons 'progn xemacs-forms)
    emacs-form))

(defmacro Init-cond (&rest args)
  "just like cond, except result of expansion is compiled."
  (dolist (arg args)
    (when (eval (car arg))
      (return (cons 'progn (cdr arg))))))

(defun _le::kill-path-element (arg)
  "kils arg number or path elements negative is backwards"
  (let ((old-point (point))
        skip-func
        limit)
    (if (< arg 0)
        (setq skip-func 'skip-chars-backward
              limit (Init-cond
                     ((fboundp 'minibuffer-prompt-end)
                      (minibuffer-prompt-end))
                     (t
                      (point-min))))
      (setq skip-func 'skip-chars-forward
            limit (point-max)))
    (setq arg (abs arg))
    (dotimes (i arg)
      (let ((old-point (point)))
        (eval (list skip-func le::directory-sep-chars limit))
        (eval (list skip-func (concat "^" le::directory-sep-chars)
limit))
        (when (eq (point) old-point)
          (return))))
    (unless (eq (point) old-point)
      (kill-region (point) old-point))))

;;;###autoload
(defun le::kill-path-element (arg)
  (interactive "*p")
  (_le::kill-path-element arg))

;;;###autoload
(defun le::backward-kill-path-element (arg)
  (interactive "*p")
  (_le::kill-path-element (- arg)))

(mapc
 #'(lambda (map)
;;      (define-key map [remap backward-kill-word]
'le::backward-kill-path-element)
;;      (define-key map [remap kill-word] 'le::kill-path-element)
     (substitute-key-definition 'backward-kill-word
'le::backward-kill-path-element map global-map)
     (substitute-key-definition 'kill-word 'le::kill-path-element map
global-map))
 (Init-xemacs-load
     (list read-file-name-map
           read-file-name-must-match-map)
   (list minibuffer-local-filename-completion-map
         minibuffer-local-must-match-filename-map
         )))

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

* Re: Emacs keyboard command
  2006-07-26 11:26 ` Tao Chen
@ 2006-08-13  1:04   ` David Combs
  0 siblings, 0 replies; 15+ messages in thread
From: David Combs @ 2006-08-13  1:04 UTC (permalink / raw)


In article <1153913193.624448.11900@m73g2000cwd.googlegroups.com>,
Tao Chen <chentao74@gmail.com> wrote:
>Perhaps ido.el is what you want?
>Its homepage: http://www.cua.dk/ido.html
>
>mailpitches@email.com wrote:
>> I'm looking for a specific keyboard command.
>>
>> When you hit C-X C-F to Find file, you are presented with a default
>> path such as ~/dir/blah. Is there a key command to travel backwards by
>> directory, so that I can press this key command and immediately get
>> ~dir/ without having to hit delete four times?
>> 
>> Thanks
>

Maybe you can say a few words about what ido.(el?) does,
a couple of plusses and minuses -- you seem to know something
about it.

Much easier to get it from you than trying to read doc or info
and then do a mental-diff on whatever it maybe-replaces.

Just a sentence or three.

Thanks!

David

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

* Re: Emacs keyboard command
  2006-07-25 22:57 Emacs keyboard command mailpitches
  2006-07-25 23:42 ` Steve Allan
  2006-07-26 11:26 ` Tao Chen
@ 2006-08-14 13:33 ` HASM
  2006-08-15 15:10   ` B. T. Raven
  2 siblings, 1 reply; 15+ messages in thread
From: HASM @ 2006-08-14 13:33 UTC (permalink / raw)


"mailpitches@email.com" <mailpitches@email.com> writes:

> When you hit C-X C-F to Find file, you are presented with a default
> path such as ~/dir/blah. Is there a key command to travel backwards by
> directory, so that I can press this key command and immediately get
> ~dir/ without having to hit delete four times?

Try M-BS.  A word, in Find File context is usually a dir, but now always.

-- HASM


M-BS runs `backward-kill-word'

`backward-kill-word' is an interactive compiled Lisp function
  -- loaded from "/builddir/build/BUILD/xemacs-21.4.19/lisp/simple.elc"
(backward-kill-word &optional COUNT)

Documentation:
Kill characters backward until encountering the end of a word.
With argument, do this that many times.

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

* Re: Emacs keyboard command
  2006-08-14 13:33 ` HASM
@ 2006-08-15 15:10   ` B. T. Raven
  2006-08-15 19:39     ` Eli Zaretskii
                       ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: B. T. Raven @ 2006-08-15 15:10 UTC (permalink / raw)



"HASM" <not_really@comcast.net> wrote in message
news:m31wrjl9wj.fsf@127.0.0.1...
> "mailpitches@email.com" <mailpitches@email.com> writes:
>
> > When you hit C-X C-F to Find file, you are presented with a default
> > path such as ~/dir/blah. Is there a key command to travel backwards by
> > directory, so that I can press this key command and immediately get
> > ~dir/ without having to hit delete four times?
>
> Try M-BS.  A word, in Find File context is usually a dir, but now
always.
>
> -- HASM
>
>
> M-BS runs `backward-kill-word'

On some systems (e.g. w32) this key combo runs undo (as opposed to
advertised-undo) and C-<backspace> runs backward-kill-word.

>
> `backward-kill-word' is an interactive compiled Lisp function
>   -- loaded from "/builddir/build/BUILD/xemacs-21.4.19/lisp/simple.elc"
> (backward-kill-word &optional COUNT)
>
> Documentation:
> Kill characters backward until encountering the end of a word.
> With argument, do this that many times.

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

* Re: Emacs keyboard command
  2006-08-15 15:10   ` B. T. Raven
@ 2006-08-15 19:39     ` Eli Zaretskii
  2006-08-15 20:39     ` HASM
       [not found]     ` <mailman.5195.1155670786.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2006-08-15 19:39 UTC (permalink / raw)


> From: "B. T. Raven" <ecinmn@alcisp.com>
> Date: Tue, 15 Aug 2006 10:10:45 -0500
> 
> > Try M-BS.  A word, in Find File context is usually a dir, but now always.
> >
> > M-BS runs `backward-kill-word'
> 
> On some systems (e.g. w32) this key combo runs undo (as opposed to
> advertised-undo) and C-<backspace> runs backward-kill-word.

Not on my w32 system: I get backward-kill-word when I type
M-backspace.

What Emacs version do you have that behaves otherwise?

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

* Re: Emacs keyboard command
  2006-08-15 15:10   ` B. T. Raven
  2006-08-15 19:39     ` Eli Zaretskii
@ 2006-08-15 20:39     ` HASM
       [not found]     ` <mailman.5195.1155670786.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 15+ messages in thread
From: HASM @ 2006-08-15 20:39 UTC (permalink / raw)


"B. T. Raven" <ecinmn@alcisp.com> writes:

>> M-BS runs `backward-kill-word'
>
> On some systems (e.g. w32) this key combo runs undo (as opposed to
> advertised-undo) and C-<backspace> runs backward-kill-word.

Not on my Win32 Xemacs, but sure, look for backward-kill-word using
where-is, to find out the proper key sequence for your case.

-- HASM

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

* Re: Emacs keyboard command
       [not found]     ` <mailman.5195.1155670786.9609.help-gnu-emacs@gnu.org>
@ 2006-08-17 23:42       ` B. T. Raven
  2006-08-18 10:44         ` Eli Zaretskii
       [not found]         ` <mailman.5313.1155897936.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 15+ messages in thread
From: B. T. Raven @ 2006-08-17 23:42 UTC (permalink / raw)



"Eli Zaretskii" <eliz@gnu.org> wrote in message
news:mailman.5195.1155670786.9609.help-gnu-emacs@gnu.org...
> > From: "B. T. Raven" <ecinmn@alcisp.com>
> > Date: Tue, 15 Aug 2006 10:10:45 -0500
> >
> > > Try M-BS.  A word, in Find File context is usually a dir, but now
always.
> > >
> > > M-BS runs `backward-kill-word'
> >
> > On some systems (e.g. w32) this key combo runs undo (as opposed to
> > advertised-undo) and C-<backspace> runs backward-kill-word.
>
> Not on my w32 system: I get backward-kill-word when I type
> M-backspace.
>
> What Emacs version do you have that behaves otherwise?
>
>
GNU Emacs 21.3.1 (i386-mingw-windows98.2222) of 2004-03-10 on NYAUMO

C-h k M-<backspace> reports
"M-DEL runs the command undo
   which is an interactive compiled Lisp function in `simple'.
(undo &optional ARG)"

this is synonymous with C-_
and
M-<delete> is the same as M-d

(All on standard 108 key keyboard)


Maybe it has something to do with 'delete-is-backspace' (I misremember the
real name of this setting) or something in my .emacs but I am sure I have
never messed with this key combo. Neither do I use msw keyboard emulation,
only transient-mark-mode t.
The only suspicious thing I can find in my .emacs that is even vaguely
related is:

(global-set-key [(super k)] (lambda () (interactive) (kill-line 0 )))

C-h b reports s-k ?? but this is probably because the backward kill line
is wrapped in a lambda.

Ed

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

* Re: Emacs keyboard command
  2006-08-17 23:42       ` B. T. Raven
@ 2006-08-18 10:44         ` Eli Zaretskii
       [not found]         ` <mailman.5313.1155897936.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2006-08-18 10:44 UTC (permalink / raw)


> From: "B. T. Raven" <ecinmn@alcisp.com>
> Date: Thu, 17 Aug 2006 18:42:46 -0500
> 
> GNU Emacs 21.3.1 (i386-mingw-windows98.2222) of 2004-03-10 on NYAUMO
> 
> C-h k M-<backspace> reports
> "M-DEL runs the command undo
>    which is an interactive compiled Lisp function in `simple'.
> (undo &optional ARG)"
> 
> this is synonymous with C-_
> and
> M-<delete> is the same as M-d
> 
> (All on standard 108 key keyboard)
> 
> 
> Maybe it has something to do with 'delete-is-backspace' (I misremember the
> real name of this setting) or something in my .emacs but I am sure I have
> never messed with this key combo.

Please try the same key M-<backspace> in "emacs -q".

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

* Re: Emacs keyboard command
       [not found]         ` <mailman.5313.1155897936.9609.help-gnu-emacs@gnu.org>
@ 2006-08-18 15:05           ` B. T. Raven
  2006-08-18 15:49             ` Drew Adams
  0 siblings, 1 reply; 15+ messages in thread
From: B. T. Raven @ 2006-08-18 15:05 UTC (permalink / raw)



"Eli Zaretskii" <eliz@gnu.org> wrote in message
news:mailman.5313.1155897936.9609.help-gnu-emacs@gnu.org...
> > From: "B. T. Raven" <ecinmn@alcisp.com>
> > Date: Thu, 17 Aug 2006 18:42:46 -0500
> >
> > GNU Emacs 21.3.1 (i386-mingw-windows98.2222) of 2004-03-10 on NYAUMO
> >
> > C-h k M-<backspace> reports
> > "M-DEL runs the command undo
> >    which is an interactive compiled Lisp function in `simple'.
> > (undo &optional ARG)"
> >
> > this is synonymous with C-_
> > and
> > M-<delete> is the same as M-d
> >
> > (All on standard 108 key keyboard)
> >
> >
> > Maybe it has something to do with 'delete-is-backspace' (I misremember
the
> > real name of this setting) or something in my .emacs but I am sure I
have
> > never messed with this key combo.
>
> Please try the same key M-<backspace> in "emacs -q".
>
>

Right you are. This restores the default behaviour. Apparently there is
something about the function and/or variable pc-selection-mode that I
don't understand. For instance if I set the variable to t (using
Customize, apparently the only way), set for session and future, it shows
it as being on, and writes
 '(pc-selection-mode t nil (pc-select)) ;;;  strange syntax for setting a
variable??
into the .emacs.
If I immediately type C-h v pc-selection-mode the program reports that its
value is nil.
All that I really want from the PC behaviour is incremental highlighting
of line / region after C-<space>(Mark set) ... C-f, M-f or whatever. I
don't use any other PC style key assignments as they stomp on the emacs
ones.
Anyway the emacs -q  shows that I have done something in the .emacs init
file, I have no idea what.


Ed.

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

* RE: Emacs keyboard command
  2006-08-18 15:05           ` B. T. Raven
@ 2006-08-18 15:49             ` Drew Adams
  0 siblings, 0 replies; 15+ messages in thread
From: Drew Adams @ 2006-08-18 15:49 UTC (permalink / raw)


    All that I really want from the PC behaviour is incremental highlighting
    of line / region after C-<space>(Mark set) ... C-f, M-f or whatever. I
    don't use any other PC style key assignments as they stomp on the emacs
    ones.

Transient-mark mode will give you that behavior, on its own. 

You might also want to try delete-selection mode, which gives you transient-mark mode, plus type-to-replace and quick region delete, but without changing your key bindings as PC selection mode does. Delete-selection mode is very good, IMO. 

See also:

* Node Graphical Kill in the Emacs manual (yes, that's a crazy name for the node).

* http://www.emacswiki.org/cgi-bin/wiki/DeleteSelectionMode.

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

end of thread, other threads:[~2006-08-18 15:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-25 22:57 Emacs keyboard command mailpitches
2006-07-25 23:42 ` Steve Allan
2006-07-26  0:58   ` B. T. Raven
2006-07-26  6:00     ` Dieter Wilhelm
2006-07-28  5:29     ` Le
2006-07-26 11:26 ` Tao Chen
2006-08-13  1:04   ` David Combs
2006-08-14 13:33 ` HASM
2006-08-15 15:10   ` B. T. Raven
2006-08-15 19:39     ` Eli Zaretskii
2006-08-15 20:39     ` HASM
     [not found]     ` <mailman.5195.1155670786.9609.help-gnu-emacs@gnu.org>
2006-08-17 23:42       ` B. T. Raven
2006-08-18 10:44         ` Eli Zaretskii
     [not found]         ` <mailman.5313.1155897936.9609.help-gnu-emacs@gnu.org>
2006-08-18 15:05           ` B. T. Raven
2006-08-18 15:49             ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.