Subject: bug#18915: 24.3; Feature: Prompt to make executable on write-file

From: Ed Avis <[email-masked]>
Date: Fri, 31 Oct 2014 18:01:19 +0000

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

On Unix, Create a file with execute permission (chmod a+x file)
and open it with C-x C-f file RET.  Now save that as a different
file, C-x C-w otherfile RET.

Current behaviour: a file called otherfile is written but it is not
executable, even though the file that you originally visited was.

It would be useful if Emacs on write-file would first write the
new file, and then (only if that involved creating the new file,
and only if the buffer was previously visiting an executable file)
prompt for whether to make the newly written file executable.

I suggest that most of the time, the user will probably want to
make the new file executable (if you edit a script and save a
copy, you'll probably want to run the new script).  However,
making things executable by default is a bit dangerous, so
better to prompt.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/share/emacs/24.3/etc/DEBUG.

In GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.10.9)
 of 2014-09-30 on buildvm-10.phx2.fedoraproject.org
Configured using:
 `configure '--build=x86_64-redhat-linux-gnu'
 '--host=x86_64-redhat-linux-gnu' '--program-prefix='
 '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr'
 '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
 '--datadir=/usr/share' '--includedir=/usr/include'
 '--libdir=/usr/lib64' '--libexecdir=/usr/libexec'
 '--localstatedir=/var' '--sharedstatedir=/var/lib'
 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus'
 '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff'
 '--with-xft' '--with-xpm' '--with-x-toolkit=gtk3' '--with-gpm=no'
 'build_alias=x86_64-redhat-linux-gnu'
 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
 -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro ''

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_MESSAGES: en_GB.UTF-8
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Help

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s
C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s
C-a C-x C-w t e s t C-a C-k / v a r TAB q w TAB DEL
DEL w TAB c g TAB t e s t _ c a DEL DEL DEL / c a p
TAB i t a l _ a l l o c a t i o n RET ESC x s h e l
l RET ESC > w c DEL DEL e c h o SPC ; DEL ' c a p i
t a l _ a l l o c a t i o n ? f u n d _ g r o u p _
i d = 0 ' SPC | SPC . / m i s TAB t e s t _ p a TAB
RET C-x 2 C-x o C-x b c a p TAB RET C-x C-f / v a r
TAB C-g C-x k RET C-x C-f / v a r TAB w TAB C-g ESC
! C-g c j m DEL DEL h m o d SPC a + x SPC / v a r TAB
w TAB c g TAB t e s t / c a p TAB RET C-h k C-x C-w
c a p i t a l _ a l l o c a t i o n ? f u n d _ g r
o u p _ i d = 0 C-g C-g ESC x e m a c s - b u TAB g
RET DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL r e
p o r t - e m TAB RET

Recent messages:
Mark set
Mark saved where search started [3 times]
Saving file /var/www/cgi-bin/test/capital_allocation...
Wrote /var/www/cgi-bin/test/capital_allocation
Mark set
Quit [3 times]
Type "q" to delete help window.

Quit [2 times]
delete-backward-char: Text is read-only [2 times]

Load-path shadows:
None found.

Features:
(shadow sort emacsbug message format-spec rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils etags mail-extr dired
vc-cvs vc-rcs make-mode pcmpl-rpm tabify man sh-script smie executable
conf-mode imenu nroff-mode python rx cus-edit wid-edit cus-start
cus-load perl-mode ffap url-parse auth-source eieio gnus-util mm-util
mail-prsvr password-cache url-vars dabbrev edmacro kmacro mule-util
log-edit diff-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok misearch multi-isearch add-log log-view easy-mmode
pcvs-util vc vc-dispatcher vc-svn sql thingatpt help-mode pcmpl-unix
time-date server csharp-mode warnings advice help-fns advice-preload
byte-opt bytecomp byte-compile cconv cc-langs cc-mode cc-fonts easymenu
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
zoom-frm frame-cmds frame-fns cl-macs gv avoid cl cl-lib compile shell
pcomplete comint ring ansi-color tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
Ed Avis <[email-masked]>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________