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

Bug #191651 reported by Jari Aalto on 2008-02-13
4
Affects Status Importance Assigned to Milestone
Bazaar
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.

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)"'''

Jari Aalto (jari-aalto) wrote :

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

Unfortunately no effect. Same result.

>>>>> "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

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) on 2008-09-05
Changed in bzr:
importance: Undecided → Wishlist
status: New → Confirmed
Jari Aalto (jari-aalto) on 2008-09-07
description: updated
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.

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) on 2017-11-09
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers