Bug 154293
Summary: | 'Open with "Emacs Text Editor"' does not use emacsclient | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Darren Brierton <darren> | ||||||||
Component: | emacs | Assignee: | Jens Petersen <petersen> | ||||||||
Status: | CLOSED CANTFIX | QA Contact: | |||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | rawhide | CC: | me | ||||||||
Target Milestone: | --- | Keywords: | FutureFeature | ||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Enhancement | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2006-02-03 07:54:43 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Darren Brierton
2005-04-09 03:43:06 UTC
Why didn't any of my lines wrap??? Do I need to bugzilla this bug report? Debian's emacs patch contains a script called emacsclient-plus which seems to be for what you want - I haven't tested it yet though... Perhaps you can give it a try and report your findings. Jens, I've tried googling and all the links to emacsclient-plus give me a 404. Do you know where I can find this script so I can try it out and report my findings? (Will this wrap this time?) Created attachment 113082 [details]
emacsclient-plus
Sorry here it is extracted from debian's emacs patch.
AFAICT they do not ship it yet though.
Thanks Jens. I'm afraid it doesn't work at all well for me, neither from a terminal or from within Nautilus. Right-clicking on a text file in Nautilus and choosing "Open With" -> "Open with Other Application" and selecting ~/bin/emacs-client-plus.pl open a new instance of Emacs regardless of whether one was running already or not, and the new instance does NOT have the file right clicked on as an open buffer, although if there was a previously running instance of Emacs then that one does. Exact same behaviour if emacsclient-plus.pl is run from the command line. Can't you make Nautilus run emacsclient instead? :) (In reply to comment #6) > Can't you make Nautilus run emacsclient instead? :) Presumably, but that wasn't the point of the bug report. If emacs isn't already running then trying to open a file with emacsclient doesn't work. What I was suggesting was needed was *one* way of opening a file in Emacs which uses an existng instance of emacs if one exists and otherwise starts one. There currently doesn't seem to be a way of doing that. Ok, I guess a wrapper is needed which tries to call emacsclient first, if that fails forks an emacs and then tries emacsclient again. However since emacs is rather slow to start up I'm not sure how to implement this easily with a shell script. Probably it would be better implemented as an extension of emacsclient. Any ideas? Probably it is better to propose this upstream on emacs-devel list. I received the following response to my posting "emacsclient wrapper to launch emacs server if none running?" on emacs-devel: | From the Emacs manual: | | | The option `--alternate-editor=COMMAND' is useful when running | `emacsclient' in a script. It specifies a command to run if | `emacsclient' fails to contact Emacs. For example, the following | setting for the EDITOR environment variable will always give you an | editor, even if no Emacs server is running: | | EDITOR="emacsclient --alternate-editor emacs +%d %s" Does that help? (In reply to comment #10) Ah, that does look good. I'll put that in my ~/.bash_profile and report back. I can't report back immediately because logging out (or shutting down emacs) would be a royal pain in the arse, but as soon as it is convenient I'll check it out. If this works, how hard would it be to add something like this as the emacs MIME handler so that simply installing the emacs RPM would give the desired behaviour from a Nautilus right-click? Obviously I'm delighted to solve my own personal problems but I put this in bugzilla with the hope of making ordinary users' interactions with emacs less painful. Thanks again for being so diligent with something that was simply filed as an RFE. I guess it would need EDITOR set as above in the desktop environment, but I'm not sure everybody would want that be default: at least I'm pretty used to running separate invocations of emacs processes. Changing emacs.desktop to Exec 'emacsclient -a emacs %f' would only affect users if they have (server-start) in their .emacs. Without (server-start), 'emacsclient -a emacs %f' will always open a new emacs process. With (server-start) it'll open the file in one main emacs process. Changing emacs.desktop to Exec 'emacsclient -a emacs %f' while leaving /etc/skel/.emacs without (server-start) would be optimal. Created attachment 303887 [details]
implements behavior described in opening report
Created attachment 303889 [details]
implements behavior described in opening report
emacs and emacsclient can accept a list of files, so resubmitting with %F
instead of %f in Exec
Comment on attachment 303889 [details]
implements behavior described in opening report
Oops, this .desktop doesn't work when initially starting Emacs.
|