unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Mark custom function for interactive use only
@ 2013-11-24 15:29 Sebastian Wiesner
  2013-11-24 18:22 ` Stefan Monnier
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-24 15:29 UTC (permalink / raw)
  To: emacs-devel

Hello,

as you all know, the byte compiler warns if some functions (e.g.
"next-line") are called from Lisp.

Is there a way to mark my own functions for "interactive use only" and
have the byte compiler emit the same warning for these functions, too?
 Do I need to set a special symbol property, etc.?

Greetings,
Sebastian Wiesner



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-24 15:29 Mark custom function for interactive use only Sebastian Wiesner
@ 2013-11-24 18:22 ` Stefan Monnier
  2013-11-24 19:52   ` Sebastian Wiesner
  0 siblings, 1 reply; 23+ messages in thread
From: Stefan Monnier @ 2013-11-24 18:22 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: emacs-devel

> as you all know, the byte compiler warns if some functions (e.g.
> "next-line") are called from Lisp.

> Is there a way to mark my own functions for "interactive use only" and
> have the byte compiler emit the same warning for these functions, too?
>  Do I need to set a special symbol property, etc.?

You can add them to byte-compile-interactive-only-functions, but it's
rather inconvenient.  We should replace this list with a symbol
property, indeed.  Patch welcome,


        Stefan



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-24 18:22 ` Stefan Monnier
@ 2013-11-24 19:52   ` Sebastian Wiesner
  2013-11-25  3:10     ` Stefan Monnier
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-24 19:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

2013/11/24 Stefan Monnier <monnier@iro.umontreal.ca>:
>> as you all know, the byte compiler warns if some functions (e.g.
>> "next-line") are called from Lisp.
>
>> Is there a way to mark my own functions for "interactive use only" and
>> have the byte compiler emit the same warning for these functions, too?
>>  Do I need to set a special symbol property, etc.?
>
> You can add them to byte-compile-interactive-only-functions, but it's
> rather inconvenient.  We should replace this list with a symbol
> property, indeed.  Patch welcome,

I presume I'd just patch `byte-compile-form' in bytecomp.el to also
look at a corresponding property, e.g. `interactive-use-only`.
Anything else?

>
>
>         Stefan



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-24 19:52   ` Sebastian Wiesner
@ 2013-11-25  3:10     ` Stefan Monnier
  2013-11-25 10:05       ` Sebastian Wiesner
  2013-11-25 10:41       ` Sebastian Wiesner
  0 siblings, 2 replies; 23+ messages in thread
From: Stefan Monnier @ 2013-11-25  3:10 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: emacs-devel

> I presume I'd just patch `byte-compile-form' in bytecomp.el to also
> look at a corresponding property, e.g. `interactive-use-only`.
> Anything else?

We should also make byte-compile-interactive-only-functions obsolete and
default it to nil (i.e. move its contents to symbol properties).


        Stefan



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25  3:10     ` Stefan Monnier
@ 2013-11-25 10:05       ` Sebastian Wiesner
  2013-11-25 10:41       ` Sebastian Wiesner
  1 sibling, 0 replies; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 10:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:
>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also
>> look at a corresponding property, e.g. `interactive-use-only`.
>> Anything else?
>
> We should also make byte-compile-interactive-only-functions obsolete and
> default it to nil (i.e. move its contents to symbol properties).

What should the value of the new symbol property be?  Just t, for the
same semantics as the variable, or probably a string, which points to
the alternative supposed to be used from Lisp?



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25  3:10     ` Stefan Monnier
  2013-11-25 10:05       ` Sebastian Wiesner
@ 2013-11-25 10:41       ` Sebastian Wiesner
  2013-11-25 10:42         ` Sebastian Wiesner
  1 sibling, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 10:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:
>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also
>> look at a corresponding property, e.g. `interactive-use-only`.
>> Anything else?
>
> We should also make byte-compile-interactive-only-functions obsolete and
> default it to nil (i.e. move its contents to symbol properties).

Attached is a patch to Emacs trunk, which introduces a
`interactive-only' symbol property as either a string with a "use
instead" message or just t, sets this property on all functions from
byte-compile-interactive-only-functions, and makes
byte-compile-interactive-only-functions as obsolete.

Documentation and tests are missing.  If you can point me to the
proper places and tell me how to run the Emacs tests, I can add these
as well.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 10:41       ` Sebastian Wiesner
@ 2013-11-25 10:42         ` Sebastian Wiesner
  2013-11-25 10:54           ` Bozhidar Batsov
  2013-11-25 11:33           ` Sebastian Wiesner
  0 siblings, 2 replies; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 10:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

2013/11/25 Sebastian Wiesner <lunaryorn@gmail.com>:
> 2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:
>>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also
>>> look at a corresponding property, e.g. `interactive-use-only`.
>>> Anything else?
>>
>> We should also make byte-compile-interactive-only-functions obsolete and
>> default it to nil (i.e. move its contents to symbol properties).
>
> Attached is a patch to Emacs trunk, which introduces a
> `interactive-only' symbol property as either a string with a "use
> instead" message or just t, sets this property on all functions from
> byte-compile-interactive-only-functions, and makes
> byte-compile-interactive-only-functions as obsolete.
>
> Documentation and tests are missing.  If you can point me to the
> proper places and tell me how to run the Emacs tests, I can add these
> as well.

Ok, *now* it's attached.  Sorry

[-- Attachment #2: interactive-only-property.patch --]
[-- Type: application/octet-stream, Size: 6524 bytes --]

=== modified file 'lisp/comint.el'
--- lisp/comint.el	2013-10-29 16:11:50 +0000
+++ lisp/comint.el	2013-11-25 10:37:38 +0000
@@ -752,6 +752,7 @@
   (let ((name (file-name-nondirectory program)))
     (switch-to-buffer (make-comint name program))
     (run-hooks (intern-soft (concat "comint-" name "-hook")))))
+(put 'comint-run 'interactive-only t)
 
 (defun comint-exec (buffer name command startfile switches)
   "Start up a process named NAME in buffer BUFFER for Comint modes.

=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- lisp/emacs-lisp/bytecomp.el	2013-10-30 02:45:53 +0000
+++ lisp/emacs-lisp/bytecomp.el	2013-11-25 10:38:19 +0000
@@ -353,11 +353,11 @@
                   (t
                    (append byte-compile-warnings (list warning)))))))
 
-(defvar byte-compile-interactive-only-functions
-  '(beginning-of-buffer end-of-buffer replace-string replace-regexp
-    insert-file insert-buffer insert-file-literally previous-line next-line
-    goto-line comint-run delete-backward-char)
+(defvar byte-compile-interactive-only-functions nil 
   "List of commands that are not meant to be called from Lisp.")
+(make-obsolete-variable 'byte-compile-interactive-only-functions
+			"use the `interactive-only' symbol property instead"
+			"24.4")
 
 (defvar byte-compile-not-obsolete-vars nil
   "List of variables that shouldn't be reported as obsolete.")
@@ -2929,13 +2929,18 @@
              (byte-compile-variable-ref form))))
      ((symbolp (car form))
       (let* ((fn (car form))
-             (handler (get fn 'byte-compile)))
+             (handler (get fn 'byte-compile))
+	     (interactive-only (or (get fn 'interactive-only)
+				   (memq fn byte-compile-interactive-only-functions))))
         (when (macroexp--const-symbol-p fn)
           (byte-compile-warn "`%s' called as a function" fn))
-        (and (byte-compile-warning-enabled-p 'interactive-only)
-             (memq fn byte-compile-interactive-only-functions)
-             (byte-compile-warn "`%s' used from Lisp code\n\
-That command is designed for interactive use only" fn))
+	(when (and (byte-compile-warning-enabled-p 'interactive-only)
+		   interactive-only)
+	  (byte-compile-warn "`%s' used from Lisp code\n\
+That command is designed for interactive use only.\n%s"
+			     (if (stringp interactive-only)
+				 interactive-only
+			       "Consult the documentation for an alternative")))
         (if (and (fboundp (car form))
                  (eq (car-safe (symbol-function (car form))) 'macro))
             (byte-compile-log-warning

=== modified file 'lisp/files.el'
--- lisp/files.el	2013-10-30 02:14:16 +0000
+++ lisp/files.el	2013-11-25 10:33:10 +0000
@@ -2085,6 +2085,8 @@
 \(Its calling sequence is different; see its documentation)."
   (interactive "*fInsert file literally: ")
   (insert-file-1 filename #'insert-file-contents-literally))
+(put 'insert-file-literally 'interactive-only
+     "Use `insert-file-contents-literally' instead")
 
 (defvar find-file-literally nil
   "Non-nil if this buffer was made by `find-file-literally' or equivalent.
@@ -5007,6 +5009,7 @@
 \(Its calling sequence is different; see its documentation)."
   (interactive "*fInsert file: ")
   (insert-file-1 filename #'insert-file-contents))
+(put 'insert-file 'interactive-only "Use `insert-file-contents' instead.")
 
 (defun append-to-file (start end filename)
   "Append the contents of the region to the end of file FILENAME.

=== modified file 'lisp/replace.el'
--- lisp/replace.el	2013-11-13 20:48:35 +0000
+++ lisp/replace.el	2013-11-25 10:31:11 +0000
@@ -523,6 +523,8 @@
 	   (if (and transient-mark-mode mark-active)
 	       (region-end)))))
   (perform-replace from-string to-string nil nil delimited nil nil start end))
+(put 'replace-string 'interactive-only
+     "Use `search-forward' and `replace-match' instead.")
 
 (defun replace-regexp (regexp to-string &optional delimited start end)
   "Replace things after point matching REGEXP with TO-STRING.
@@ -590,6 +592,8 @@
 	   (if (and transient-mark-mode mark-active)
 	       (region-end)))))
   (perform-replace regexp to-string nil t delimited nil nil start end))
+(put 'replace-regexp 'interactive-only
+     "Use `re-search-forward' and `replace-match' instead.")
 
 \f
 (defvar regexp-history nil

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2013-10-30 02:45:53 +0000
+++ lisp/simple.el	2013-11-25 10:38:10 +0000
@@ -888,6 +888,7 @@
 			(/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
 		 (point-min))))
   (if (and arg (not (consp arg))) (forward-line 1)))
+(put 'beginning-of-buffer 'interactive-only "Use (goto-char (point-min)) instead")
 
 (defun end-of-buffer (&optional arg)
   "Move point to the end of the buffer.
@@ -920,6 +921,7 @@
 	 ;; then scroll specially to put it near, but not at, the bottom.
 	 (overlay-recenter (point))
 	 (recenter -3))))
+(put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead")
 
 (defcustom delete-active-region t
   "Whether single-char deletion commands delete an active region.
@@ -982,6 +984,7 @@
 	     (insert-char ?\s (- ocol (current-column)) nil))))
 	;; Otherwise, do simple deletion.
 	(t (delete-char (- n) killflag))))
+(put 'delete-backward-char 'interactive-only t)
 
 (defun delete-forward-char (n &optional killflag)
   "Delete the following N characters (previous if N is negative).
@@ -1079,6 +1082,7 @@
     (if (eq selective-display t)
 	(re-search-forward "[\n\C-m]" nil 'end (1- line))
       (forward-line (1- line)))))
+(put 'goto-line 'interactive-only "Use `forward-line' instead")
 
 (defun count-words-region (start end &optional arg)
   "Count the number of words in the region.
@@ -4165,6 +4169,7 @@
      (insert-buffer-substring (get-buffer buffer))
      (point)))
   nil)
+(put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead")
 
 (defun append-to-buffer (buffer start end)
   "Append to specified buffer the text of the region.
@@ -4763,6 +4768,7 @@
 	   (signal (car err) (cdr err))))
       (line-move arg nil nil try-vscroll)))
   nil)
+(put 'next-line 'interactive-only "Use `forward-line' instead")
 
 (defun previous-line (&optional arg try-vscroll)
   "Move cursor vertically up ARG lines.
@@ -4802,6 +4808,8 @@
 	 (signal (car err) (cdr err))))
     (line-move (- arg) nil nil try-vscroll))
   nil)
+(put 'previous-line 'interactive-only
+     "Use `forward-line' with negative argument instead")
 
 (defcustom track-eol nil
   "Non-nil means vertical motion starting at end of line keeps to ends of lines.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 10:42         ` Sebastian Wiesner
@ 2013-11-25 10:54           ` Bozhidar Batsov
  2013-11-25 11:34             ` Sebastian Wiesner
  2013-11-25 11:33           ` Sebastian Wiesner
  1 sibling, 1 reply; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-25 10:54 UTC (permalink / raw)
  To: Stefan Monnier, Sebastian Wiesner; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

The changes look good to me. Once they are approved by Stefan make sure to mention them in the NEWS.

-- 
Cheers,
Bozhidar

On November 25, 2013 at 12:43:14 PM, Sebastian Wiesner (lunaryorn@gmail.com) wrote:

2013/11/25 Sebastian Wiesner <lunaryorn@gmail.com>:  
> 2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:  
>>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also  
>>> look at a corresponding property, e.g. `interactive-use-only`.  
>>> Anything else?  
>>  
>> We should also make byte-compile-interactive-only-functions obsolete and  
>> default it to nil (i.e. move its contents to symbol properties).  
>  
> Attached is a patch to Emacs trunk, which introduces a  
> `interactive-only' symbol property as either a string with a "use  
> instead" message or just t, sets this property on all functions from  
> byte-compile-interactive-only-functions, and makes  
> byte-compile-interactive-only-functions as obsolete.  
>  
> Documentation and tests are missing. If you can point me to the  
> proper places and tell me how to run the Emacs tests, I can add these  
> as well.  

Ok, *now* it's attached. Sorry  
- interactive-only-property.patch, 9 KB

[-- Attachment #2: Type: text/html, Size: 2138 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 10:42         ` Sebastian Wiesner
  2013-11-25 10:54           ` Bozhidar Batsov
@ 2013-11-25 11:33           ` Sebastian Wiesner
  2013-11-25 14:58             ` Stefan Monnier
  1 sibling, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 11:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

2013/11/25 Sebastian Wiesner <lunaryorn@gmail.com>:
> 2013/11/25 Sebastian Wiesner <lunaryorn@gmail.com>:
>> 2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:
>>>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also
>>>> look at a corresponding property, e.g. `interactive-use-only`.
>>>> Anything else?
>>>
>>> We should also make byte-compile-interactive-only-functions obsolete and
>>> default it to nil (i.e. move its contents to symbol properties).
>>
>> Attached is a patch to Emacs trunk, which introduces a
>> `interactive-only' symbol property as either a string with a "use
>> instead" message or just t, sets this property on all functions from
>> byte-compile-interactive-only-functions, and makes
>> byte-compile-interactive-only-functions as obsolete.
>>
>> Documentation and tests are missing.  If you can point me to the
>> proper places and tell me how to run the Emacs tests, I can add these
>> as well.
>
> Ok, *now* it's attached.  Sorry

I fixed a little mistake, please use the patch attached to this mail instead.

[-- Attachment #2: interactive-only-property.patch --]
[-- Type: application/octet-stream, Size: 6557 bytes --]

=== modified file 'lisp/comint.el'
--- lisp/comint.el	2013-10-29 16:11:50 +0000
+++ lisp/comint.el	2013-11-25 10:37:38 +0000
@@ -752,6 +752,7 @@
   (let ((name (file-name-nondirectory program)))
     (switch-to-buffer (make-comint name program))
     (run-hooks (intern-soft (concat "comint-" name "-hook")))))
+(put 'comint-run 'interactive-only t)
 
 (defun comint-exec (buffer name command startfile switches)
   "Start up a process named NAME in buffer BUFFER for Comint modes.

=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- lisp/emacs-lisp/bytecomp.el	2013-10-30 02:45:53 +0000
+++ lisp/emacs-lisp/bytecomp.el	2013-11-25 11:31:48 +0000
@@ -353,11 +353,11 @@
                   (t
                    (append byte-compile-warnings (list warning)))))))
 
-(defvar byte-compile-interactive-only-functions
-  '(beginning-of-buffer end-of-buffer replace-string replace-regexp
-    insert-file insert-buffer insert-file-literally previous-line next-line
-    goto-line comint-run delete-backward-char)
+(defvar byte-compile-interactive-only-functions nil 
   "List of commands that are not meant to be called from Lisp.")
+(make-obsolete-variable 'byte-compile-interactive-only-functions
+			"use the `interactive-only' symbol property instead"
+			"24.4")
 
 (defvar byte-compile-not-obsolete-vars nil
   "List of variables that shouldn't be reported as obsolete.")
@@ -2929,13 +2929,19 @@
              (byte-compile-variable-ref form))))
      ((symbolp (car form))
       (let* ((fn (car form))
-             (handler (get fn 'byte-compile)))
+             (handler (get fn 'byte-compile))
+	     (interactive-only (or (get fn 'interactive-only)
+				   (memq fn byte-compile-interactive-only-functions))))
         (when (macroexp--const-symbol-p fn)
           (byte-compile-warn "`%s' called as a function" fn))
-        (and (byte-compile-warning-enabled-p 'interactive-only)
-             (memq fn byte-compile-interactive-only-functions)
-             (byte-compile-warn "`%s' used from Lisp code\n\
-That command is designed for interactive use only" fn))
+	(when (and (byte-compile-warning-enabled-p 'interactive-only)
+		   interactive-only)
+	  (byte-compile-warn "`%s' used from Lisp code\n\
+That command is designed for interactive use only.\n%s"
+                             fn
+			     (if (stringp interactive-only)
+				 interactive-only
+			       "Consult the documentation for an alternative")))
         (if (and (fboundp (car form))
                  (eq (car-safe (symbol-function (car form))) 'macro))
             (byte-compile-log-warning

=== modified file 'lisp/files.el'
--- lisp/files.el	2013-10-30 02:14:16 +0000
+++ lisp/files.el	2013-11-25 10:33:10 +0000
@@ -2085,6 +2085,8 @@
 \(Its calling sequence is different; see its documentation)."
   (interactive "*fInsert file literally: ")
   (insert-file-1 filename #'insert-file-contents-literally))
+(put 'insert-file-literally 'interactive-only
+     "Use `insert-file-contents-literally' instead")
 
 (defvar find-file-literally nil
   "Non-nil if this buffer was made by `find-file-literally' or equivalent.
@@ -5007,6 +5009,7 @@
 \(Its calling sequence is different; see its documentation)."
   (interactive "*fInsert file: ")
   (insert-file-1 filename #'insert-file-contents))
+(put 'insert-file 'interactive-only "Use `insert-file-contents' instead.")
 
 (defun append-to-file (start end filename)
   "Append the contents of the region to the end of file FILENAME.

=== modified file 'lisp/replace.el'
--- lisp/replace.el	2013-11-13 20:48:35 +0000
+++ lisp/replace.el	2013-11-25 10:31:11 +0000
@@ -523,6 +523,8 @@
 	   (if (and transient-mark-mode mark-active)
 	       (region-end)))))
   (perform-replace from-string to-string nil nil delimited nil nil start end))
+(put 'replace-string 'interactive-only
+     "Use `search-forward' and `replace-match' instead.")
 
 (defun replace-regexp (regexp to-string &optional delimited start end)
   "Replace things after point matching REGEXP with TO-STRING.
@@ -590,6 +592,8 @@
 	   (if (and transient-mark-mode mark-active)
 	       (region-end)))))
   (perform-replace regexp to-string nil t delimited nil nil start end))
+(put 'replace-regexp 'interactive-only
+     "Use `re-search-forward' and `replace-match' instead.")
 
 \f
 (defvar regexp-history nil

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2013-10-30 02:45:53 +0000
+++ lisp/simple.el	2013-11-25 10:38:10 +0000
@@ -888,6 +888,7 @@
 			(/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
 		 (point-min))))
   (if (and arg (not (consp arg))) (forward-line 1)))
+(put 'beginning-of-buffer 'interactive-only "Use (goto-char (point-min)) instead")
 
 (defun end-of-buffer (&optional arg)
   "Move point to the end of the buffer.
@@ -920,6 +921,7 @@
 	 ;; then scroll specially to put it near, but not at, the bottom.
 	 (overlay-recenter (point))
 	 (recenter -3))))
+(put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead")
 
 (defcustom delete-active-region t
   "Whether single-char deletion commands delete an active region.
@@ -982,6 +984,7 @@
 	     (insert-char ?\s (- ocol (current-column)) nil))))
 	;; Otherwise, do simple deletion.
 	(t (delete-char (- n) killflag))))
+(put 'delete-backward-char 'interactive-only t)
 
 (defun delete-forward-char (n &optional killflag)
   "Delete the following N characters (previous if N is negative).
@@ -1079,6 +1082,7 @@
     (if (eq selective-display t)
 	(re-search-forward "[\n\C-m]" nil 'end (1- line))
       (forward-line (1- line)))))
+(put 'goto-line 'interactive-only "Use `forward-line' instead")
 
 (defun count-words-region (start end &optional arg)
   "Count the number of words in the region.
@@ -4165,6 +4169,7 @@
      (insert-buffer-substring (get-buffer buffer))
      (point)))
   nil)
+(put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead")
 
 (defun append-to-buffer (buffer start end)
   "Append to specified buffer the text of the region.
@@ -4763,6 +4768,7 @@
 	   (signal (car err) (cdr err))))
       (line-move arg nil nil try-vscroll)))
   nil)
+(put 'next-line 'interactive-only "Use `forward-line' instead")
 
 (defun previous-line (&optional arg try-vscroll)
   "Move cursor vertically up ARG lines.
@@ -4802,6 +4808,8 @@
 	 (signal (car err) (cdr err))))
     (line-move (- arg) nil nil try-vscroll))
   nil)
+(put 'previous-line 'interactive-only
+     "Use `forward-line' with negative argument instead")
 
 (defcustom track-eol nil
   "Non-nil means vertical motion starting at end of line keeps to ends of lines.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 10:54           ` Bozhidar Batsov
@ 2013-11-25 11:34             ` Sebastian Wiesner
  2013-11-25 13:11               ` Bozhidar Batsov
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 11:34 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: Stefan Monnier, emacs-devel

2013/11/25 Bozhidar Batsov <bozhidar@batsov.com>:
> The changes look good to me. Once they are approved by Stefan make sure to
> mention them in the NEWS.

Uhm, sorry, what am I supposed to do?  I am not familiar with Emacs'
development process and policies, and thus have no clue what you mean.
 Besides, I have no intention to get deeply involved, so I'd prefer if
someone else did all this organizational stuff.

> --
> Cheers,
> Bozhidar
>
> On November 25, 2013 at 12:43:14 PM, Sebastian Wiesner (lunaryorn@gmail.com)
> wrote:
>
> 2013/11/25 Sebastian Wiesner <lunaryorn@gmail.com>:
>> 2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:
>>>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also
>>>> look at a corresponding property, e.g. `interactive-use-only`.
>>>> Anything else?
>>>
>>> We should also make byte-compile-interactive-only-functions obsolete and
>>> default it to nil (i.e. move its contents to symbol properties).
>>
>> Attached is a patch to Emacs trunk, which introduces a
>> `interactive-only' symbol property as either a string with a "use
>> instead" message or just t, sets this property on all functions from
>> byte-compile-interactive-only-functions, and makes
>> byte-compile-interactive-only-functions as obsolete.
>>
>> Documentation and tests are missing. If you can point me to the
>> proper places and tell me how to run the Emacs tests, I can add these
>> as well.
>
> Ok, *now* it's attached. Sorry
> ________________________________
> - interactive-only-property.patch, 9 KB



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 11:34             ` Sebastian Wiesner
@ 2013-11-25 13:11               ` Bozhidar Batsov
  0 siblings, 0 replies; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-25 13:11 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]

No problem. If Stefan is OK with the patch I’ll install it myself and add whatever else is necessary.

-- 
Cheers,
Bozhidar

On November 25, 2013 at 1:34:44 PM, Sebastian Wiesner (lunaryorn@gmail.com) wrote:

2013/11/25 Bozhidar Batsov <bozhidar@batsov.com>:  
> The changes look good to me. Once they are approved by Stefan make sure to  
> mention them in the NEWS.  

Uhm, sorry, what am I supposed to do? I am not familiar with Emacs'  
development process and policies, and thus have no clue what you mean.  
Besides, I have no intention to get deeply involved, so I'd prefer if  
someone else did all this organizational stuff.  

> --  
> Cheers,  
> Bozhidar  
>  
> On November 25, 2013 at 12:43:14 PM, Sebastian Wiesner (lunaryorn@gmail.com)  
> wrote:  
>  
> 2013/11/25 Sebastian Wiesner <lunaryorn@gmail.com>:  
>> 2013/11/25 Stefan Monnier <monnier@iro.umontreal.ca>:  
>>>> I presume I'd just patch `byte-compile-form' in bytecomp.el to also  
>>>> look at a corresponding property, e.g. `interactive-use-only`.  
>>>> Anything else?  
>>>  
>>> We should also make byte-compile-interactive-only-functions obsolete and  
>>> default it to nil (i.e. move its contents to symbol properties).  
>>  
>> Attached is a patch to Emacs trunk, which introduces a  
>> `interactive-only' symbol property as either a string with a "use  
>> instead" message or just t, sets this property on all functions from  
>> byte-compile-interactive-only-functions, and makes  
>> byte-compile-interactive-only-functions as obsolete.  
>>  
>> Documentation and tests are missing. If you can point me to the  
>> proper places and tell me how to run the Emacs tests, I can add these  
>> as well.  
>  
> Ok, *now* it's attached. Sorry  
> ________________________________  
> - interactive-only-property.patch, 9 KB  

[-- Attachment #2: Type: text/html, Size: 2838 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 11:33           ` Sebastian Wiesner
@ 2013-11-25 14:58             ` Stefan Monnier
  2013-11-25 15:42               ` Sebastian Wiesner
  0 siblings, 1 reply; 23+ messages in thread
From: Stefan Monnier @ 2013-11-25 14:58 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: emacs-devel

> +(put 'comint-run 'interactive-only t)

The non-interactive replacement is `make-comint'.

> +(put 'delete-backward-char 'interactive-only t)

Replaced by `delete-char'.

Looks good, thanks.


        Stefan



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 14:58             ` Stefan Monnier
@ 2013-11-25 15:42               ` Sebastian Wiesner
  2013-11-25 17:17                 ` Bozhidar Batsov
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 15:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]


>> +(put 'comint-run 'interactive-only t)
> 
> The non-interactive replacement is `make-comint'.
> 
>> +(put 'delete-backward-char 'interactive-only t)
> 
> Replaced by `delete-char'.
> 
> Looks good, thanks.

Updated.


[-- Attachment #2: interactive-only-property.patch --]
[-- Type: application/octet-stream, Size: 6770 bytes --]

=== modified file 'lisp/comint.el'
--- lisp/comint.el	2013-10-29 16:11:50 +0000
+++ lisp/comint.el	2013-11-25 15:38:14 +0000
@@ -752,6 +752,7 @@
   (let ((name (file-name-nondirectory program)))
     (switch-to-buffer (make-comint name program))
     (run-hooks (intern-soft (concat "comint-" name "-hook")))))
+(put 'comint-run 'interactive-only "Use `make-comint' instead")
 
 (defun comint-exec (buffer name command startfile switches)
   "Start up a process named NAME in buffer BUFFER for Comint modes.

=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- lisp/emacs-lisp/bytecomp.el	2013-10-30 02:45:53 +0000
+++ lisp/emacs-lisp/bytecomp.el	2013-11-25 11:31:48 +0000
@@ -353,11 +353,11 @@
                   (t
                    (append byte-compile-warnings (list warning)))))))
 
-(defvar byte-compile-interactive-only-functions
-  '(beginning-of-buffer end-of-buffer replace-string replace-regexp
-    insert-file insert-buffer insert-file-literally previous-line next-line
-    goto-line comint-run delete-backward-char)
+(defvar byte-compile-interactive-only-functions nil 
   "List of commands that are not meant to be called from Lisp.")
+(make-obsolete-variable 'byte-compile-interactive-only-functions
+			"use the `interactive-only' symbol property instead"
+			"24.4")
 
 (defvar byte-compile-not-obsolete-vars nil
   "List of variables that shouldn't be reported as obsolete.")
@@ -2929,13 +2929,19 @@
              (byte-compile-variable-ref form))))
      ((symbolp (car form))
       (let* ((fn (car form))
-             (handler (get fn 'byte-compile)))
+             (handler (get fn 'byte-compile))
+	     (interactive-only (or (get fn 'interactive-only)
+				   (memq fn byte-compile-interactive-only-functions))))
         (when (macroexp--const-symbol-p fn)
           (byte-compile-warn "`%s' called as a function" fn))
-        (and (byte-compile-warning-enabled-p 'interactive-only)
-             (memq fn byte-compile-interactive-only-functions)
-             (byte-compile-warn "`%s' used from Lisp code\n\
-That command is designed for interactive use only" fn))
+	(when (and (byte-compile-warning-enabled-p 'interactive-only)
+		   interactive-only)
+	  (byte-compile-warn "`%s' used from Lisp code\n\
+That command is designed for interactive use only.\n%s"
+                             fn
+			     (if (stringp interactive-only)
+				 interactive-only
+			       "Consult the documentation for an alternative")))
         (if (and (fboundp (car form))
                  (eq (car-safe (symbol-function (car form))) 'macro))
             (byte-compile-log-warning

=== modified file 'lisp/files.el'
--- lisp/files.el	2013-10-30 02:14:16 +0000
+++ lisp/files.el	2013-11-25 10:33:10 +0000
@@ -2085,6 +2085,8 @@
 \(Its calling sequence is different; see its documentation)."
   (interactive "*fInsert file literally: ")
   (insert-file-1 filename #'insert-file-contents-literally))
+(put 'insert-file-literally 'interactive-only
+     "Use `insert-file-contents-literally' instead")
 
 (defvar find-file-literally nil
   "Non-nil if this buffer was made by `find-file-literally' or equivalent.
@@ -5007,6 +5009,7 @@
 \(Its calling sequence is different; see its documentation)."
   (interactive "*fInsert file: ")
   (insert-file-1 filename #'insert-file-contents))
+(put 'insert-file 'interactive-only "Use `insert-file-contents' instead.")
 
 (defun append-to-file (start end filename)
   "Append the contents of the region to the end of file FILENAME.

=== modified file 'lisp/replace.el'
--- lisp/replace.el	2013-11-13 20:48:35 +0000
+++ lisp/replace.el	2013-11-25 10:31:11 +0000
@@ -523,6 +523,8 @@
 	   (if (and transient-mark-mode mark-active)
 	       (region-end)))))
   (perform-replace from-string to-string nil nil delimited nil nil start end))
+(put 'replace-string 'interactive-only
+     "Use `search-forward' and `replace-match' instead.")
 
 (defun replace-regexp (regexp to-string &optional delimited start end)
   "Replace things after point matching REGEXP with TO-STRING.
@@ -590,6 +592,8 @@
 	   (if (and transient-mark-mode mark-active)
 	       (region-end)))))
   (perform-replace regexp to-string nil t delimited nil nil start end))
+(put 'replace-regexp 'interactive-only
+     "Use `re-search-forward' and `replace-match' instead.")
 
 \f
 (defvar regexp-history nil

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2013-10-30 02:45:53 +0000
+++ lisp/simple.el	2013-11-25 15:38:45 +0000
@@ -888,6 +888,7 @@
 			(/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
 		 (point-min))))
   (if (and arg (not (consp arg))) (forward-line 1)))
+(put 'beginning-of-buffer 'interactive-only "Use (goto-char (point-min)) instead")
 
 (defun end-of-buffer (&optional arg)
   "Move point to the end of the buffer.
@@ -920,6 +921,7 @@
 	 ;; then scroll specially to put it near, but not at, the bottom.
 	 (overlay-recenter (point))
 	 (recenter -3))))
+(put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead")
 
 (defcustom delete-active-region t
   "Whether single-char deletion commands delete an active region.
@@ -982,6 +984,7 @@
 	     (insert-char ?\s (- ocol (current-column)) nil))))
 	;; Otherwise, do simple deletion.
 	(t (delete-char (- n) killflag))))
+(put 'delete-backward-char 'interactive-only "Use `delete-char' instead")
 
 (defun delete-forward-char (n &optional killflag)
   "Delete the following N characters (previous if N is negative).
@@ -1079,6 +1082,7 @@
     (if (eq selective-display t)
 	(re-search-forward "[\n\C-m]" nil 'end (1- line))
       (forward-line (1- line)))))
+(put 'goto-line 'interactive-only "Use `forward-line' instead")
 
 (defun count-words-region (start end &optional arg)
   "Count the number of words in the region.
@@ -4165,6 +4169,7 @@
      (insert-buffer-substring (get-buffer buffer))
      (point)))
   nil)
+(put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead")
 
 (defun append-to-buffer (buffer start end)
   "Append to specified buffer the text of the region.
@@ -4763,6 +4768,7 @@
 	   (signal (car err) (cdr err))))
       (line-move arg nil nil try-vscroll)))
   nil)
+(put 'next-line 'interactive-only "Use `forward-line' instead")
 
 (defun previous-line (&optional arg try-vscroll)
   "Move cursor vertically up ARG lines.
@@ -4802,6 +4808,8 @@
 	 (signal (car err) (cdr err))))
     (line-move (- arg) nil nil try-vscroll))
   nil)
+(put 'previous-line 'interactive-only
+     "Use `forward-line' with negative argument instead")
 
 (defcustom track-eol nil
   "Non-nil means vertical motion starting at end of line keeps to ends of lines.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 15:42               ` Sebastian Wiesner
@ 2013-11-25 17:17                 ` Bozhidar Batsov
  2013-11-25 17:48                   ` Sebastian Wiesner
  2013-11-26  3:18                   ` Glenn Morris
  0 siblings, 2 replies; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-25 17:17 UTC (permalink / raw)
  To: Stefan Monnier, Sebastian Wiesner; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

Installed. Thanks!

-- 
Cheers,
Bozhidar

On November 25, 2013 at 5:43:17 PM, Sebastian Wiesner (lunaryorn@gmail.com) wrote:


>> +(put 'comint-run 'interactive-only t)  
>  
> The non-interactive replacement is `make-comint'.  
>  
>> +(put 'delete-backward-char 'interactive-only t)  
>  
> Replaced by `delete-char'.  
>  
> Looks good, thanks.  

Updated.  

- interactive-only-property.patch, 9.2 KB

[-- Attachment #2: Type: text/html, Size: 1286 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 17:17                 ` Bozhidar Batsov
@ 2013-11-25 17:48                   ` Sebastian Wiesner
  2013-11-25 19:36                     ` Bozhidar Batsov
  2013-11-26  3:18                   ` Glenn Morris
  1 sibling, 1 reply; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-25 17:48 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]


> Installed. Thanks!

Thank you :)

I noticed, however, that you did not add documentation.  Should I write some?  I’m familiar with Texinfo, but I don’t know where to find the source…

> -- 
> Cheers,
> Bozhidar
> 
> On November 25, 2013 at 5:43:17 PM, Sebastian Wiesner (lunaryorn@gmail.com) wrote:
> 
>> 
>> >> +(put 'comint-run 'interactive-only t) 
>> > 
>> > The non-interactive replacement is `make-comint'. 
>> > 
>> >> +(put 'delete-backward-char 'interactive-only t) 
>> > 
>> > Replaced by `delete-char'. 
>> > 
>> > Looks good, thanks. 
>> 
>> Updated. 
>> 
>> - interactive-only-property.patch, 9.2 KB


[-- Attachment #2: Type: text/html, Size: 1720 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 17:48                   ` Sebastian Wiesner
@ 2013-11-25 19:36                     ` Bozhidar Batsov
  0 siblings, 0 replies; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-25 19:36 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

I don't think the old behavior was documented at all, but I think the
"functions" or "byte-compilation" sections of the Emacs Lisp manual would
be good places for the documentation of this functionality. The "functions"
section of the manual is in doc/lispref/functions.texi


On 25 November 2013 19:48, Sebastian Wiesner <lunaryorn@gmail.com> wrote:

>
> Installed. Thanks!
>
>
> Thank you :)
>
> I noticed, however, that you did not add documentation.  Should I write
> some?  I’m familiar with Texinfo, but I don’t know where to find the source…
>
> --
> Cheers,
> Bozhidar
>
> On November 25, 2013 at 5:43:17 PM, Sebastian Wiesner (lunaryorn@gmail.com<//lunaryorn@gmail.com>)
> wrote:
>
>
> >> +(put 'comint-run 'interactive-only t)
> >
> > The non-interactive replacement is `make-comint'.
> >
> >> +(put 'delete-backward-char 'interactive-only t)
> >
> > Replaced by `delete-char'.
> >
> > Looks good, thanks.
>
> Updated.
>
> ------------------------------
> - interactive-only-property.patch, 9.2 KB
>
>
>

[-- Attachment #2: Type: text/html, Size: 2078 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-25 17:17                 ` Bozhidar Batsov
  2013-11-25 17:48                   ` Sebastian Wiesner
@ 2013-11-26  3:18                   ` Glenn Morris
  2013-11-26  6:46                     ` Bozhidar Batsov
  2013-11-26 21:16                     ` Sebastian Wiesner
  1 sibling, 2 replies; 23+ messages in thread
From: Glenn Morris @ 2013-11-26  3:18 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: Sebastian Wiesner, Stefan Monnier, emacs-devel


When installing changes by others, please think about the copyright
assignment aspect. The rule is, we can accept no more than 10-15 lines
total (cumulative over all changes) from any one person without an
assignment. Changes that fall under that rule should be marked "(tiny
change") in the ChangeLog.

I'd say this one qualifies as a tiny change (although it's more than 15
lines, much of it is mechanical). We would probably need a copyright
assignment to accept any more from this author, though.

Also, please try and use --author when you commit someone else's changes
(Emacs can do this for you).


BTW, I think it would be nicer if I could write:

  (put 'comint-run 'interactive-only 'make-comint)

instead of:

  (put 'comint-run 'interactive-only "Use `make-comint' instead")

Also, the installed change is inconsistent as to whether "Use `foo'
instead" should end in a period (I guess it should).

Also also, maybe "; use `foo' instead." with no preceding newline would
look better most of the time?



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-26  3:18                   ` Glenn Morris
@ 2013-11-26  6:46                     ` Bozhidar Batsov
  2013-11-26  9:06                       ` Andreas Schwab
       [not found]                       ` <CALf2awQ3TJcNq2GiXObEgPBm+JOqrveNrEaTak0E0ws+jrh3dw@mail.gmail.com>
  2013-11-26 21:16                     ` Sebastian Wiesner
  1 sibling, 2 replies; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-26  6:46 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Sebastian Wiesner, Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

On 26 November 2013 05:18, Glenn Morris <rgm@gnu.org> wrote:

>
> When installing changes by others, please think about the copyright
> assignment aspect. The rule is, we can accept no more than 10-15 lines
> total (cumulative over all changes) from any one person without an
> assignment. Changes that fall under that rule should be marked "(tiny
> change") in the ChangeLog.
>

I'm aware of this. I also know Sebastian from working on other projects and
he recently mentioned that he has signed the FSF contributor agreement,
that's why I didn't brought up the matter.


>
> I'd say this one qualifies as a tiny change (although it's more than 15
> lines, much of it is mechanical). We would probably need a copyright
> assignment to accept any more from this author, though.


> Also, please try and use --author when you commit someone else's changes
> (Emacs can do this for you).
>

Actually I committed this with Sebastian as the author, but I did so using
a git-bzr bridge and although in git I see him as the committer in bzr it's
me. I guess I should apply patches from other people using bzr directly
since obviously git-bzr doesn't handle this aspect of the workflow
correctly.


>
>
> BTW, I think it would be nicer if I could write:
>
>   (put 'comint-run 'interactive-only 'make-comint)
>
> instead of:
>
>   (put 'comint-run 'interactive-only "Use `make-comint' instead")
>

I've been thinking the same thing, but I noticed that some texts were more
complex than the common pattern, which is probably the motivation for the
use of the string argument.
I'll think a bit more how this could be improved further.


>
> Also, the installed change is inconsistent as to whether "Use `foo'
> instead" should end in a period (I guess it should).
>
> Also also, maybe "; use `foo' instead." with no preceding newline would
> look better most of the time?
>

I'll have a look at this.

[-- Attachment #2: Type: text/html, Size: 2985 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-26  6:46                     ` Bozhidar Batsov
@ 2013-11-26  9:06                       ` Andreas Schwab
  2013-11-26  9:24                         ` Bozhidar Batsov
       [not found]                       ` <CALf2awQ3TJcNq2GiXObEgPBm+JOqrveNrEaTak0E0ws+jrh3dw@mail.gmail.com>
  1 sibling, 1 reply; 23+ messages in thread
From: Andreas Schwab @ 2013-11-26  9:06 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: Sebastian Wiesner, Stefan Monnier, emacs-devel

Bozhidar Batsov <bozhidar@batsov.com> writes:

> Actually I committed this with Sebastian as the author, but I did so using
> a git-bzr bridge and although in git I see him as the committer in bzr it's
> me.

You want to set the author, not the committer.

> I guess I should apply patches from other people using bzr directly
> since obviously git-bzr doesn't handle this aspect of the workflow
> correctly.

git-bzr handles that correctly.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-26  9:06                       ` Andreas Schwab
@ 2013-11-26  9:24                         ` Bozhidar Batsov
  0 siblings, 0 replies; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-26  9:24 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Sebastian Wiesner, Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On November 26, 2013 at 11:06:13 AM, Andreas Schwab (schwab@suse.de) wrote:
Bozhidar Batsov <bozhidar@batsov.com> writes: 

> Actually I committed this with Sebastian as the author, but I did so using 
> a git-bzr bridge and although in git I see him as the committer in bzr it's 
> me. 

You want to set the author, not the committer. 
I think I did `git commit —author ...` and this seems to work OK in git. 

Maybe I’ve messed/missed something.



> I guess I should apply patches from other people using bzr directly 
> since obviously git-bzr doesn't handle this aspect of the workflow 
> correctly. 

git-bzr handles that correctly. 

Andreas. 

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de 
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 
"And now for something completely different." 

[-- Attachment #2: Type: text/html, Size: 2913 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
       [not found]                       ` <CALf2awQ3TJcNq2GiXObEgPBm+JOqrveNrEaTak0E0ws+jrh3dw@mail.gmail.com>
@ 2013-11-26  9:55                         ` Bozhidar Batsov
  2013-11-26 19:46                           ` Glenn Morris
  0 siblings, 1 reply; 23+ messages in thread
From: Bozhidar Batsov @ 2013-11-26  9:55 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 3198 bytes --]

On November 26, 2013 at 11:40:49 AM, Sebastian Wiesner (lunaryorn@gmail.com) wrote:
Am 26.11.2013 07:46 schrieb "Bozhidar Batsov" <bozhidar@batsov.com>:
>
> On 26 November 2013 05:18, Glenn Morris <rgm@gnu.org> wrote:
>>
>>
>> When installing changes by others, please think about the copyright
>> assignment aspect. The rule is, we can accept no more than 10-15 lines
>> total (cumulative over all changes) from any one person without an
>> assignment. Changes that fall under that rule should be marked "(tiny
>> change") in the ChangeLog.
>
>
> I'm aware of this. I also know Sebastian from working on other projects and he recently mentioned that he has signed the FSF contributor agreement, that's why I didn't brought up the matter.

That's a misunderstanding.  I have not signed an agreement, and certainly did not say so.

Hmm, I was fooled by this tweet of yours "Doesn't cover the hardest thing, though: Sitting at home and waiting for the FSF's CA papers :)”, because afterwards you asked me how long did it take for my paperwork to go through and I assumed you were waiting for your paperwork to go through. This was last month so now I simply thought you were done with the waiting and were starting to hack on Emacs. Obviously I was wrong.

I thought that this change would qualify as tiny, and thus didn't mention it.

Yeah. Glenn already mentioned he considers the change tiny.

It would be unfortunate if I had to go through the legal procedure for this little patch.  Had I know this, I would not have written it.

I should double check such details in the future. Since I work on so many projects on GitHub I’m not used to thinking about such legal details. Btw, where’s the list of people who have signed the agreement?


>  
>>
>>
>> I'd say this one qualifies as a tiny change (although it's more than 15
>> lines, much of it is mechanical). We would probably need a copyright
>> assignment to accept any more from this author, though. 
>>
>>
>> Also, please try and use --author when you commit someone else's changes
>> (Emacs can do this for you).
>
>
> Actually I committed this with Sebastian as the author, but I did so using a git-bzr bridge and although in git I see him as the committer in bzr it's me. I guess I should apply patches from other people using bzr directly since obviously git-bzr doesn't handle this aspect of the workflow correctly.
>  
>>
>>
>>
>> BTW, I think it would be nicer if I could write:
>>
>>   (put 'comint-run 'interactive-only 'make-comint)
>>
>> instead of:
>>
>>   (put 'comint-run 'interactive-only "Use `make-comint' instead")
>
>
> I've been thinking the same thing, but I noticed that some texts were more complex than the common pattern, which is probably the motivation for the use of the string argument.
> I'll think a bit more how this could be improved further.
>  
>>
>>
>> Also, the installed change is inconsistent as to whether "Use `foo'
>> instead" should end in a period (I guess it should).
>>
>> Also also, maybe "; use `foo' instead." with no preceding newline would
>> look better most of the time?
>
>
> I'll have a look at this. 

[-- Attachment #2: Type: text/html, Size: 6044 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-26  9:55                         ` Bozhidar Batsov
@ 2013-11-26 19:46                           ` Glenn Morris
  0 siblings, 0 replies; 23+ messages in thread
From: Glenn Morris @ 2013-11-26 19:46 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: Sebastian Wiesner, Stefan Monnier, emacs-devel

Bozhidar Batsov wrote:

> Btw, where's the list of people who have signed the agreement?

It is not publicly visible, since it is considered private data [1], but
if you have a gnu.org account, you can view it at
/gd/gnuorg/copyright.list. Otherwise, just ask the person, and/or
emacs-devel.

[1] eg
http://lists.gnu.org/archive/html/emacs-devel/2003-08/msg00030.html



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Mark custom function for interactive use only
  2013-11-26  3:18                   ` Glenn Morris
  2013-11-26  6:46                     ` Bozhidar Batsov
@ 2013-11-26 21:16                     ` Sebastian Wiesner
  1 sibling, 0 replies; 23+ messages in thread
From: Sebastian Wiesner @ 2013-11-26 21:16 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stefan Monnier, Bozhidar Batsov, emacs-devel

2013/11/26 Glenn Morris <rgm@gnu.org>:
>
> When installing changes by others, please think about the copyright
> assignment aspect. The rule is, we can accept no more than 10-15 lines
> total (cumulative over all changes) from any one person without an
> assignment. Changes that fall under that rule should be marked "(tiny
> change") in the ChangeLog.
>
> I'd say this one qualifies as a tiny change (although it's more than 15
> lines, much of it is mechanical). We would probably need a copyright
> assignment to accept any more from this author, though.

Meaning, that if I were to write documentation for this feature as
well, I'd have to sign a copyright assignment?

> Also, please try and use --author when you commit someone else's changes
> (Emacs can do this for you).
>
>
> BTW, I think it would be nicer if I could write:
>
>   (put 'comint-run 'interactive-only 'make-comint)
>
> instead of:
>
>   (put 'comint-run 'interactive-only "Use `make-comint' instead")

I agree.  I did not think of that.

However, a string still needs to be allowed, to handle cases, where
there is no single alternative.  For instance, "replace-regexp" should
be replaced with a while loop over "re-search-forward" and
"replace-match".

> Also, the installed change is inconsistent as to whether "Use `foo'
> instead" should end in a period (I guess it should).

Well, the original message did not end in a period, as do all messages
in bytecomp.el.  Hence, I omitted the period in the messages, but I
did not apply much care, since this did not seem so important to me.

> Also also, maybe "; use `foo' instead." with no preceding newline would
> look better most of the time?

I tried, but if the original message, i.e. “foo used from…designed for
interactive use only”, should be retained, this formatting gives very
long messages in some cases.



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-11-26 21:16 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-24 15:29 Mark custom function for interactive use only Sebastian Wiesner
2013-11-24 18:22 ` Stefan Monnier
2013-11-24 19:52   ` Sebastian Wiesner
2013-11-25  3:10     ` Stefan Monnier
2013-11-25 10:05       ` Sebastian Wiesner
2013-11-25 10:41       ` Sebastian Wiesner
2013-11-25 10:42         ` Sebastian Wiesner
2013-11-25 10:54           ` Bozhidar Batsov
2013-11-25 11:34             ` Sebastian Wiesner
2013-11-25 13:11               ` Bozhidar Batsov
2013-11-25 11:33           ` Sebastian Wiesner
2013-11-25 14:58             ` Stefan Monnier
2013-11-25 15:42               ` Sebastian Wiesner
2013-11-25 17:17                 ` Bozhidar Batsov
2013-11-25 17:48                   ` Sebastian Wiesner
2013-11-25 19:36                     ` Bozhidar Batsov
2013-11-26  3:18                   ` Glenn Morris
2013-11-26  6:46                     ` Bozhidar Batsov
2013-11-26  9:06                       ` Andreas Schwab
2013-11-26  9:24                         ` Bozhidar Batsov
     [not found]                       ` <CALf2awQ3TJcNq2GiXObEgPBm+JOqrveNrEaTak0E0ws+jrh3dw@mail.gmail.com>
2013-11-26  9:55                         ` Bozhidar Batsov
2013-11-26 19:46                           ` Glenn Morris
2013-11-26 21:16                     ` Sebastian Wiesner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).