texts: How to get gpg-agent to cache the passphrases I enter when reading/saving *.gpg files?

texts:
I want to work with gpg-encrypted files using Emacs, and would like to be able to enter the passphrase for each encrypted file only once per Emacs session.

I used to be able to do this by setting the variable epa-file-cache-passphrase-for-symmetric-encryption to t, but this no longer works.  The explanation can be found in the last line of the documentation for the variable epa-file-cache-passphrase-for-symmetric-encryption:

(defcustom epa-file-cache-passphrase-for-symmetric-encryption nil
  "If non-nil, cache passphrase for symmetric encryption.

For security reasons, this option is turned off by default and
not recommended to use.  Instead, consider using gpg-agent which
does the same job in a safer way.  See Info node `(epa) Caching
Passphrases' for more information.

Note that this option has no effect if you use GnuPG 2.0."
  :type 'boolean
  :group 'epa-file)

After a recent system update, the gpg in my system is now version 2.1.8, which renders epa-file-cache-passphrase-for-symmetric-encryption ineffective.

The references mentioned in the documentation above lead to a page that just tells you, again, to use gpg-agent, but says nothing about how to do it.  I have not been able to find clear instructions on how to set up gpg-agent for the use-case I described at the beginning of this post.  Any help would be appreciated.

FWIW, ps tells me that /usr/bin/gpg-agent --supervised is indeed running.  What else must I do to get it to cache the passphrases I enter when working with *.gpg files?

Also, the value of my epg-gpg-program variable is /usr/bin/gpg, which refers to the installed version 2.1.8 instance of gpg mentioned earlier.

The versions of Emacs I am using are 26.0.50 and 27.0.50.  For both cases, the version of the epa package is 23.1.


texts:
I'm working with a codebase that's meant to be built with a proprietary C compiler using tons of esoteric language extensions. Ideally, I'd like to stick to my chosen environment as much as possible, but parsing the code for syntax/tags is hard.

The custom attributes can be handled by passing stuff like -D __no_init= to clang, but then we have stuff like this in the header files:

__saddr __no_init volatile union { unsigned char P14; __BITS8 P14_bit; } @ 0xFFF0E;

which makes it tough to find P14_bit as a tag. After some fiddling, it seems that clang actually accepts references to P14_bit as valid.

It seems, instead, that the gtags backend doesn't parse it "correctly". It picks up and indexes __BITS8 and other macros/typedefs in the same file, but P14_bit and P14 aren't indexed by

Does anyone have any workaround hacks to suggest?


texts:
Where does magit get push credentials from?

I have been using magit happily for quite some time.

I installed a new (OSX) machine with the same emacs (spacemacs) config I use on other machines, yet for some reason I cannot push from magit on this machine.

On both machines I can git push from my user shell just fine (zsh). Also, I use git and not https repositories with github.

So, what are the things I should check?
Where magit gets it's credentials from/what commands does it call/is there an error log somewhere?


texts: magit function to check if a branch is in sync with remote

texts:
Is there a function in magit to check if a branch is in sync with with it's remote (basically I want to check if both branches sit on the same commit)

At the moment I check if remote branch and the local one are sitting on the same commit, but maybe there is something I could not find yet inside magit already?

(s-equals? (magit-rev-parse (magit-get-current-branch))
           (magit-rev-parse (magit-get-push-branch)))


texts: How can Magit add a credential to ssh-agent?

texts:
Can I make Magit add my ssh passphrase to ssh-agent instead ask me to use the passphrase a single time?

Every time I push a commit to my remote I need to type my passphrase or instead run M-& ssh-add PATH_TO_MY_CREDENTIAL to add it to my ssh-agent.


texts: Always open buffer in a new frame instead of a window

texts:
I found this question which suggested that setting pop-up-frames to a non-nil value should enable this behaviour. However when I added (setq pop-up-frames t) to my emacs init only some of the buffers was created in a new frame.

Opening files, org-agenda and org-capture does not open a new frame whereas mini-buffer complete, the command ran when press tab after M-x creates a new frame.

How can I make emacs always open buffers in new frames / GUI windows as opposed to splitting my current frame in half?

Thanks in advance for all help.

Olav


texts: orgmode agenda view: use not only org-agenda-files, but also predefined buffers

texts:
The org-agenda-list function produces a view from the files returned by org-agenda-files.
Is it possible to include additional active buffer(s), not files?

My idea is that I use an external tool, make a call with start-process and the output is redirected to a named buffer, and the buffer would be automatically included into agenda. The tool serves as data conversion/integration tool and output from it is org-mode compatible.
I'l like to keep the output in memory (a buffer) and don't save to the file.


texts:
Running Doom Emacs 2.0.9 on Emacs 27.1.
I have in installation of org-roam with the following set-up:
(setq org-roam-directory "~/Documents/organize/org-mode")

FWIW, I use the same directory as my org directory:
(setq org-directory "~/Documents/organize/org-mode")

I have created a few notes with several backlinks and everything works as expected.
One thing is bothering me, though. There is no trace of the database needed to run roam.
Where should the roam database file be? In what name?


texts: How to import directory structure to org-mode heading?

texts:
I can show directory structure in emacs using M-! tree --dirfirst according to the answer here. But how to import a directory structure to emacs or org-mode heading ?

I want to have like:

- directory A
- directory AA
  - file A
- directory B
  - file B
- directory C
  - file C

Is there any workaround?

I tried using freeplane to import my folder structure, but always get wrong type argument p when importing to org file using org-freemind. using org-toggle-heading also does not help me.

thanks.


texts: Command C-M- not working on mac os high sierra

texts:
I have emacs 25.2 installed on my Mac. Yesterday I updated the OS to High Sierra and the command C-M-<SPC> to highlight s-expressions is not working any more. Can you help me?

Thanks


texts: Org-mode 8.3: Beamer blocks without title no longer work?

texts:
I recently upgraded my org-mode from 8.2 to 8.3. So far all works well, but I ran into the following problem: when creating a LaTeX Beamer presentation in org-mode I used to be able to do the following to get a block without a title:

**                                  :B_block:
   :PROPERTIES:
   :BEAMER_env: block
   :END:
   Text in block without title

With Org 8.3 I get the text :B_block: as title of the block instead of not title at all.

Here is a MWE:

#+OPTIONS: toc:nil
#+TITLE: A title
#+DATE: 2015-09-17
#+AUTHOR: The Presenter

#+LATEX_CLASS: beamer
#+BEAMER_THEME: Madrid

# The following line gives access to the C-c C-b key for headings
#+startup: beamer

* Introduction
** A block                              :B_block:
   :PROPERTIES:
   :BEAMER_env: block
   :END:
   Some text in the block.
**                                  :B_block:
   :PROPERTIES:
   :BEAMER_env: block
   :END:
   Text in block without title

With Org 8.2 this gives the following slide:

And Org 8.3 gives:

I didn't find anything related in the Changelog. Did I miss something or have I found a bug? Or have I made some practical use of a bug that has now been 'fixed' ;-)?


texts: Auctex+sumatraPDF on Windows inverse search. want to remove the CMD windows

texts:
I am using Auctex+SumatraPDF on Windows now. I have set them working well, except a small annoying thing.

Every time I do the inverse search from SumatraPDF to Emacs, a Windows command window show up and disappear soon. I've already used --no-wait option in SumatraPDF, but still I can't get rid of the black window completely.

Is there anything I can do to remove it completely, though it is not a big deal.


texts:
My .emacs file contains the following code to make hunspell work, however I get the following error message when starting flyspell-mode:

Starting new Ispell process hunspell with deutsch-hunspell dictionary...
Error enabling Flyspell mode:
(ispell-phaf: No matching entry for deutsch-hunspell.
)

Any idea of how to fix this?

(add-to-list 'ispell-local-dictionary-alist '("deutsch-hunspell"
                                              "[[:alpha:]]"
                                              "[^[:alpha:]]"
                                              "[']"
                                              t
                                              ("-d" "de_DE"); Dictionary file name
                                              nil
                                              iso-8859-1))

(add-to-list 'ispell-local-dictionary-alist '("english-hunspell"
                                              "[[:alpha:]]"
                                              "[^[:alpha:]]"
                                              "[']"
                                              t
                                              ("-d" "en_US")
                                              nil
                                              iso-8859-1))

(setq ispell-program-name "hunspell"          ; Use hunspell to correct mistakes
      ispell-dictionary   "deutsch-hunspell") ; Default dictionary to use

hunspell -D gives:

 hunspell -D
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/dw/.openoffice.org/3/user/wordbook:.openoffice.org2/user/wordbook:.openoffice.org2.0/user/wordbook:Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/de_DE
/usr/share/hunspell/de_LU
/usr/share/hunspell/de_BE
/usr/share/hunspell/en_US
/usr/share/myspell/dicts/hyph_lt_LT
Can't open affix or dictionary files for dictionary named "en_AU".

I am working on an ubuntu 15.10 box with emacs 24.5.1


texts: Customizable variable with predefined alist keys

texts:
I'd like to create a customizable variable foo-paths with certain options.

(defcustom foo-paths nil
  "Paths for foo-related things."
  :group 'foo
  :options '(foo-1 foo-2)
  :type '(alist :key-type symbol :value-type (file :must-match t)))

I'd like for the user to only be able to provide values for the specified keys in :options, not to add new options.

The manual doesn't offer a way to do this--the user can add new elements to the alist through the Customize interface.

Is there a way to achieve this? The functionality may not be impacted by the addition of new alist elements, but it seems strange that there's no way to specify a variable that has certain options and only those options.


texts: idefun : a macro to turn defun into an 'interactive' defun?

texts:
I have a pattern like this scattered all over my .emacs:

(defun my/function ()
   (interactive)
   (....stuff)
)

I would like to write a idefun macro so I could write as following instead:

(idefun my/function ()
   (... stuff)
)

So far, based on my previous ilambda macro post, I tried this business:

   (defmacro idefun (name para &rest body)
       `(defun ,name ,para (interactive) ,body))

   (idefun my/idefun-test ()
            (message "defun function"))

   ;I would like it to translate to:
   ;(defun my/idefun-test ()
   ;         (interactive)
   ;         (message "defun function")
   ;  )

Now 'my/idefun-test' is listed under M-x, but when running it tells me 'invalid function'.

I have two questions/requests:
1) Does anyone know how to get the above to work?
2) Would it be possible to implement a version that conditionally inserts function documentation if the first item is a string? (like in the lambda post)I.e:

(idefun my/test () "function docu" (message "MEH"))
Should translate to:
(define my/test () "function docu" (interactive) (message "MEH"))

[EDIT SOLUTION]
NOTE: It is not reccomended to use a macro like this in a public package/library as it may lead to confusion. But for a personal .emacs it might just about prevent rsi.

Based on the answer below, I pieced together the following working macro:

(defmacro idefun (name para docOrBody &rest body)
  (if (and (stringp docOrBody) body) ;if first arg is a string type
  ;then
  `(defun ,name ,para
     ,docOrBody ;this is the function documentation string in this case.
     (interactive)
     ,@body)
  ;else
  `(defun ,name ,para
     (interactive)
     ,docOrBody ,@body)) ;otherwise it is the body.
  )

;-------
;Examples follow
;-------
(idefun my/id2 ()
         (message "it works"))
(idefun my/id2-with-docu ()
         "Function documentation"
         (message "it works with docu"))

(idefun my/id2-args (a)
        (message a))

(idefun my/hello-moto ()
    "Function docu :-D!"
    (message "Hello moto"))

(global-unset-key (kbd "<f8>"))
(global-set-key (kbd "<f8>") 'my/hello-moto)

;This is funny if read out loud.
(idefun u () (message "I am your father"))


texts: Spacemacs kept repositioning the cursor when there's unmatched parenthesis

texts:
I'm new to Emacs, and there's one thing I don't understand. Suppose there's a file called test.el, which have the following contents:
(setq

Yes, the parenthesis is not closed, because I haven't finished this file. But when I positioned my cursor just after setq and typed a SPC to continue to write the code, the cursor moved back to the beginning of the line. Why? How can I prevent it from repositioning the cursor, it's annoying.
This problem only occurs with Spacemacs and lisp code, I didn't found the problem with the vanilla Emacs.


texts: Org mode C-c C-c to display inline image

texts:
For below org mode code example:

#+BEGIN_SRC plantuml :file test.png
Alice -> Bob: synchronous call
Alice ->> Bob: asynchronous call
#+END_SRC

#+RESULTS:
[[file:test.png]]

After press C-c C-c, the result is as above. If I need to show it as image, I have to run "M-x org-display-inline-image" command.

Is it possible to combine the "C-c C-c" and "M-x org-display-inline-image" together? It's better to still use "C-c C-c" shortcut.


texts:
I am creating a yasnippet to create org-mode link  with content like:
[[$1:value-read-from-clipboard][$0]]

I wish the $1 read value from clipboard (the use-case is: I copy the URL from chrome browser and use this yasnippet to automatically attach the URL string into a link in org file).

I am using evil-mode, so the clipboard value is saved in "* register.

Question is:
1.how to read clipboard value in yasnippet, perhaps by elisp code?
2.I am open to any better solution to achieve this use-case.


texts: Connecting to HipChat XMPP via jabber.el

texts:
I'm trying to connect to HipChat via jabber.el. Here is my configuration:

(setq jabber-account-list '(("myhipchatid@chat.hipchat.com"
                             (:network-server . "chat.hipchat.com")
                             (:password . "secret"))))

When I try to connect using jabber-connect I continually get this error:

  nil@nil: connection lost: `Couldn't connect to nil:5222: binding stack
  not balanced (serious byte compiler bug)'

This leads me to believe that jabber-connect is not picking up the values I set in jabber-account-list. Can anyone provide guidance?

For what it's worth I've been working off of this gist: https://gist.github.com/puffnfresh/4002033

Final update: thanks all for the help! I've written up the final form of my working configuration here: https://gist.github.com/bitops/77308b347bceb54302a2


texts: What is happening when my uncommitted changes temporarily disappear from magit?

texts:
More then once when I have been reviewing changes to be committed in magit, the pending changes have unexpectedly disappeared from the status buffer. I'm pretty sure it's because I am accidentally hitting some key, but I have no idea which key. It is as if I told magit to ignore all uncommitted changes. If I close out of emacs completely, open the appropriate file, and run magit-status, then the uncommitted changes will have returned as expected and I can go ahead an commit them.

What key or function might be causing saved, uncommitted changes to be temporarily hidden or ignored like that? If I do it again, what else can I try next time, instead of closing emacs, that might make them visible again?


texts: Emacs bulk indent for Python while `cua-mode` is enabled

texts:
I'd like to know how to indent multiple lines while Python is my major mode. The link below answers my question for the most part:

https://stackoverflow.com/questions/2585091/emacs-bulk-indent-for-python

However, is there a way to accomplish this while you have the following line in your .emacs file?

(cua-mode t)

When I attempt C-c > while cue-mode is enabled, nothing happens.


texts:
I am trying to write a macro.  I have read the manual and learned about macroexpand.  However, when I use it, I find the expansion difficult to read and work with.

How can I expand a macro in a readable, workable format?

Let me illustrate.

If I simply call macroexpand, the result is echoed in the minibuffer.  When the expansion is large, the echo is all scrunched up:

(macroexpand '(with-temp-file (make-temp-file "test-file")))

I can go to *Messages* with C-h e, copy and paste it back into *scratch*, and then format it.  But clearly that gets tiresome.

To save on the copy/paste, I have tried using eval-last-sexp with a universal argument, C-u C-x C-e.  This indeed prints the output to the buffer...but it's in some weird interactive state that I cannot edit.  Pressing RET causes it to alternate between an abbreviated and expanded form:

Abbreviated (expressions contain ellipses):

Expanded (Placing point before the expansion and pressing RET causes the ellipses to expand and not insert a line break):

After calling macroexpand, C-h k RET shows that elisp-last-sexp-toggle-display is now the binding for RET.

All of this implies some kind of workflow.  However, the documentation for macroexpand describes none of this behavior.  The source code is not distributed with my version of Emacs (Emacs 26.3 for Windows).  Scouring the web has found no meaningful explanation of how to work with macro expansions.


texts:
Here's what I have:

(defun my-show-duplicate-lines ()
  (interactive)
  (highlight-lines-matching-regexp
   (concat "^"
           (regexp-quote
            (substring-no-properties
             (thing-at-point 'line) 0 -1))
           "$")
   font-lock-warning-face))

My intention is to add this to post-command-hook to find lines where I'm duplicating logic, but when I run the command a second time, it's ineffective (and the old font-locking is still in effect).

The second problem is caused by font-lock not refreshing itself.  I've tried adding a (font-lock-mode -1) (font-lock-mode 1) to the definition, but it was ineffective.

I have no idea why the command would be only good for one run, though.


texts: How modify this function, that it will detect the visibile buffers in all windows?

texts:
I found a function, that will kill all buffers except the current buffer that's open.

(defun kill-other-buffers ()
  "Kill all buffers but the current one.
Doesn't mess with special buffers."
  (interactive)
  (when (y-or-n-p "Are you sure you want to kill all buffers but the current one? ")
    (seq-each
     #'kill-buffer
     (delete (current-buffer) (seq-filter #'buffer-file-name (buffer-list))))))

It works great. However, when I have two windows open with a different buffer in each window, I noticed it kills the visible buffer in the other window too, except for the buffer where the cursor currently in is.

I studied the manuals of Emacs, in order to detect the open buffers that are visible  in all windows. But I found not one. So I'm wondering if anyone have a good suggestion for this?


texts: How to start SLIME in a full window from the command line

texts:
I am looking for command-line solution for starting SLIME in a full window when starting Emacs. I need a command-line solution because I do not always want to start SLIME when starting Emacs (only sometimes).
This is the solution I am currently using:
emacs --eval '(let ((pop-up-windows nil)) (slime))'

It seems to work; it starts SLIME in a full window when starting Emacs. Since I am not an Emacs expert, I have no idea if it is appropriate or if there is a better way. Is there a better way?


texts:
I am a complete newbie when it comes to emacs. I've got this problem with my 25.2.1 emacs running on Windows 10. Trying to run a python code results in the following error.

Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support
readline, yet ‘python-shell-completion-native-enable’ was t and "python"
is not part of the ‘python-shell-completion-native-disabled-interpreters’
list.  Native completions have been disabled locally.

This problem has been discussed at this forum before in the following link Your ‘python-shell-interpreter’ doesn’t seem to support readline

I have tried all the tricks stated in that link but have had no success

(with-eval-after-load 'python
  (defun python-shell-completion-native-try ()
    "Return non-nil if can trigger native completion."
    (let ((python-shell-completion-native-enable t)
          (python-shell-completion-native-output-timeout
           python-shell-completion-native-try-output-timeout))
      (python-shell-completion-native-get-completions
       (get-buffer-process (current-buffer))
       nil "_"))))

Do you have any suggestions for me?


texts: How to access variables/lists by the strings of their names, prompted interactively

texts:
I have a question about how to use interactive to allow the user to identify a desired list element to output.

Let's say I have a variable x assigned to a list structured like this:

(setq x '((y ("y1")
             ("y2")
             ("y3"))
          (z ("z1")
             ("z2")
             ("z3"))))

If I want to retrieve the text "(y1)" from this structure and show it to the user, I know that I can do so by using:

(message (format "%s" (nth 1 (assoc 'y x))))

The problem comes when I try to do the same thing interactively. Let's say I want to write a function that asks the user for the variable name and the desired list (y or z), then retrieves the first associated element:

(defun find-first-associated-value (varname listname)
  (interactive
   "sWhich variable? :
sWhich list? :")
  (message (format "%s" (nth 1 (assoc listname varname)))))

If I try to call this function and fill in the right values, I get the error Wrong type argument: listp, "y".

I can tell the reason this isn't working is that I'm passing strings (varname and listname) to assoc, which expects a KEY and then VALUE. The problem is that I can't figure out how to convert the user-inputted strings collected by interactive to those forms so that they can be understood by assoc. How can I fix this? I'd be very grateful for any help, and I apologize if the question is poorly worded--I'm new to programming in Lisp.


texts: It would be nice to have the help system present in Vim when using Emacs evil-mode (:help command). I searched online and could not find a way to do this since only the native Emacs C-h help menu is available. Is there a way to do this?


texts: Wrap line/text in org-mode when I re-open a file

texts: I run emacs 24.5 and word/line wrap works fine when I write new text. However, when I reopen an org file, the text is not wrapped. This makes it hard to read text I have written before. Is there a setting or something that I can change to fix this?


texts:
I went through the documentation of both the function but they don't seem to shed much information. What is the actual difference between them apart from the fact that load is a built-in function in C source code whereas load-file is an interactive list compiled function.

What is the recommended function to use in init.el since both seem to be doing the same job ?


texts: How can I show the full path to the current file in the mode-line for Spacemacs (Spaceline)?

texts:
I'd like to display the full path instead of just the filename itself.

How can this be done?

So essentially where it says .spacemacs in the below image (seems this mode-line is called "Spaceline"):


texts:
Usually I use incremental searching to find what I'm looking for. Also, in general I write very small methods that easily fit in one screen. So before now I have had little use for any sort of code-folding mechanism, which is good because of the general communal distaste for such things.

But one exception to this is with tests. Right now I use rspec and I'm finding it frustrating to navigate the tests. A test file I'm working on has about 500 lines so far and is structured like this:

Rspec.describe SomeClass do
  let(:some_common_variable) { create :the_thing }
  context 'with foos' do
    it 'does a thing' do
      # ... ~10 lines of arrange -> act -> assert stuff
    end
  end
  context 'with bars' do
    it 'does a thing differently' do
      # ... ~10 lines of arrange -> act -> assert stuff
    end
  end
end

So as you can see this makes some common-sense coding styles (like short methods) impossible.  At the end of these tests I also have:

        end
      end
    end
  end
end

which makes it pretty tricky to figure out which "end" I want to insert a new test after -- especially because the matching do is not on the screen.

My question is: When I'm in the middle of some test, is there some way I can generate a breadcrumb that looks like this:

Someclass / with foos / it does a thing

Right now I'm using M-x occur with a regex I wrote that includes things like it, context, Rspec.describe, etc. to get an outline. Also, is there some code folding mode that makes it easy to quickly fold everything in an "it" block without folding everything else, but also have the ability to fold everything else with a different command.


texts:
I have a git repo and I have changes in different directories.

user@box:~/myrepo$ git st
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   emacs/basic.el
    modified:   emacs/elisp.el
    modified:   tips/emacs-tips.org
    modified:   tips/linux-tips.org

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    emacs/wip.el
    tips/sqlite.org

no changes added to commit (use "git add" and/or "git commit -a")

Using command line I can select to show my changes on a selected directory.
For example:

user@box:~/myrepo$ git st emacs/
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   emacs/basic.el
    modified:   emacs/elisp.el

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    emacs/wip.el

no changes added to commit (use "git add" and/or "git commit -a")

How can I do that in magit, if possible?


texts: Emacs function to convert an arbitrary ORG PROPERTY into an arbitrary string (namely, a LaTeX label)?

texts:
I have many documents as org-files which have a CUSTOM_LABEL property, like

* Introduction
  :PROPERTIES:
  :CUSTOM_LABEL: AP 1
  :END:

In this case, the files need to be exported as LaTeX, translating each CUSTOM_LABEL as a \label{marker}. The example above should translate to \label{AP 1}.

I know already how to call custom functions at export time, but I am not expert enough to write a defun to do that particular conversion, ie CUSTOM_LABEL -> \label{}

How can the defun to inject a custom_label as \label{} be written?

I would appreciate even just some pseudo-code, or some pointers.

I am asking this question here instead of other places, because this is more an Emacs question, since I searched thoroughly the org-mode manual, and that kind of feature is currently unavailable.

A generic function to convert a given PROPERTY when exporting (LaTeX, HTML, or any other format), would be even better.

Thank you.


texts: Prevent Org mode from raising Emacs frame while exporting to PDF

texts:
Some of my org mode files take a long time to export because they include code for number crunching that is executed during export (via Org Babel) .  I usually minimize the Emacs frame while the export process is running and work on something else.  Unfortunately, the Emacs frame is automatically raised during export and I think it happens every time pdflatex is run (three times).  These frames then get in my way and I have to minimize them again and again.  How can I prevent Org mode from raising the frame during export?

Edit: Minimal example:

emacs -Q
M-x package-initialize
M-: (setq org-confirm-babel-evaluate nil)
Open a new file test.org and paste content shown below.
C-c C-e l p to export to PDF via LaTeX.
Immediately minimize Emacs frame using window manager.
Wait 5 seconds.

Result: Emacs frame raised after ~5s.

#+BEGIN_SRC emacs-lisp :exports results :results value
(if (sit-for 5)
    "Finished waiting."
  "Interrupted while waiting.")
#+END_SRC

Edit 2: I'm using Emacs 26.0.60 (compiled from source) with Org mode 9.1.6 (from ELPA) but I have been experiencing this problem with many versions of Emacs and Org mode and for at least three years (before that I didn't use Org's exporting facility).  My window manager is FVWM2 on Ubuntu 16.04.4 LTS.


texts: How to correctly write regular expression to match ASCII control chars

texts:
I would like to to create a regular expression in elisp (in the standard 'read' form) to match extended ASCII chars the same as PCRE does:

^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$

So, I'm currently сonfused about \x7f-\xff. Is there a way to set a range using something like \xhh?


texts: Restrict available command options in AuCTeX

texts:
I'm using AuCTeX (v.11.89.6 with Emacs 25.1). I have no problems with it, just a small nuisance. Whenever I use TeX-insert-macro (C-c C-m) I get many options I never use. For instance, when I wish to insert the command \enquote{...}, I run TeX-insert-macro and start typing enq. The first option I get is MakeHyphenQuote and so I have to scroll down to select enquote.

To go around this issue, I used to edit the csquotes.el style file and remove MakeHyphenQuote from the list. However, each time AuCTeX updates itself, my file is removed and all customisation gets lost.

I also tried editing the TeX-symbol-list variable (which, according to apropos-value, seems to hold these commands), but couldn't make it to work.

So my question is whether I can remove MakeHyphenQuote (or any other command or environment) from the list used by AuCTeX for command insertion.

Update: just to clarify, I'm using ivy-mode.


texts: Translating editing actions to keypresses for ansi-term?

texts:
For the speech recognition mode for emacs I'm working on I'd like to have support for working with the shell. I have shell-mode working fine but I'd really like to get ansi-term working since some apps are only usable in it, and completion and history work so much better.

The issue is that all of my custom speech commands for editing text expect they can operate on the buffer directly, while ansi-term only listens to keyboard events. If I use a speech command (which sends commands with emacsclient -e) to run (insert "echo hello") the text gets inserted into the ansi-term buffer, but then when I press enter "hello" is not echo'd because the underlying shell didn't get any keyboard events. Likewise if I use some voice navigation commands and then press a key, the text looks like it's inserted in the right place but when I hit enter I can see from the errors that the shell thinks the keypress inserted text wherever the cursor was before -- the emacs point and the shell cursor are out of sync.

The only solution I see is to track where the shell thinks the cursor is, and whenever I do an editing action to emulate a series of keypresses to move the cursor there, and likewise simulate keypresses for inserting text. This approach could also work for tab completion. I see this as being pretty laborious and error prone though. Is there a better way? Or a package that already tackles this?

Edit: I forgot that I'd tried line mode before and run into other problems. In line mode completion doesn't work and nothing is read only so you can wreck the prompt and previous output. If there were solutions for each of those it could work.


texts: change value of a defvar after loading package

texts:
I load a package that defines a list of radio stations with defvar

(defvar default-list
'((station1) (station2)))

I want to redefine this list after loading the package (I am using require) because a lot of the stations are defunct.


texts: How to insert a result of an org-mode source block as part of the document's syntax?

texts:
Say I have the following source block:

#+NAME: heading
#+BEGIN_SRC python :exports none
  return "** Some outline"
#+END_SRC

And I insert it inlined in my buffer by using

* Another outline
call_heading()

Is it possible to specify that I want the result to be inserted as pat of the actual syntax? That is, it should appear as a new outline exactly where I inserted my call.


texts:
I'd like org-mode to use a particular theme. To this end, I've put the following in my init.el:
;; Setup org-mode theme
(defun org_setup()
  "Setup org-mode"
  (load-theme 'doom-laserwave)
  )

;; Startup hook for org-mode
(add-hook 'org-mode-hook
      (org_setup))

Curiously, whatever file I open (e.g., even init.el) this theme is used. Why is that? My (limited) understanding is that this code should only be run if org-mode is initiated. Am I doing something daft?


texts: How to eliminate the html headline number?

texts:
I am using org mode to write blogs, after publishing the project, I found the
titles of the html has an line number before it. as below:

This is the original org file:

I don't like this. Is there a way to eliminate the number before title after exporting to html?

and this is my publish config:

(setq org-publish-project-alist
  '(("github-blog"
 :base-directory "/Users/blog/org/post/"
 :publishing-directory "/Users/blog/_posts/"
 :prepare-function nil
 :completion-function nil
 :exclude "*.html"
 :recursive nil
 :base-extension "org"
 :publishing-function org-html-publish-to-html
 :section-number nil
 :headline-levels nil
 :body-only t
 )))


texts: Is there an efficient way to tell which parts of my startup of Emacs take the longest to load?

texts:
I have been trying to make the start-up times better. Almost all of my init.el is broken into use-package declarations like this:
(use-package x ...)
(use-package y ...)
(use-package z ...)

I want to start optimising those parts of the init.el that take the longest. Is there a way to do something like,
(use-package x ...)
; print load time for x
(use-package y ...)
; print load time for y
(use-package z ...)
; print load time for z

I know for the entire file you can do something like this (message (time-subtract after-init-time before-init-time))


texts:
When we add tags to a headline, they just get appended. For instance,

* Head 1 :A:C:B:
* Head 2 :B:A:C:

Is there a way I can sort these tags so we get:

* Head 1 :A:B:C:
* Head 2 :A:B:C:


texts:
Working on .py files, I know how to get emacs to use 4 spaces as an indent by default. I also know how to get it to use the tab character by default. I'd like to leave it at using spaces by default, but recognize when tab characters are used and use that instead (for my older python files). I know I can just untabify everything, but this might not be an option when working on someone else's code and they'd like to use tabs instead (for whatever reason).

I created 2 simple files consisting of:

a = 1
if a == 1:
    b = 1

In one file, that indent is using 4 spaces while the other file uses a tab character. I can't get Emacs to recognize the difference. I am using Elpy, but I've tried this with Elpy disabled. I've also tried this with a blank init file and having only the modifications to tab. Anyone know the solution to this?

I've been messing around with the following:

(add-hook 'python-mode-hook
    (lambda ()
       (setq indent-tabs-mode t)
       (setq tab-width 4)))

Setting indent-tabs-mode to t makes it always use a tab character. Setting it to nil makes it always use spaces. I've also tried the following:

(add-hook 'python-mode-hook 'guess-style-guess-tabs-mode)
(add-hook 'python-mode-hook (lambda ()
                            (guess-style-guess-tab-width)))

This will only use spaces in Python files... What do?


texts: org-date-from-calendar returns yesterday's date: how to initialize and refresh Calendar Buffer

texts:
From where is the current date as known by org-mode taken? Do I need to perhaps adjust some TimeZone settings? Or is the date determined by the date my Emacs session was started. I close emacs pretty rarely.

Some more info:

After a restart, org-date-from-calendar give me

No buffer named *Calendar*

However if I first do org-time-stamp which will pop up a Calendar buffer to let me select a date, and then later use org-date-from-calendar we're back in business and the date is current.

So it seems that the Calendar buffer needs to be initialized an also refreshed somehow.


texts: How to open system's command line at the directory of the current buffer?

texts: Is there any easy way to open the system command line interface (e.g., cmd in Windows) at the directory containing the current buffer (if any)? Note that M-x shell open a command line interface within emacs, hence does not answer the question. I also tried M-x shell-command cmd but this also open the command line interface within emacs.


texts:
I just want to erase history here - the very last entry. This shouldn't be dangerous, right?

I figured I need to somehow transform (undo-tree-current buffer-undo-tree) and pass that to undo-tree-snip-node but I don't see exactly how to do that.


texts: How to make emacs automatically spell check all visible text?

texts:
When flyspell is enabled it doesn't show spelling errors on all visible text (like most text editors that support spell checking).

When moving the cursor over text, misspelled words become underlined.

While running flyspell-buffer works, it's a manual operation and can be slow on large files.

Is there a way to run the spell checker on visible text, updating after scrolling?
Perhaps using delays so it doesn't make scrolling lag.


texts: abbrev table inherit properties from other tables?

texts:
Q: how can I get abbrev tables to inherit properties?

Motivation: I'd like to mix and match abbrevs such that some expand automatically when typing, while others expand only when I explicitly tell them to via expand-abbrev.  (See a previous question on this issue.)

Solution in a simple case: cribbing from the accepted answer on the above question, one can define a single abbrev to expand explicitly with:

(define-abbrev text-mode-abbrev-table "abbrev" "expansion value" nil
  :enable-function (lambda () (eq this-command 'expand-abbrev)))

Problem: I've got a whole bunch of abbrevs I'd like to use, so doing the above for each one would be tedious.  It should be possible to use define-abbrev-table to automate everything, and then have the actual abbrev tables inherit from them.  So, consider the following two tables:

(define-abbrev-table 'automatic-table
  '(("test1" "This should expand automatically")
    ;; ... more abbrevs here
    ("test2" "This should also expand automatically")))

(define-abbrev-table 'explicit-table
  '(("test3" "This should expand only after expand-abbrev")
    ;; ... more abbrevs here
    ("test4" "This should also expand only after expand-abbrev"))
  :enable-function (lambda () (eq this-command 'expand-abbrev)))

It seems like it should then be possible to do the following:

(define-abbrev-table 'text-mode-abbrev-table nil
  "Table's docstring"
  :parents (list explicit-table automatic-table))

It does not quite work out, however.  text-mode-abbrev-table correctly inherits the abbrevs defined in automatic-table and explicit-table, but they always fire automatically when typing.  In other words, the :enable-function property on explicit-table gets ignored.

How can I ensure that the :enable-function property gets inherited for the abbrevs in the relevant table without being applied to abbrevs in a different table?


texts: Does word syntax take script into account?

texts:
I call count-words-region (M-x =) on US/RU/IPA string:

HelloПривheləʊ

The following message is printed:

Region has 1 line, 4 words, and 14 characters.

All symbols have w syntax, but differ in script:

(char-syntax ?H) ; ?w
(char-syntax ?П) ; ?w
(char-syntax ?ʊ) ; ?w
(aref char-script-table ?H)  ; script: latin
(aref char-script-table ?П)  ; script: cyrillic
(aref char-script-table ?ʊ)  ; script: phonetic

Does that mean that word boundary is defined not only by char syntax but also by char script?

I would like to disable this behavior for selected modes in order to be able to navigate across words but not across scripts. How can this be achieved?

UPDATE Useful further discussion on debbugs.


texts: Make browse-url follow URLs with line breaks?

texts:
How can I make browse-url follow URLs with line breaks?

Example from RFC 1738:

Yes, Jim, I found it under <URL:ftp://info.cern.ch/pub/www/doc;
type=d> but you can probably pick it up from <URL:ftp://ds.in
ternic.net/rfc>.  Note the warning in <URL:http://ds.internic.
net/instructions/overview.html#WARNING>.

Example from RFC 3986, which updates 1738:

Yes, Jim, I found it under "http://www.w3.org/Addressing/",
but you can probably pick it up from <ftp://foo.example.
com/rfc/>.  Note the warning in <http://www.ics.uci.edu/pub/
ietf/uri/historical.html#WARNING>.


texts: How to schedule repeatable sequences of tasks

texts:
I've been trying to find the right approach of scheduling a repeatable sequence of tasks:

first approach was to mark the parent as repeatable and children as normal tasks.

* TODO This is the parent task
SCHEDULED <2020-01-01 Wed ++1w>
:PROPERTIES:
:ORDERED:  t
:END:
** TODO This is 1st subtask
** TODO This is 2nd subtask

The downside of this approach is that once marking the parent task as done, I need to manually change the state of the child tasks back to TODO.
the second approach I have tried is to mark both the parent and child tasks as repeating.  This approach doesn't work (at all) as the parent can never be marked as DONE.

(This behavior led to the 3rd approach)
in the third approach, only the child tasks are marked as repeating.  The parent task is never marked as DONE (it's not possible) and it actually never shows up in agendas either.

Are there other approaches?  Can I improve on any of the approached above?

thank you


texts: How can I make an interactive function be local to directories?

texts:
I want to make it so that I have interactive functions that can only be called from buffers in a certain directory, like variables in .dir-locals.el. Is there a way to do this?

For example, say I'm writing a program that has configuration files. I'd like to be able to invoke M-x new-conf, which will make a new conf file in the same directory as the buffer I invoke it in. However, I only want to be able to call it from buffers in a certain directory.


texts: How to use global tags list when tagging text files with org mode and helm?

texts:
I use emacs with org- and helm-mode in windows, and I store my agenda files in my /journal/ directory:
(setq org-agenda-files '("C:/Users/.../journal/")).

My agenda files mainly contain notes, structured under one or more headlines within each file, and with one or more tag added to each headline. A headline can thus look like this:
* My note for thursday :family:car:expences: where the single tags are within a pair of colons.

If I use the command M-x org-tags-view I get a list for all tags used in all the .org files in my /journal/ directory. This global tags list would have been great to have access to when I am tagging headlines inside a single .org file.

However, when I use the command M-x org-set-tags, when my point is within a headline, the resulting helms output is a local tags list, i.e. a list of tags  collected only from within the single file I am about to tag, and containing no tags from any of the other .org files in the /journal/ directory.

I have two questions:

(1) How can I make helms give me access to the global tags list when I am tagging headlines within a single file inside my /journal/ directory?

(2) How can I easily update the global tags list if I add tags to a file that is not from within this list?


texts: Emacs current-time value and Windows RealTimeIsUniversal

texts:
I have linux and windows dual booted on pc and linux is using utc as default while windows registry is set to yield utc time by setting qword:00000001 to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal. Now i am in a timezone of UTC+6 hours. On linux if i run (current-time) from emacs its showing the current time. But on windows if i run (current-time) its showing the localtime instead of utc. So its 60 hours early on windows according to emacs. How can i get the proper time with this registry settings in action ?
Emacs version - 27.1
Windows 10


texts: Can I avoid outdated byte-compiled elisp files?

texts:
Occasionally, when I start Emacs, I get a message like.

  Source file `/home/USER/.emacs.d/elpa/....el' newer than byte-compiled file

Also, I sometimes edit a package I'm developing and forget to
recompile it. When I try to load the new file, it takes me a while to
realise that Emacs is still using the old compiled file.

Is there a way I can tell Emacs to completely avoid byte-compiled files that are older than their respective source files?


texts: How to perform case-sensitive query-replace?

texts: When I do M-x query-replace to replace all occurrences of v by w,  then it also matches V (uppercase V). How to force emacs to only find lowercase v ?


texts: How can I log the commands magit uses for values?

texts: I'm bringing up a new machine and some operations are very slow. I'd like to re-run the commands magit is sending in a normal shell so I can use perf to see where time is being spent. magit-git-debug only logs output of failed commands and I don't really want the output but just the commands themselves.


texts: How to change face in particular theme locally?

texts: The title says it all. How to change face in specific color theme locally, in my configuration?


texts:
Let's say I want to provide partial input to an interactive function such as insert-char. For example, I might want to have a command that automatically starts typing GREEK SMALL LETTER or BOX DRAWINGS.

This does not work, because call-interactively exits before insert is called:

(defun insert-box-drawing-char ()
  (interactive)
  (call-interactively 'insert-char)
  (insert "BOX DRAWING"))

How can I provide partial input to an interactive function?


texts:
When using find-alternate-file, to refresh the file in the current buffer, point is always moved back to the start of the file.

How can I get point to be moved to where I was in the file before invoking find-alternate-file?


texts: string-match matches buffer contents, instead of argument string

texts:
I am trying to parse file permissions using string-match. My code is,

(setq fmode (nth 8 (file-attributes "/Users/sk/a.js")))
(message "file mode is as, - %s" fmode)
(string-match "^.\\(...\\)\\(...\\)\\(...\\)$" fmode)
(message "User permission -  %s" (match-string 1))
(message "Group permission - %s" (match-string 2))
(message "Others permission - %s" (match-string 3))

It outputs,

file mode is as, - -rw-r--r--
User permission -  (se
Group permission - tq
Others permission - fmo

As one can see, instead of parsing the file mode string, -rw-r--r--, string-match parses the buffer contents from the beginning position.

My case is very similar to the documented example here, but i am clueless why it doesn't work?


texts: Where and when should emacs lisp files be byte-compiled?

texts:
Do you have examples of packages that benefit substantially from byte-compilation?

I would prefer to avoid byte-compiling files when it is not necessary, in particular when installing hundreds of packages, since it takes significantly longer to byte-compile. A comment in the package.el source even suggests that "Compilation should be done as a separate, optional, step."

The Byte Compiling section of the Emacs manual states:
"As a practical matter, for most things you might do to customize or extend Emacs, you do not need to byte compile".

The Elisp manual includes an example of the performance of byte-compiled code: "In this example, the interpreted code required 10 seconds to run, whereas the byte-compiled code required less than 4 seconds. These results are representative, but actual results may vary."

EDIT: Where "substantially" means a measurable difference like the example above in the running time of a package feature, or a measure of the latency of UI interaction.


texts: Why won't emacs permanently save my buffer-local var?

texts:
For many files I have file-local variables which asked me once if they were safe and I could add them permanently to my "trusted" list, never to be asked again. However, I get asked every time on the following file variable, and it doesn't give me the option to save it. I even added it manually to my trusted vars, but no luck. Anyone know why?
# -*- next-error-function: nil;-*-
;; that was the first line of my file


texts:
I would like to run force-compile (see Run TeX-command-run-all when there are no changes in .tex-file) on a region of my LaTeX document.

(defun force-compile ()
"Set the file modification times on the current file, then call
TeX-command-sequence.
This forces a complete recompilation of the document, even if the
source
(.tex) is older than any existing outputs (.pdf etc)."
(interactive)
(set-file-times (buffer-file-name)) ;; sets mod time to current time
(TeX-command-sequence t t))

I was already able to bind force-compile to C-c C-a which then compiles the file even when there are no changes in the file itself. Now I want to be able to do the same on a region of the file.

How can i use force-compile on a region of the LaTeX-file?


texts: Any easy way to get forward/backword word movement with "word" defined as everything non-whitespace, similar to vim's W and E?


texts:
I recently installed Emacs and I'm trying to configure it in a useful way. However, I'm finding really hard to correctly set up matlab-mode, which should provide autocompletion and linting.
I noticed that if I run matlab-shell then autocompletion works fine, but I want it to work also when I'm editing .m files.
Here is my matlab-mode configuration:
;;Matlab mode
(matlab-cedet-setup)
(ac-config-default)
(autoload 'matlab-mode "matlab" "Matlab Editing Mode" t)
(add-to-list
 'auto-mode-alist
 '("\\.m$" . matlab-mode))
(setq matlab-indent-function t)
(setq matlab-shell-command "matlab")
(add-hook 'matlab-mode-hook 'auto-complete-mode)
(setq mlint-programs (quote ("/home/mattia/MATLAB/R2020a/bin/glnxa64/mlint")))
(add-hook 'matlab-mode-hook (lambda () (mlint-minor-mode 1)))
(setq matlab-show-mlint-warnings t)
(setq matlab-highlight-cross-function-variables t)

With this configuration, even though I'm able to run matlab-shell, nothing happens when I open a .m file -- no completion and no linting (also no snippets but I think snippets are not included in matlab-mode right?).
Moreover, I made sure to have both "company" and "auto-complete" installed on my Emacs.
I'm no expert and I'm not very familiar with Lisp, but I looked everywhere on the internet and everyone seems to suggest to just add a few lines on your init file and that's all, but nothing changed for me.  Any suggestion?


texts: Regular expression matching group replacement not working

texts:
I want to convert

.waitForVisible('.someselector')
.click();

Into:

.waitAndClick('.someselector');

Automatically in a lot of files. So I wrote:

(defun hhaamm-replace-regexp-in-buffer (from to)
  (goto-char (point-min))
  (while (search-forward-regexp from nil t)
    (replace-match to nil nil))
  )

And I'm calling it in this way:

(hhaamm-replace-regexp-in-buffer "waitForVisible(.*)[\t
 ]*\.click()" "waitAndClick(\1)")

But I'm getting:

.waitAndClick(^A);

The expected result is:

.waitAndClick('.someselector');

Why the regexp group is not being replaced with the first matching group?

I also tried with \0 and it didn't work either.


texts:
I use Emacs mostly to write R using ESS. I like a large font to reduce eye strain so the last line of my .emacs file is:

(set-default-font "Inconsolata-20")

If I open a file of R code, this appears as one would expect. However, additional frames opened with C-x 5 2 have a tiny font. Typically this happens when I eval the buffer and want to look at the resulting ESS/R session in a separate frame.

I assume there is something overiding the default font, but cannot find what it might be. Strangely, sometimes the default font is respected, but I cannot reproduce.

How can I force all new frames to honor the default font?


texts: Is there a way to limit Helm matches from all sources?

texts:
I don't mean helm-candidate-number-limit, because it apparently limits candidates from the individual sources, so if you set it to 100 and have two sources and the first source returns 70 candidates and the second 50 then you get 120 candidates regardless of the limit.
I'd like a limit which applies globally that is Helm takes candidates from the first source and if it's over the limit it stops.  Otherwise, it goes to the second source and if the candidates from it plus the candidates from the first source goes over the limit then it stops, and so on.
So that Heml goes for the next source only if it does not have enough candidates from the already processed sources.


texts: Write function that runs a command only after a previous command finishes

texts:
I would like to create a function that runs a command only after a previous command that takes some input from the user finishes running. In particular, I would like to write a function that runs a command after magit-pull:

(defun test ()
  (interactive)
  (call-interactively 'magit-pull)
  (read-key)
  (command)
)

The above function works only when magit-pull does not ask me for a password. However, when magit-pull asks me to enter my password in the minibufer, the above code won't work. I suppose I need to add some code that will only run "command" only after magit-pull is finished. Does anyone know of how I can implement this?


texts: Org-mode: blocks incorrectly parsed as org-mode markup

texts:
I noticed a really weird behavior related to #+begin_xxx/#+end_xxx block. It turns out that contents inside those blocks are parsed as org-mode markup. That is, inside a block:

* at the beginning of a line is considered as a heading. A direct impact is that org-global-cycle fold/unfold incorrectly sectioning.
[[not a link]] is considered as an org-mode link. Export to pdf (org-latex-export-to-pdf) the org file will raise the error Unable to resolve link: "not a link" as it would fail to resolve unexisting links.
and probably more...

MWE

emacs-version = 26.3

org-version = 9.2.6

* H1
** H2
#+begin_example
* Should not be rendered as a heading!
[[Should be avoided when exporting]]
#+end_example

#+begin_src c
* sp  = "Should not be rendered as a heading!"
// [[Should be avoided when exporting]]
#+end_src

Issue: org-cycle (Tab)

Issue: org-global-cycle (Shift+Tab)

Issue: org-export-latex-to-pdf

Related question

Emacs org-mode source block incorrectly parsed as a link in export (unable to resolve link)


texts: orgmode: underscore automatically generates math-mode

texts: When I type an underscore _ in org-mode, it automatically generates math mode, i.e. $_{}$ and it puts the cursor between the braces. Is there a way to disable this when in edit mode but not in math mode?


texts:
In compilation-mode (or some similar mode), how can I make the default py.test output be colourized?

I'm not talking about clickable links, but about just 'syntax' colouring the various parts of the output.  Scare quotes because there are multiple syntaxes going on in the same buffer (python code snippets, various kinds of stack info, and other py.test output like the 'FAILURES' line), and because py.test's output perhaps isn't that standardized.

I'd be happy with just some of this structure highlighted, but the more the merrier.


texts: Expanding Dired to show subdirectories/files?

texts: One of the biggest things I miss from other editors (e.g. Sublime, Intellij) is the ability to see the project structure, and expand/minimize directories as needed so I can see what I care about. Is there something like Org mode hierarchy where I can use a hotkey to expand a subdirectory as needed?


texts: How can I get Emacs to save the changes automatically each X seconds?

texts: How can I setup Emacs >= 24.4 so that it saves at least the current file I'm working on automatically, say, each 5 seconds, so that I don't have to press C-x C-s each time to save my changes?


texts:
I am using emacs 24.4. I have added a large number of installed packages via the M-x list-packages directive over about a year of usage. I would love to export my installed packages list for use elsewhere. Copying my .emacs gives me some errors on startup, which jogs my memory to install certain things. I suspect I could copy the .emacs.d, but that seems like maybe a bad idea.

Is there a procedure or directive I can issue to dump the list of installed packages to a file that can be used to get them on foreign machines easily?


texts: What is the difference between file mark for delete and marked file and delete?

texts:
Windows 10, Emacs 25.1, Dired+

If I want to delete files in Dired mode I have 2 options:

Flag files for deletion (by pressing d) and then delete them by pressing x
Mark files by m and then delete them by pressing D

What are the differences between these approaches? Why are both options available?


texts:
i have a bunch of tags i define via:

(:startgroup)
("Where?")
(:grouptags)
 ("@home" . ?h)
 ("@work" . ?w)
 ("@pc" . ?p)
 ("@family" . ?f)
 ("@shop" . ?s)
 (:endgroup)
 (:startgrouptag)
("people")
(:grouptags)
("allan" . ?a)
("bob" . ?o)
("joel" . ?j)
("david" . ?d)
("boris" . ?b)
("massimo" . ?s)
(:endgrouptag)

anyone know of a way to quick add tags via a helm/avy interface?

right now its quite cumbersome to press C-c then C-c to see a list of all tags. also some tags have the same key (?a) and then its impossible to select the 2nd one

Z


texts:
I have two displays and different frames on each. Each display has very different DPI so I need different fonts sizes for them.

How can I set different fonts sizes for different frames (font size changes not applied globally)?


texts: Modification of kill-ring-save to copy current word/line/whole buffer/ if no region is selected

texts:
I would like to write a function which

on the first execution behaves like the regular kill-ring-save if some region is selected
on the first execution copies the current word if no region is selected,
on the second execution copies the current line
on the third execution copies the current paragraph
on the fourth execution and so on copies the whole current buffer

Eventually I would like to remap kill-ring-save to this new function.
So far I have written this

    (defun modified-kill-ring-save () (interactive)
    (if (region-active-p) (kill-ring-save (region-beginning) (region-end))
(if (not  (equal last-command 'modified-kill-ring-save))
 (progn (select-current-word) (kill-ring-save (region-beginning) (region-end)) )
 (progn (select-current-line) (kill-ring-save (region-beginning) (region-end))  )   )  )
      )

which does 1, 2 and 3. But I am not able to go further.

In the above code I have used the following functions from http://ergoemacs.org/emacs/elisp_examples.html

(defun select-current-line ()
  "Select the current line"
  (interactive)
 (beginning-of-line) ; move to end of line
  (set-mark (line-end-position)))

(defun select-current-word ()
"Select the word under cursor.
“word” here is considered any alphanumeric sequence with “_” or “-”."
 (interactive)
 (let (pt)
   (skip-chars-backward "-_A-Za-z0-9")
   (setq pt (point))
   (skip-chars-forward "-_A-Za-z0-9")
   (set-mark pt)
 ))


texts: Can I use "comment-column" for comments in other modes than emacs-lisp-mode?

texts:
Emacs-lisp-mode distinguishes multiple kinds of comments.

; is an "end of line" comment when following code, or a "right-margin" comment obeying comment-column when indented with indent-for-tab-command. This style is partcilularly useful for commenting on a code detail, since the indentation and alignment deemphasizes the comment.
;; will be aligned with the indentation of surrounding code and is especially useful as a header of code sections or for longer comment text, where necessary.

I haven't seen this distinction in other modes; indent-for-comment (M-;) will happily indent to comment-column for end-of-line comments, but comments on their own line seem to be indented like ;;, not like ;.

Is there some way to make emacs allow ; style indentation also for other modes, such as shell-script-mode?

if [ $THIS_IS = $A_CODE_LINE ]; then
                           # I want to be able to comment
                           # on the right-side margin
    ## and inline with
    the code
fi


texts:
In a keyboard macro, there is an occur command. While recording the macro, I switched to the occur window, did some editing, closed occur buffer reverted back to original buffer to continue editing.

When I try executing that keyboard macro, it fails just after opening the occur window.

How do I get the macro to continue executing the commands?


texts: Setting include file paths for clang in .dir-locals.el

texts:
I'm working on an embedded system and need to limit clang to only the header files of the embedded system code while I'm editing its code. I need to make the following work:

Make sure that company-mode with the clang backend only includes stuff inside the header files of the embedded system.
Make sure that C-c C-e includes system headers of the embedded platform

In other words, if a file contains #include <stdio.h> it should look into the folder /home/<user>/src/include and not e.g. /usr/include. I assume this should be done by making sure that -nobuiltininc is always passed to clang together with the appropriate -I/home/<user>/src/include. My question is what should I put in the .dir-locals.el file under ~/src?


texts: Magit forge: updating the branch of a pull request

texts:
Does forge support updating the branch of a PR?
Suppose that I checked out a PR branch with b y, and afterwards there were additional commits into this PR.
It seems that I cannot pull these new commits with magit-pull, because pushRemote is not set, and upstream is set to master.
The only way I see to update the branch is to delete the PR's branch, and then check it out again with b y. Am I right on this one? Is there a more convenient way to do this?


texts: Why does emacs insert a `#coding` header into my file?

texts:
I have a file where every time I save the file emacs inserts a # coding: utf-8 at the top of the file. I'm using the prelude package.

How do I turn this off? I'm having a hard time tracing where this is coming from.


texts:
Sometimes when I copy+paste into my spacemacs over SSH, I get some random garbage that seems to be due to spacemacs interpreting some of the pasted content as commands. In vim, my workaround is to run r! cat, paste what I want into the cat command, then Ctrl-D to exit. When I run M-x shell-command ENTER cat ENTER, however, I get (shell command succeeded with no output) immediately, and no prompt.
What is the right way to get the equivalent of r! cat from emacs (or spacemacs, in particular)?


texts: Move org-mode subtree to another subtree using arrows

texts:
With this tree structure:

* A
** A.1
** A.2
** A.3
a3a3a3a3a3a3a3
* B
* C
** C.1
*** C.1.1
*** C.1.2
*** C.1.3
** C.2
** C.3

… I can move C.1 (with its children) up and down with M-↑ and M-↓. Easy.

If I use M-S-↑ and M-S-↓, only the C.1 node is moved, without its children. Easy, too, however the Manual claims in http://orgmode.org/manual/Structure-editing.html:

  M-S-<up>     (org-move-subtree-up)

  Move subtree up (swap with previous subtree of same level).

  M-S-<down>     (org-move-subtree-down)

  Move subtree down (swap with next subtree of same level).

… so, really, it should be the other way round. Nevermind, though.

Also, using M-S-↑↓, the C.1 node can be moved out of its parent, C. When this happens, the C.1 node always keeps its level (** in this case), no matter where it ends up.

Now, what I want to achieve is to move the whole C.1 subtree, the whole branch with all the children, similarly, out of C, while keeping its ** level.

This could be done with org-refile or killing the subtree C-c C-x C-w and yanking it at some new point, however, nothing beats the ↓ ↑ experience (especially when I’ve got to move hundreds of such trees after importing my notes from Wunderlist).

Using GNU Emacs 25.0.50.1 and Org-mode version 8.3.2 (8.3.2-10-g00dacd-elpa).


texts: How can I make fill-paragraph regard the formatting rules of Python docstrings?

texts:
If I press M-q in a docstring like this, then the line breaks in the docstring get messed up:

def foo(word):
  """
  This is a function that does something.
  @param word: str, input.
  @returns: True
  """

becomes this

def foo(word):
  """This is a function that does something. @param word:
  str, input. @returns: True
  """


texts: AUCTeX cannot find a working Tex distribution and don't know how to install exec-path-from-shell

texts:
When I was trying to export the pdf file. It notifies me this.

And then I searched on Google. People suggest me check the method in the link below.
https://github.com/purcell/exec-path-from-shell
But I got stuck on the first step, "add the following into your init.el."
Where is init.el??
And how to evaluate (getenv "SHELL") ??


texts: Edebug: instrument function without setting breakpoint?

texts:
If I have a buffer with the contents

(defun foo()
  (interactive)
  (bar)
  (message "foo"))

(defun bar()
  (interactive)
  (message "bar"))

...and call eval-buffer with edebug-all-defs set to t, then both calls to foo and bar directly throw me into edebug-mode (despite not having set any breakpoints).

On the other hand, if I set edebug-all-defs to nil, evaluate the buffer with eval-buffer and then manually instrument the foo definition with edebug-eval-defun (C-u C-M-x) things work a little better: calling foo invokes the debugger, and calling bar does not. However, when stepping through foo, I'm now unable to step into the bar function (presumably because it hasn't been instrumented, the error is Don't know where `bar' is defined. Stepping over the call to bar works just fine and gives the correct result).

Is there a way to instrument all functions in a buffer without making them breakpoints at the same time?

Emacs 24.4.1 on Debian Jessie. Running with -Q does not seem to make a difference.


texts:
I am debugging why emacs crashes when using a function from a package1. The aim of this debug process is to get useful data to submit using M-x report-emacs-bug.

To get help on how to debug emacs crashes, I have already looked at Emacs Manual - Crashing and Emacs Manual - After a Crash, but they did not help.

The After A Crash manual refers to emacs-buffer.gdb but I have no idea how to use it. While asking google for help, I came across this emacs.SE question, and I recompiled emacs using the -ggdb3 flags.

I have no prior experience using gdb and so I tried few failed attempts to use the emacs-buffer.gbd file.

Here's what I tried:

gdb -x /path/to/emacs-buffer.gdb
gdb -> file /path/to/emacs-buffer.gdb
gdb -> source /path/to/emacs-buffer.gdb
source /path/to/emacs-buffer.gdb

On a side note, emacs compiled with the -ggdb3 flag takes about 10 seconds longer to load; earlier it was 5-6 seconds, now about 16-17 seconds. I know the exact seconds because of a code that calculates that in my init. Is this increase in startup time expected?

Footnote 1: emacs crashes consistently when undo-tree tries to restore the undo history for a particular .org file (which I cannot share publicly). I have (setq undo-tree-auto-save-history t). This crash happens only on the emacs git master, not on emacs 24.5. On emacs 24.5, undo-tree throws an error stating that it's unable to load the undo history (even through the undo history file exists), but at least the emacs session does not crash on that version.


texts: How do I automatically start a new journal entry at emacs start up)

texts:
Putting (org-journal-new-entry) in the init file doesn't work, neither does setting the scratch buffer mode to journal-mode.

Kurt Hesselbart's answer works only halfway if there already is an entry for the day, instead of adding a new one it opens the last. As the function description says:

  Giving the command a prefix arg will just open a today's file,
  without adding an entry

However it didn't work at all without a prefix arg.

Works not at all if there is no entry for the day already, starting emacs with the -debug-init option then gets the following backtrace:

Debugger entered--Lisp error: (error "before first heading")
  signal(error ("before first heading"))
  error("before first heading")
  outline-back-to-heading(t)
  show-entry()
  org-journal-new-entry((22041 37049 594411 222000))
  eval-buffer(#<buffer  *load*> nil "/home/anon/.emacs" nil t)  ; Reading at buffer position 7751
  load-with-code-conversion("/home/anon/.emacs" "/home/anon/.emacs" t t)
  load("~/.emacs" t t)
#[0 "\205\262


texts: ipdb displaying ansi color escape sequences

texts:
I'm trying to set up realgud using ipdb with emacs. The problem is that the following is displayed at the command prompt (running realgud:ipdb): [6n[Jipdb> [6D[6C[6D[J[6n[Jipdb> [6D[6C

From googling around, I came across various links that I think explain what the problem is, but the solutions therein didn't fix my problem:

https://stackoverflow.com/questions/25094855/visible-ansi-escape-sequences-when-running-emacs-shell-these-are-not-ansi-color

Why does *compilation* buffer show control characters?

Any help would be greatly appreciated!


texts: How to enable fuzzy autocomplete in auto-complete and/or company-mode

texts: I've searched for a long time and tried some suggestions from respective manuals like ac-use-fuzzy etc, but haven't been able to enable fuzzy matching. I mean I want it start without pressing any special keys.


texts: Spacemacs mode-line unicode characters: what do they mean?

texts:
I've found it hard to discover the source or meaning of the unicode characters in the mode-line. All questions I've found referencing them are about how to get them to display correctly --- e.g. this question refers to the same characters I'm talking about.

What are these characters? What information do they convey? Where are they set, and how would I configure them if I decided to?


texts: put menus, defined in packages, as submenu into own menu-bar menu

texts:
Introduction: The menu-bar is a nice institution of emacs to remember a command and its shortcut. Using then easy-menu-define for defining own menus is pretty awesome with regard to this purpose. So it is possible to cluster certain commands or stuff them into submenus.

(easy-menu-define my-menu global-map
    "My Menu docstring"
    '("My-Menu-Title"
      [ "foo item" foo-item-callback ]
      ("foo submenu"
       [ "foo submenu item" foo-sub-item-callback ]))

Also some packages (for example: Hide/Show from hideshow.el) use easy-menu-define to define own top-level menus. They define it like this:

(easy-menu-define hs-minor-mode-menu hs-minor-mode-map
  "Menu used when hideshow minor mode is active."
  '("Hide/Show"
     ...)

Question: I'm sure it somehow possible to stuff this, in package Hide/Show, defined menu hs-minor-mode-menu as a submenu into my own defined menu my-menu.
How could I achieve this?

Note: I do not want to have the hs-minor-mode-menu as popup menu. This could be easily achieved by calling hs-minor-mode-menu as menu item callback. I'd like a real submenu.

Edit: This answer is working to relocate my own defined menus, but not for the Hide/Show menu. Also this answer does not help to remove the hs-minor-mode-menu from global menubar.


texts: I can not figure out how to change current line bg in ranger - I'm unable to find customize group for that, is that possible at all? Maybe its inherited from other dired face, can somebody point me out to that face if its so? Thx.


texts: Performance differences in comparing symbols and strings

texts:
In sx.el, we have a case where we need to verify if we've passed GET or POST as an argument.

Currently we have the argument passing as a string and are using (string= "GET" url-method) to compare it to "GET".

Is there any elisp/byte-compilation advantage to changing it to a symbol (equal url-method 'GET)?


texts:
Emacs 24.3 had a nice way of inserting text into rectangles:

Select rectangle.
C-x r t <string-to-be-inserted> RET

This doesn't seem to work in Emacs 24.4. I tried rectangle-mark-mode using C-x SPC. I could managed to insert a yanked rectangle, but how does one insert fresh text into the rectangle?

Thanks in advance!


texts:
Input and desired output

Original code                       Commented out code:
C %% MODULE %% module_name           C~ CPR C ## MODULE ## module_name
lines of code                        C~ CPR lines of code
lines of code                        C~ CPR lines of code
.....                                C~ CPR .....
.....                                C~ CPR .....
.....                                C~ CPR ....
....                                 C~ CPR ....
....                                 C~ CPR ....
C %% END MODULE %% module_name       C~ CPR C ## END MODULE ## module_name

Steps:

The cursor (point) is usually somewhere in between the C %% MODULE %% and C %% END MODULE %%
Select the lines between C %% MODULE %% and C %% END MODULE %% and replace-string %% with ##
The C-x C-xto make the repeat the last selection and run string-insert-rectangle and insert the comment text C~ CPR -

My Function (I'm new to elisp, bear with my terrible code)

(defun comment-pdtn()
  (interactive)
  (set-buffer (buffer-name))
  (search-backward "C %% MODULE %%")
  (set-mark (- (point) 14))              ;; 14 is the # of char in C %% MODULE %%
  (search-forward "C %% END MODULE %%")
  (message "begin at %s and ends at %s" ;; Want to ensure that region selection happened
           (region-beginning)
           (region-end))
  (string-insert-rectangle "C~ CPR "))  ;; This isn't working

(comment-pdtn)

I'm yet to add the functionality for replace-string yet.
How to implement string-insert-rectanglein Elisp? I want to write something like this,

With region ( string-insert-rectangle "C~ CPR ")
With region ( replace-string "%%" "##")

I could do this with macro and save the macro and do away with it, but I want to learn elisp that is the reason behind this question.


texts:
I often fire up a multitail

multitail -f log/development.log

Then I hit my development website with chrome.
And then I add a regexp filter to show only lines matching the word "Processing "

Can this be done without in emacs? why I'm trying to avoid multitail

its curses based, and won't work well with M-x shell
it has strict requirements about minimum window size


texts: How can I apply `emacs-maple-minibuffer` for `helm-for-files`?

texts:
=> How can I apply emacs-maple-minibuffer for helm-for-files?
I pasted emacs-maple-minibuffer's function from its README but seems like it does not take any affect. I am not sure what is missing.

setup:
(require 'helm)
(require 'helm-config)

(defcustom helm-for-files-preferred-list
  '(helm-source-buffers-list
    helm-source-recentf
    helm-source-bookmarks
    helm-source-file-cache
    helm-source-files-in-current-dir
    )

(global-set-key "\C-x\C-e" 'helm-for-files)

(use-package maple-minibuffer
  :ensure nil
  :hook (after-init . maple-minibuffer-mode)
  :config
  (setq maple-minibuffer:position-type 'window-bottom-left
        maple-minibuffer:border-color "gray50"
        maple-minibuffer:height nil
        maple-minibuffer:width 0.7
        maple-minibuffer:cache t)

  (setq maple-minibuffer:action '(read-from-minibuffer read-string)
        maple-minibuffer:ignore-action '(evil-ex eval-expression))

  ;; more custom parameters for frame
  (defun maple-minibuffer:parameters ()
    "Maple minibuffer parameters."
    `((height . ,(or maple-minibuffer:height 10))
      (width . ,(or maple-minibuffer:width (window-pixel-width)))
      (left-fringe . 5)
      (right-fringe . 5))))


texts: Where is official 64-bit Emacs for Windows? (The manual said there is!)

texts:
I usually download Emacs for Windows from the official GNU site:

http://ftp.gnu.org/gnu/emacs/windows/

The latest version is: emacs-24.5-bin-i686-mingw32.zip

I'm curious that why there's no 64-bit?

From the Emacs manual:

http://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html

  2.1 Where can I download Emacs?

  Pre-compiled versions are distributed from ftp.gnu.org mirrors. Emacs
  binaries are distributed as zip files, digitally signed by the
  developer who built them. Generally most users will want the file
  emacs-24.5-bin-i686-pc-mingw.zip for the 32-bit build, and
  emacs-24.5-bin-x86_64-w64-mingw32.zip for the 64-bit build. The zip
  archive contains everything you need to get started.

  The latest source is available from ftp.gnu.org mirrors. It is
  distributed as a compressed tar file, digitally signed by the
  maintainer who made the release.

  The development version of Emacs is available from Savannah, the GNU
  development site.

Since the manual said there's 64-bit, where is it?

Update

Here is the response from the debugs.gnu.org:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20851

Basically,

The FAQ docs is obsolete.
64-bit Emacs on Windows is built by volunteers, and there's no such volunteer currently.
They've removed the obsolete docs from the Emacs repo. Web pages get updated at next release.


texts: Org capture template output to two files

texts:
I am currently using two separate Org files to manage my work Todos. One is a file that I edit directly and keep notes on each todo task (Work.org). The other is a schedule file which is synced with Google Calendar using org-gcal (Schedule.org).

At the moment I use two separate capture templates to save each todo in the two files, but this means that I have to insert data about them twice every time. Is there anyway to have one org capture template save its output to two separate files?


texts: Org mode table export latex with title (upper) and notes (lower)

texts:
I would like to create the following LaTeX type table by using the standard org-mode functions.

The LaTeX code is the following:

\begin{table}[!h]
\centering
\caption{Results}
\label{tab}
\begin{threeparttable}
\begin{tabular}{lccc}
\hline
\hline
& (1) & (2) & (3) \\
\hline
XXX & 1.60 & 2.38 & 2.80 \\
 & (1.60) & (0.98) & (1.26) \\
Observations & 20 & 20 & 20 \\
\hline
\end{tabular}
\begin{tablenotes}
\small
\item
\hspace{-12pt}\emph{Notes:}
\end{tablenotes}
\end{threeparttable}
\end{table}

In the org table editor, I can create a similar result.

#+NAME: tab1
#+CAPTION: Results
|--------------+--------+--------+--------|
|--------------+--------+--------+--------|
|              | (1)    | (2)    | (3)    |
|--------------+--------+--------+--------|
| XXX          | 1.60   | 2.38   | 2.80   |
|              | (1.60) | (0.98) | (1.26) |
| Observations |  20    | 20     |  20    |
|--------------+--------+--------+--------|

But, I would like to understand how to add the Note by using org mode.


texts:
Are there any tools available to make tracing errors in org-mode blocks easier?  (I'm working with python specifically)

My current workflow is to copy code that works to a source block, and try to make only minimal modifications.  If major errors occur, I either copy it back to another file, or tangle the block and debug the resulting file.

Are there any tools I'm missing?  (eg, something like compilation mode where it would take you to the line the error is on.)

Edit: for example, I just found C-c C-v v, which brings up a buffer with noweb references expanded.  Unfortunately, it doesn't include header arguments, so the code from this can't be run without importing those in the interpreter first.  Similarly, if I have a return statement, that keeps it from being executed, and the buffer isn't editable, so takes several steps to get runnable source from a python block.


texts: org agenda date prompt mini calendar start week on monday

texts:
When I schedule an item in org agenda, I get the calendar prompt with a mini-calendar of three month blocks. The first column is set to 'sunday'.

I would like to set the first column to 'monday' as the first day of the week, with saturday and sunday on the far right.

Does anyone know which variable governs this behavior?

Thanx,

Simon


texts: What is the work-flow for applying a patch?

texts:
Let's say I have this patch file from emacs git.

I usually fix stuff manually by reviewing the patch files. But I am sure there is an automated way to do that. I played a bit by opening package.el in emacs source and trying to use ediff-patch-file but was unsuccessful.

It would be good to get a brief walk-through for the patching process.

The patch referenced above:

---
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 444adf0..79f37e7 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2943,12 +2943,9 @@ objects removed."
                 (format status-format (cl-incf i)))
           (force-mode-line-update)
           (redisplay 'force)
-          (package-install
-           ;; Don't mark as selected if it's a new version of an
-           ;; installed package.
-           pkg (and (not (package-installed-p pkg))
-                    (package-installed-p
-                     (package-desc-name pkg))))))
+          ;; Don't mark as selected, `package-menu-execute' already
+          ;; does that.
+          (package-install pkg 'dont-select)))
     ;; Once there are no more packages to install, proceed to
     ;; deletion.
     (let ((package-menu--transaction-status ":Deleting"))
@@ -2995,6 +2992,10 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm."
                        (when .upgrade (format "Upgrad__ %s" (length .upgrade)))
                        "]")))
           (message (replace-regexp-in-string "__" "ing" message-template) "started")
+          ;; Packages being upgraded are not marked as selected.
+          (package--save-selected-packages
+           (remove-dups (append (mapcar #'package-desc-name .install)
+                                package-selected-packages)))
           (package-menu--perform-transaction install-list delete-list)
           (when package-selected-packages
             (if-let ((removable (package--removable-packages)))
--


texts: Org-mode how to automatically adjust sub-entry completion with sub-sub-entry completions

texts:
I just very recently started using Emacs Org-mode to organize my tasks, and I really don't know anything about Emacs-Lisp.

What I have achieved is to mark a TODO entry as DONE when its children(sub-entry) are marked DONE by putting these commands in my Init file as instructed by the Org-mode manual.

(defun org-summary-todo (n-done n-not-done)
  "Switch entry to DONE when all subentries are done,
to TODO otherwise."
  (let (org-log-done org-log-states) ;turn off logging
    (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
(add-hook 'org-after-todo-statistics-hook #'org-summary-todo)

However, this doesn't work when I want it to change the status of a child(sub-entry) based on this child's child(sub-sub-entry). Effectively, I have this following TODO list:

* Testing[0%]
** TODO Item1[100%]
*** DONE Item1.1...
*** DONE Item1.2...
** TODO Item2[0%]
*** TODO Item2.1
*** TODO Item2.2

and notice how the first TODO should be DONE since it's 100% completed. The above code provided in the Org-mode manual could not achieve this effect.

Is there some additional commands I can put in the Init file to make this work?


texts:
Since some time ago I've been having this message: org-mode fontification error whenever I initialize org-mode by opening an org buffer. The initialization process will just get stuck and I have to press C-g to get out of it. Strangely all seems to be working normally once I'm in org-mode. All the source code blocks are fontified correctly with syntax highlighting, so I'm not sure what is the error referring to.

There was a problem on this SE but the solution seems to not have solved the issue. Both the pre-installed org and the newest org induced the same error.


texts:
When I run package-list-packages, I'm getting an error:

The TLS connection to elpa.gnu.org:443 is insecure for the following reason:
certificate could not be verified

I found a few other reports of this, but all seemed to be due to some local mis-configuration (like this one). I ruled this out by recompiling the latest version of Emacs from the emacs-26 branch, and launching with emacs -Q (that's Emacs 26.0.91). The problem still persists.
Another clue: this only happens on my desktop running Ubuntu 14.04, not on my laptop running Debian testing. So I suspect it may be due to something important being outdated on the ancient version of Ubuntu I'm saddled with (and cannot update, it's a work computer).
How can I resolve this, or at least find the source of the problem?


texts:
I'm trying to get this latex class to work with org, anyone had any luck?
  (add-to-list 'org-latex-classes
        '("revtex"
"\\documentclass[preprint,a4paper, amsfonts, amssymb, amsmath, showkeys, nofootinbib, fleqn]{revtex4-1}
\\usepackage{amsthm}
\\newtheorem{theorem}{Theorem}
\\newtheorem{definition}{Definition}
\\newtheorem{proposition}{Proposition}
\\newtheorem{remark}{Remark}
\\newtheorem{lemma}{Lemma}
\\newtheorem{corollary}{Corollary}
\\bibliographystyle{apsrev4-1}
[EXTRA]
"
             ("\\section{%s}" . "\\section*{%s}")
             ("\\subsection{%s}" . "\\subsection*{%s}")
             ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
             ("\\paragraph{%s}" . "\\paragraph*{%s}")
             ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

the org exporter puts the title and author commands in the preamble, while the revtex class requires them to be put in the document section, is there a way to tweak org-exporter to work with it?


texts:
1.I downloads package from this: https://github.com/auto-complete/auto-complete

Type: M-x load-file RET ~/auto-complete-master/etc/install.el RET
install to: ~/.emacs.d/ RET

Installation Result show:

Successfully installed!
Add the following code to your .emacs:
(add-to-list 'load-path "~/.emacs.d")
(require 'auto-complete-config)
(ac-config-default)

However, I don't see characters AC in mode-line. I type:
M-x auto-complete-mode, but it show: [No match]
What problem with my emacs?
(GNU Emacs 23, Ubuntu 14.04)


texts: Org-mode and python source code block -> ElDoc error wrong-type-argument

texts:
When inside a python source code block in an .org file, I get the following error displayed on my mini buffer:

eldoc error:
(wrong-type-argument symbolp #[128 \300\301"\206�\300\302"\207
[apply python-eldoc-function #[128 \301\302\300!"\207
[eldoc-documentation-function apply default-value] 4
(fn &rest ARGS)] nil] 4 nil])

Has anyone ever come across this problem?
I am running the latest org-mode under Emacs 25 on a OS X 10.11.1, and I use the anaconda python 2.7 distribution.


texts: I want to get contents of the current line(the line with cursor) for my function. What command allows me to achieve this?


texts: How do I disable Centaur Tabs in ispell Choices buffer

texts:
I need to disable the Centaur-Tabs in the Choices buffer of ispell/flyspell. In Centaur Tab's site it says to add a hook, so I tried this:
(add-hook 'ispell-choices-buffer 'centaur-tabs-local-mode)

But I still get the tabs, and I can't see the words:

I'm using Emacs 27.0.91 in Windows 10.


texts: communication with remote inferior python shell slowing down code editing

texts:
I am working with python code on a remote machine using tramp. Once I start the start the remote python shell, the editor window starts to freeze up for around/under a second second at a time, but very frequently. All I am doing is moving around in the code file. It happens with both python and ipython shells.

When this happens messages flash by in the mini-buffer indicating communication with the python shell. Some messages indicate that documentation is being retrieved, even though I am not requesting it. These messages are not recorded in any other buffer like *Messages*.

How can I reduce/stop this?

My .ssh/config already has:

Host *
 ControlPath ~/.ssh/master-%r@%h:%p
 ControlMaster auto
 ControlPersist yes
 ServerAliveInterval 3
 ServerAliveCountMax 50


texts: Improve emacs performance when working on large files

texts:
I'm a former vim user that switched to emacs + evil with a still relatively simple configuration with only 36 packages. I'm really happy with the additional functionality emacs delivers, but one thing bothers me really much. Emacs is much slower when working and editing large files than vim. For example when I try to delete many lines with the "d NUMBEROFLINES d" in the magnitude of 10.000 or more emacs will freeze for some time. The same problems occurs when I try to select a large amount of lines in visual mode in similar magnitudes. In vim these things work almost immediately. I think that these performance issues are related to how emacs displays and edit text. My question is if there are any options or packages to work around these bottlenecks?
Edit:
After profiling the garbage collection (automatic gc) seems to be the source of problem. It uses up to 97% of CPU when I try to higlight a large region of text. Activating fundamental-mode and deactivating evil-mode doesn't have any effect on this.


texts: Is there a way to detect that emacs is running in a terminal?

texts:
When I run emacs in a terminal (using the -nw option) my theme is broken and some key-bindings don't work.

So, I need to disable the theme and some keybindings when running in a tty.

Is there a way to do that?


texts: magit equivalent to `git push -u origin newLocalBranch`

texts: I often create new branches locally (e.g., newLocalBranch), and then push them to the upstream remote origin, thus creating a new remote branch, using git push -u origin newLocalBranch. Is there a magit function equivalent to this operation?


texts: is there a fill paragraph with bullets combo command for emacs

texts:
With emacs how can I easily go from this:

to this (has nice indentation and fill-paragraph):


texts: what do [ *, %, >, D ] mean in ibuffer buffer?

texts:
When I open ibuffer to manage opened buffers I see   [ *, %, >, D ] markings.
There is no documentation describing what they mean.

I wonder what do they mean (Emacs 26.1) ?


texts: Virtual environment management for python.el without changing the general PATH variable in Emacs

texts:
I try to use virtualenvwrapper.el with the build-in python.el and my virtual environments in a ./.venv directory inside each project.

Because all virtual envs have the same name .venv I cannot make a list of all venvs  in venv-location. What I do instead is, when I want to work in a particular environment (say ~/my/project/.venv), I set:

(setq venv-location (list "~/my/project/.venv"))
(venv-workon (venv-dir-to-name "~/my/project/.venv")))

This works as expected for instantiating the inferior Python process via M-x run-python: This process runs in the virtual env  ~/my/project/.venv.

However because venv-workon seems to change Emacs' general PATH variable, normal swells (started with M-x shell) are affected too: They all get the virtual env~/my/project/.venv`. But I do not want this for my normal shells.

How can I manage my Python virtual environments for python.el's Python processes , but not for shell and all other processes? Do other libraries (like pyenv) handle this as I want it?(*)

(*) I had tried pyvenv earlier and if I remember it right I had the same issue: Normal shell get thesame virtual env as my python project.


texts:
When writing lisp codes, sometimes I'm deep in a nested expression and all I want is to insert all the missing closing parenthesis. Right now I'm just inserting them until I get a mismatched paren, but it's not very efficient.
Is there any command to insert all the missing parentheses?

FYI, I'm using smartparens to automatically insert matching parens. Still, sometimes I just need to do this.


texts: How to edit and return value of string in Emacs Lisp?

texts:
Here is what I wish to achieve:

(defun rcd-edit-value (value)
      (let ((file (make-temp-file "rcd-db-" nil ".txt" value)))
        (find-file file)
        (string-from-file)))

(defun string-from-file (file)
  "Return file content."
  (with-temp-buffer
    (insert-file-contents file)
    (buffer-string)))

However (find-file file) is not blocking the function, function returns before the file was edited and killed. I would like to edit the file, and return, so that value is returned back, and that temporary file remains on the disk.


texts: Programatically get available movements evil emacs

texts:
Is there a way to programatically get the available movement commands for evil emacs?

Preferably also with the key they are currently bound to.

(There are a lot of commands for movement, but I do not know whether they are grouped or categorized in a way that makes them accessible as movement commands.)


texts: org-mode How to use latex nested environments?

texts:
I want to use a matrix environment that is included in an outer environment, so:
Environment:
\begin{equation*}
\left|
\begin{matrix}
a_1 & b_1\\
a_2 & b_2
\end{matrix}
\right|
\end{equation*}

Display--math:
\[
\left|
\begin{matrix}
a_1 & b_1\\
a_2 & b_2
\end{matrix}
\right|
\]

Inline--math:
\(
\left|
\begin{matrix}
a_1 & b_1\\
a_2 & b_2
\end{matrix}
\right|
\)

But for the second and third cases (display-math and inline-math) the preview and export to latex are failed:
exported LaTeX:
Environment:
\begin{equation*}
\left|
\begin{matrix}
a_1 & b_1\\
a_2 & b_2
\end{matrix}
\right|
\end{equation*}

Display--math:
$\backslash$[
\left|
\begin{matrix}
a_1 & b_1\\
a_2 & b_2
\end{matrix}
\right|
$\backslash$]

Inline--math:
$\backslash$(
\left|
\begin{matrix}
a_1 & b_1\\
a_2 & b_2
\end{matrix}
\right|
$\backslash$)
\end{document}

org-mode preview:

Emacs 26.3
Org-mode 9.3.8


texts: How to make mode-line text look like a link/button on hover

texts:
What face/text/other property should I use to have mode-line text look like a button/link/stuff to click on while I am hovering over it with the cursor?

Some examples:

different background,
3D-like button decoration,
colorful frame/border displayed around it
other visual cues would be fine as well (as I don't know what choices are avaliable).

Otherwise it should just look like any ordinary text.

Below is a fragment of my custom mode-line which I'd like to enhance:

(setq mode-line-format
   (list
     (propertize
      (concat "[" (propertize "f" 'face 'aria2-modeline-key-face) "]:add file")
      'local-map (make-mode-line-mouse-map 'mouse-1 'aria2-add-file)) " "
     ;; [...]

PS: Is there some list of available text properties (for header/mode-line, buffer, frame border etc.) and their meanings?


texts: Emacs GDB does not load shared library symbols

texts:
I am trying to debug a C/MPI library that I have built. All objects are compiled using GCC and -ggdb, they are also linked using -ggdb.

When I try to attach a gdb session to the process with the -p PID flag from a standard shell, I have no problems. I can debug and access all source file info.

However, when I invoke a GDB session in Emacs 24.3.1, GDB reports that it cannot load my shared library:

 warning: Could not load shared library symbols for ./libllg.so.

I noticed that Emacs called GDB with the flag -i=mi is this causing the problem?

Everything is exactly the same, the symbol is found from a normal bash shell but not from the emacs GDB implementation. Any ideas?