Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #176618

Re: reportbug and remapped "edit"

From Boyan Penkov <boyan.penkov@gmail.com>
Newsgroups linux.debian.user
Subject Re: reportbug and remapped "edit"
Date 2017-01-12 18:30 +0100
Message-ID <sYRmh-6IL-1@gated-at.bofh.it> (permalink)
References <sYs4x-7ZN-5@gated-at.bofh.it> <sYEp4-7eK-13@gated-at.bofh.it> <sYFEt-7Y4-1@gated-at.bofh.it> <sYGKd-t5-1@gated-at.bofh.it> <sYQqd-69X-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 01/12/2017 11:15 AM, David Wright wrote:
> On Thu 12 Jan 2017 at 01:05:06 (-0500), kamaraju kusumanchi wrote:
>> On Wed, Jan 11, 2017 at 11:53 PM, David Wright <deblis@lionunicorn.co.uk> wrote:
>>> On Wed 11 Jan 2017 at 22:38:48 (-0500), kamaraju kusumanchi wrote:
>>>
>>>> Just unalias the alias corresponding to edit (the one you set up in
>>>> ~/.zshrc) before launching reportbug. After that set it back. IIUC
>>>> there is no need to launch a bash subshell to do this. You can do
>>>> everything while you are in zsh.
>>>>
>>>> So the sequence of commands would be
>>>>
>>>> % unalias edit
>>>> % reportbug &
>>>> % alias edit='emacsclient -c -s /tmp/emacs1000/server'
>>> If you're going to do it that way, you've really got to
>>> interrogate the old value and restore it afterwards, rather
>>> than having edit defined in two places. Otherwise, how do
>>> you keep them in sync.
>>>
>>> Most people wouldn't run reportbug often enough to worry
>>> about a subshell, would they?
>> There are always multiple ways to solve a problem often with different
>> advantages/disadvantages. I do not have a problem with subshell per
>> se. My point is that the previously proposed solution requires OP to
>> start a different shell (i.e. zsh users starting bash). What is to
>> assume that there is no such alias defined in ~/.bashrc?
> No, I did not propose that the OP start a different type of shell.
> It surprised me that the OP did.

My thinking there was that I'd be able to not have to work around not
reading my zshrc, but unalias and re-source does work just as well.

>
> My solution was to start a subshell of the same type as their normal
> shell. However, as I'm only familiar with bash, I started off with
> "In bash, ..." and finished with "I haven't bothered to search all
> the subsections of man zsh, but there may be something similar."
>
> In other words, I think the OP could do a similar thing (start a
> subshell with edit unaliased) entirely in zsh. However, unlike with
> bash, which covers most things in "man bash", zsh appears to have
> 17 man pages. Commands like alias/unalias are typically builtin.
> I am not going to the bother of searching all 17 for the appropriate
> incantations in zsh. I left that as an exercise for the OP to check
> out in their own (or any other) shell.
>
>> Little bit of a side note: I work on systems where my home directory
>> is mounted across multiple machines. On different machines I use
>> different shells. To keep my aliases synced across all these machines,
>> I place all my aliases in a separate file and source that file in
>> ~/.zshrc, ~/.bashrc etc.,
> Then you're a better person than I am to check/know whether my method
> is possible with zsh. I would still maintain that defining the same
> alias in two places is not good advice. But then, my advice would
> be to use, say, edt rather than edit as the alias. I have two aliases
> for emacs: nwemacs and bigemacs (nw<TAB> and big<TAB> suffice).
> Others have suggested not to use an alias at all.
>
> Cheers,
> David.
>

-- 
Boyan Penkov
www.boyanpenkov.com


Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

reportbug and remapped "edit" Boyan Penkov <boyan.penkov@gmail.com> - 2017-01-11 15:30 +0100
  Re: reportbug and remapped "edit" David Wright <deblis@lionunicorn.co.uk> - 2017-01-11 16:00 +0100
    Re: reportbug and remapped "edit" Hans <hans.ullrich@loop.de> - 2017-01-11 16:10 +0100
      Re: reportbug and remapped "edit" Boyan Penkov <boyan.penkov@gmail.com> - 2017-01-11 16:40 +0100
  Re: reportbug and remapped "edit" kamaraju kusumanchi <raju.mailinglists@gmail.com> - 2017-01-12 04:40 +0100
    Re: reportbug and remapped "edit" David Wright <deblis@lionunicorn.co.uk> - 2017-01-12 06:00 +0100
      Re: reportbug and remapped "edit" kamaraju kusumanchi <raju.mailinglists@gmail.com> - 2017-01-12 07:10 +0100
        Re: reportbug and remapped "edit" Boyan Penkov <boyan.penkov@gmail.com> - 2017-01-12 13:30 +0100
        Re: reportbug and remapped "edit" David Wright <deblis@lionunicorn.co.uk> - 2017-01-12 17:30 +0100
          Re: reportbug and remapped "edit" Greg Wooledge <wooledg@eeg.ccf.org> - 2017-01-12 17:30 +0100
            Re: reportbug and remapped "edit" Nicolas George <george@nsup.org> - 2017-01-12 17:40 +0100
              Re: reportbug and remapped "edit" Greg Wooledge <wooledg@eeg.ccf.org> - 2017-01-12 17:50 +0100
                Re: reportbug and remapped "edit" David Wright <deblis@lionunicorn.co.uk> - 2017-01-12 22:10 +0100
          Re: reportbug and remapped "edit" Boyan Penkov <boyan.penkov@gmail.com> - 2017-01-12 18:30 +0100
      Re: reportbug and remapped "edit" Boyan Penkov <boyan.penkov@gmail.com> - 2017-01-12 13:30 +0100
      Re: reportbug and remapped "edit" kamaraju kusumanchi <raju.mailinglists@gmail.com> - 2017-01-13 03:00 +0100
        Re: reportbug and remapped "edit" Boyan Penkov <boyan.penkov@gmail.com> - 2017-02-07 16:20 +0100
    Re: reportbug and remapped "edit" Nicolas George <george@nsup.org> - 2017-01-12 10:30 +0100
  Re: reportbug and remapped "edit" Jonathan Dowland <jmtd@debian.org> - 2017-01-12 11:10 +0100

csiph-web