mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Replace some calls to `intern' with DEFSYMs
* src/filelock.c (lock_file, unlock_file_handle_error): Call constant symbols rather than interning them all the time. (syms_of_filelock): New symbols Qask_user_about_lock, Quserlock__handle_unlock_error, and Quserlock__ask_user_about_supersession_threat.
This commit is contained in:
parent
9b7402c5fd
commit
b392038560
1 changed files with 7 additions and 3 deletions
|
|
@ -605,7 +605,7 @@ lock_file (Lisp_Object fn)
|
||||||
&& NILP (Fverify_visited_file_modtime (subject_buf))
|
&& NILP (Fverify_visited_file_modtime (subject_buf))
|
||||||
&& !NILP (Ffile_exists_p (fn))
|
&& !NILP (Ffile_exists_p (fn))
|
||||||
&& !(!NILP (lfname) && current_lock_owner (NULL, lfname) == I_OWN_IT))
|
&& !(!NILP (lfname) && current_lock_owner (NULL, lfname) == I_OWN_IT))
|
||||||
calln (intern ("userlock--ask-user-about-supersession-threat"), fn);
|
calln (Quserlock__ask_user_about_supersession_threat, fn);
|
||||||
|
|
||||||
/* Don't do locking if the user has opted out. */
|
/* Don't do locking if the user has opted out. */
|
||||||
if (!NILP (lfname))
|
if (!NILP (lfname))
|
||||||
|
|
@ -623,7 +623,7 @@ lock_file (Lisp_Object fn)
|
||||||
memmove (dot + replacementlen, dot + 1, pidlen);
|
memmove (dot + replacementlen, dot + 1, pidlen);
|
||||||
strcpy (dot + replacementlen + pidlen, ")");
|
strcpy (dot + replacementlen + pidlen, ")");
|
||||||
memcpy (dot, replacement, replacementlen);
|
memcpy (dot, replacement, replacementlen);
|
||||||
attack = calln (intern ("ask-user-about-lock"), fn,
|
attack = calln (Qask_user_about_lock, fn,
|
||||||
build_string (lock_info.user));
|
build_string (lock_info.user));
|
||||||
/* Take the lock if the user said so. */
|
/* Take the lock if the user said so. */
|
||||||
if (!NILP (attack))
|
if (!NILP (attack))
|
||||||
|
|
@ -653,7 +653,7 @@ unlock_file (Lisp_Object fn)
|
||||||
static Lisp_Object
|
static Lisp_Object
|
||||||
unlock_file_handle_error (Lisp_Object err)
|
unlock_file_handle_error (Lisp_Object err)
|
||||||
{
|
{
|
||||||
calln (intern ("userlock--handle-unlock-error"), err);
|
calln (Quserlock__handle_unlock_error, err);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -827,6 +827,10 @@ Info node `(emacs)Interlocking'. */);
|
||||||
DEFSYM (Qfile_locked_p, "file-locked-p");
|
DEFSYM (Qfile_locked_p, "file-locked-p");
|
||||||
DEFSYM (Qmake_lock_file_name, "make-lock-file-name");
|
DEFSYM (Qmake_lock_file_name, "make-lock-file-name");
|
||||||
DEFSYM (Qstring_replace, "string-replace");
|
DEFSYM (Qstring_replace, "string-replace");
|
||||||
|
DEFSYM (Qask_user_about_lock, "ask-user-about-lock");
|
||||||
|
DEFSYM (Quserlock__handle_unlock_error, "userlock--handle-unlock-error");
|
||||||
|
DEFSYM (Quserlock__ask_user_about_supersession_threat,
|
||||||
|
"userlock--ask-user-about-supersession-threat");
|
||||||
|
|
||||||
defsubr (&Slock_file);
|
defsubr (&Slock_file);
|
||||||
defsubr (&Sunlock_file);
|
defsubr (&Sunlock_file);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue