bazaar.conf::editor line quoting is not preserved correctly

Bug #191651 reported by Jari Aalto
4
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

Consider following line:

    # ~/.bazaar/bazaar.conf
    [DEFAULT]
    editor = emacs --no-site-file -q -nw --eval "(setq backup-inhibited t)"

When editor is invoked with:

    bzr ci

The Emacs editor command is not called correctly. Judging from Emacs
buffer *Messages*, the call was made using excessive quotes:

   ("emacs" "-q" "--no-site-file" "--eval" "\"(setq" "backup-inhibited" "t)\"" "bzr_log.DCPFDq")
   command-line-1: End of file during parsing

It would appear, that bzr just quotes every word separated by space
when passing arguments to exec(), which in effect - is not the correct result.

Revision history for this message
Alexander Belchenko (bialix) wrote :

try to put command line in bazaar.conf in triple apostrofes ['], like this:

editor = '''emacs --no-site-file -q -nw --eval "(setq backup-inhibited t)"'''

Revision history for this message
Jari Aalto (jari-aalto) wrote :

> editor = '''emacs --no-site-file -q -nw --eval "(setq backup-inhibited t)"'''

Unfortunately no effect. Same result.

Revision history for this message
Vincent Ladeuil (vila) wrote : Re: [Bug 191651] Re: bazaar.conf::editor line quoting is not preserved correctly

>>>>> "Jari" == Jari Aalto <email address hidden> writes:

    >> editor = '''emacs --no-site-file -q -nw --eval "(setq backup-inhibited
    Jari> t)"'''

    Jari> Unfortunately no effect. Same result.

As a workaround, what about:

in .emacs
(defun my-inhibit-backup ()
    (setq backup-inhibited t))

and then :

editor = emacs --no-site-file -q -nw -f my-inhibit-backup

Revision history for this message
Jari Aalto (jari-aalto) wrote :

> As a workaround, what about: [$HOME/.emacs defun()]

Naturally, but the bug was about incorrect treatment of the 'editor' definition when there are quoted arguments involved.

Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Wishlist
status: New → Confirmed
Jari Aalto (jari-aalto)
description: updated
Revision history for this message
Jari Aalto (jari-aalto) wrote :

Re: vila <v.ladeuil+lp free.fr>
Date: 2008-09-05 12:40

I'm wondering why the status of the bug was downgraded to "wishlist"? The report did not talk about feature request, but reported a misbehaving functionality.

The suggested workaround (making custom function) is not feasible, because "-q" option suppresses loading "~/.emacs" => thus user functions are not available for calling[1]. The ability to use standard command line options (for any program) is still not handled correctly.

[1] Normally ~/.emacs startup file contains many customizations that take time to load; therefore skipping ~/.emacs is desireable. The command line options presented in the bug report tailor Emacs to start quickly for editing.

Revision history for this message
Vincent Ladeuil (vila) wrote :

I downgraded it to 'wishlist' because there are easy workarounds especially for emacs users:
- use emacs-client
- use a wrapper so that there is no need to quote the arguments

It doesn't mean it will not be addressed ("Won't Fix") nor that it's not seen as bug ("Invalid").

If the above use too much negations: it will be fixed, but it's a low priority.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.