Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:25:45+00:00 2026-06-07T15:25:45+00:00

Due to emacs interlocking files I want to run org-mobile command via cron but

  • 0

Due to emacs interlocking files I want to run org-mobile command via cron but using the emacsclient:

emacsclient -nw --eval "(org-mobile-pull)" --eval "(org-mobile-push)"

but if there is no emacs server running I want the command to run using emacs batch mode:

emacs --batch --eval "(org-mobile-pull)" --eval "(org-mobile-push)"

I’m not sure how to accomplish this so curious if anyone has any ideas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:25:47+00:00Added an answer on June 7, 2026 at 3:25 pm

    I’m curious what you’re ultimately trying to accomplish? Why not just always
    start a new Emacs process? The additional overhead would be a small fraction of a second

    On my 2 year old MBP:

    % time emacs –batch –eval nil
    emacs –batch –eval nil 0.03s user 0.01s system 87% cpu 0.054 total

    Going down your current path, you can check the exit code from emacsclient
    to decide if you should run in batch

    if emacsclient --eval nil >/dev/null 2>&1; then echo "run client"; else echo "run emacs"; fi
    

    EDIT: I see you want to script an answer to the lock stealing question. Check
    out my answer to this question for using ask-user-about-lock to solve this.

    EDIT: So the idea is to redefine ask-user-about-lock to return t. See docs:

    ask-user-about-lock is an autoloaded Lisp function in `userlock.el’.

    (ask-user-about-lock FILE OPPONENT)

    Ask user what to do when he wants to edit FILE but it is locked by OPPONENT.
    This function has a choice of three things to do:
    do (signal ‘file-locked (list FILE OPPONENT))
    to refrain from editing the file
    return t (grab the lock on the file)
    return nil (edit the file even though it is locked).
    You can redefine this function to choose among those three alternatives
    in any way you like.

    [back]

    script example (remember to chmod)

    #!/usr/bin/env emacs --script
    
    (defun ask-user-about-lock (file opponent)
      t)
    
    (org-mobile-pull)
    (org-mobile-push)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Due to my problem that I am unable to run dos command via my
In GNU Emacs, I want to run a program, figlet, on the currently selected
I'm using outline-mode (org-mode mostly) in emacs, and use grep-mode to search. What annoys
Due to a harddrive crash, I lost my SQL server database files for a
I'm a starter with Emacs (but quite experienced Vim user) and trying to play
Due to a merger, we have inherited a couple of legacy apps which run
I'm trying to use flymake on emacs 22.3.1 on openSuse 11 but I got
Due to the need to run a 15+ year old application I wish to
Due to my current implementation of using QR Codes, I cannot change the request
Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.