Use readlink to identify the default editor via /etc/alternatives/editor. ref. #4728

Also use "run" for launching nano because it's not a gui editor.
use `basename` and `realpath`
Introduce variables `edpath` and `edname` in edit()
Merge pull request #4761 from elehcim/patch-2

Use readlink to identify the default editor. ref #4728