-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use emacs ediff instead of vim -d #25
Comments
This is not a Pacmatic issue or even a feature request. The bit you are missing is how the shell works. The short and sweet answer is to
as root and then do the |
Thanks for the help! I've done what you recommenced, but I still have issues. I still cannot use ediff instead of vim -d. Here's the output of ls -l ediff, cat ediff, and pacmatic.
Now when I run pacmatic...
The emacs ediff program does not open. Pacmatic ends. BUT if I do this in my home directory,
Emacs' ediff opens just fine in the terminal. Do you have any ideas of what I did wrong? |
the output from pacmatic looks eerily familiar.. from this thread here: https://bbs.archlinux.org/viewtopic.php?id=193477 try in my case, there was a pacsave file that wouldnt open. There seems to be an issue if the file is anything but a pacnew. Possibly this is the issue, not ediff. |
When I run the first command my output is:
When I run the second command my output is:
When pacmatic runs, it still uses vim -d. Even though running $ pacmatic outputs
When I run
Emacs opens the two files in ediff. So I still can't use ediff. I'm not sure what the problem is. |
I don't know why this bug is left open for so long. the pacdiff script is called by pacmatic without any arguments, so ediff is not a candiate for its replacement. You don't need to replace pacdiff, but just have it use your ediff script rather than "vim -d" to edit each change. This is done by setting the DIFFPROG environment variable: export DIFFPROG=ediff This also allows just calling pacdiff to resolve .pacsave and .pacnew files even when not using pacmatic. Note that if you are using sudo, you need to make sure the DIFFPROG is set in your root Defaults env_keep += DIFFPROG might be needed to use any DIFFPROG environent variable set for your normal login account. |
Hello!
This is a feature request!
I'm trying to use emacs' ediff merge tool instead of vim's. I've found this code snippet and put it in my .bashrc:
Ediff can now be called via the command line!
function ediff() {
if [ "X${2}" = "X" ]; then
echo "USAGE: ediff <FILE 1> <FILE 2>"
else
# The --eval flag takes lisp code and evaluates it with EMACS
# the -nw means use emacs non-graphically or in the terminal
emacs -nw --eval "(ediff-files "$1" "$2")"
fi
}
make pacmatic use ediff as its program to fix pacsaves and pacnews.
export pacdiff_program="ediff"
End of .bashrc
Now when I run pacmatic, I get:
Usage: pacmatic -options [packages]
Pacmatic is a pacman wrapper that takes care of menial but critial tasks.
These include
Checking the archlinux.org news
Summarizing the arch-general mailing list
Reminding if it has been a while since the last sync
Reporting pacnew files
Editing pacnew files
The following environment variables can be set
warn_time="86400" # (seconds)
rss_feed="https://www.archlinux.org/feeds/news/"
log_file="/var/log/arch-news.log"
pacdiff_program="ediff"
pacman_program="pacman"
mail_list="https://lists.archlinux.org/pipermail/arch-general/2015-February.txt.gz"
pacman_log="/var/log/pacman.log"
To use Pacmatic's functionality in a script, source with
. /usr/bin/pacmatic --as-lib
So, emacs' ediff can be used from the command line, but unfortunately it doesn't work with pacmatic. When I type y or Y when I want to edit .pac* files, pacmatic ends. If I knew more about bash scripting I might propose a solution, but I'm not sure how to implement this feature. Am I missing something? Is there a way to use emacs' ediff instead of vim -d?
Thanks!
The text was updated successfully, but these errors were encountered: